Skip to content

Commit

Permalink
Add // NOTCONSOLE to docs
Browse files Browse the repository at this point in the history
We have 1074 snippets that look like they should be converted to
`// CONSOLE`. At least that is what `gradle docs:listConsoleCandidates`
says. This adds `// NOTCONSOLE` to explicitly mark snippets that
*shouldn't* be converted to `// CONSOLE`. After marking the blindingly
obvious ones this cuts the remaining snippet count to 1032.
  • Loading branch information
nik9000 committed Aug 12, 2016
1 parent f832eaa commit ffd226e
Show file tree
Hide file tree
Showing 23 changed files with 73 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public class DocsTestPlugin extends RestTestPlugin {
'List snippets that probably should be marked // CONSOLE'
listConsoleCandidates.perSnippet {
if (
it.console // Already marked, nothing to do
|| it.testResponse // It is a response
it.console != null // Already marked, nothing to do
|| it.testResponse // It is a response
) {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,38 @@ public class SnippetsTask extends DefaultTask {
return
}
if (line ==~ /\/\/\s*AUTOSENSE\s*/) {
throw new InvalidUserDataException("AUTOSENSE has been " +
"replaced by CONSOLE. Use that instead at " +
"$file:$lineNumber")
throw new InvalidUserDataException("$file:$lineNumber: "
+ "AUTOSENSE has been replaced by CONSOLE.")
}
if (line ==~ /\/\/\s*CONSOLE\s*/) {
if (snippet == null) {
throw new InvalidUserDataException("CONSOLE not " +
"paired with a snippet at $file:$lineNumber")
throw new InvalidUserDataException("$file:$lineNumber: "
+ "CONSOLE not paired with a snippet")
}
if (snippet.console != null) {
throw new InvalidUserDataException("$file:$lineNumber: "
+ "Can't be both CONSOLE and NOTCONSOLE")
}
snippet.console = true
return
}
if (line ==~ /\/\/\s*NOTCONSOLE\s*/) {
if (snippet == null) {
throw new InvalidUserDataException("$file:$lineNumber: "
+ "NOTCONSOLE not paired with a snippet")
}
if (snippet.console != null) {
throw new InvalidUserDataException("$file:$lineNumber: "
+ "Can't be both CONSOLE and NOTCONSOLE")
}
snippet.console = false
return
}
matcher = line =~ /\/\/\s*TEST(\[(.+)\])?\s*/
if (matcher.matches()) {
if (snippet == null) {
throw new InvalidUserDataException("TEST not " +
"paired with a snippet at $file:$lineNumber")
throw new InvalidUserDataException("$file:$lineNumber: "
+ "TEST not paired with a snippet at ")
}
snippet.test = true
if (matcher.group(2) != null) {
Expand Down Expand Up @@ -172,8 +187,8 @@ public class SnippetsTask extends DefaultTask {
matcher = line =~ /\/\/\s*TESTRESPONSE(\[(.+)\])?\s*/
if (matcher.matches()) {
if (snippet == null) {
throw new InvalidUserDataException("TESTRESPONSE not " +
"paired with a snippet at $file:$lineNumber")
throw new InvalidUserDataException("$file:$lineNumber: "
+ "TESTRESPONSE not paired with a snippet")
}
snippet.testResponse = true
if (matcher.group(2) != null) {
Expand Down Expand Up @@ -226,7 +241,7 @@ public class SnippetsTask extends DefaultTask {
int end = NOT_FINISHED
String contents

boolean console = false
Boolean console = null
boolean test = false
boolean testResponse = false
boolean testSetup = false
Expand All @@ -243,8 +258,8 @@ public class SnippetsTask extends DefaultTask {
if (language != null) {
result += "($language)"
}
if (console) {
result += '// CONSOLE'
if (console != null) {
result += console ? '// CONSOLE' : '// NOTCONSOLE'
}
if (test) {
result += '// TEST'
Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/analysis-icu.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install analysis-icu
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -31,6 +32,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove analysis-icu
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/analysis-kuromoji.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install analysis-kuromoji
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -28,6 +29,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove analysis-kuromoji
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/analysis-phonetic.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install analysis-phonetic
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -29,6 +30,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove analysis-phonetic
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
3 changes: 2 additions & 1 deletion docs/plugins/analysis-smartcn.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install analysis-smartcn
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -34,6 +35,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove analysis-smartcn
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand All @@ -45,4 +47,3 @@ The plugin provides the `smartcn` analyzer and `smartcn_tokenizer` tokenizer,
which are not configurable.

NOTE: The `smartcn_word` token filter and `smartcn_sentence` have been deprecated.

3 changes: 2 additions & 1 deletion docs/plugins/analysis-stempel.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install analysis-stempel
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -31,6 +32,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove analysis-stempel
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand All @@ -40,4 +42,3 @@ The node must be stopped before removing the plugin.

The plugin provides the `polish` analyzer and `polish_stem` token filter,
which are not configurable.

2 changes: 2 additions & 0 deletions docs/plugins/discovery-azure-classic.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install discovery-azure-classic
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -31,6 +32,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove discovery-azure-classic
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
6 changes: 4 additions & 2 deletions docs/plugins/discovery-ec2.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install discovery-ec2
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -27,6 +28,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove discovery-ec2
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down Expand Up @@ -140,7 +142,7 @@ discovery:
You must also set `cloud.aws.region` if you are not using default AWS region. See <<discovery-ec2-usage-region>> for details.

The ec2 discovery is using the same credentials as the rest of the AWS services provided by this plugin (`repositories`).
See <<discovery-ec2-usage>> for details.
See <<discovery-ec2-usage>> for details.

The following are a list of settings (prefixed with `discovery.ec2`) that can further control the discovery:

Expand Down Expand Up @@ -267,7 +269,7 @@ When selecting disk please be aware of the following order of preference:
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html[Instance Store] - When running clusters of larger size and with replicas the ephemeral nature of Instance Store is ideal since Elasticsearch can tolerate the loss of shards. With Instance Store one gets the performance benefit of having disk physically attached to the host running the instance and also the cost benefit of avoiding paying extra for EBS.


Prefer https://aws.amazon.com/amazon-linux-ami/[Amazon Linux AMIs] as since Elasticsearch runs on the JVM, OS dependencies are very minimal and one can benefit from the lightweight nature, support, and performance tweaks specific to EC2 that the Amazon Linux AMIs offer.
Prefer https://aws.amazon.com/amazon-linux-ami/[Amazon Linux AMIs] as since Elasticsearch runs on the JVM, OS dependencies are very minimal and one can benefit from the lightweight nature, support, and performance tweaks specific to EC2 that the Amazon Linux AMIs offer.

===== Networking
* Networking throttling takes place on smaller instance types in both the form of https://lab.getbase.com/how-we-discovered-limitations-on-the-aws-tcp-stack/[bandwidth and number of connections]. Therefore if large number of connections are needed and networking is becoming a bottleneck, avoid https://aws.amazon.com/ec2/instance-types/[instance types] with networking labeled as `Moderate` or `Low`.
Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/discovery-gce.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install discovery-gce
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -27,6 +28,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove discovery-gce
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/ingest-attachment.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install ingest-attachment
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -35,6 +36,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove ingest-attachment
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/ingest-geoip.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install ingest-geoip
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -35,6 +36,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove ingest-geoip
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/ingest-user-agent.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install ingest-user-agent
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -30,6 +31,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove ingest-user-agent
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/lang-javascript.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install lang-javascript
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -29,6 +30,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove lang-javascript
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/lang-python.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install lang-python
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -28,6 +29,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove lang-python
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/mapper-attachments.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install mapper-attachments
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -33,6 +34,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove mapper-attachments
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/mapper-murmur3.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install mapper-murmur3
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -29,6 +30,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove mapper-murmur3
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
3 changes: 2 additions & 1 deletion docs/plugins/mapper-size.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install mapper-size
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -29,6 +30,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove mapper-size
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down Expand Up @@ -106,4 +108,3 @@ GET my_index/_search
<2> Aggregating on the `_size` field
<3> Sorting on the `_size` field
<4> Accessing the `_size` field in scripts (inline scripts must be modules-security-scripting.html#enable-dynamic-scripting[enabled] for this example to work)

2 changes: 2 additions & 0 deletions docs/plugins/repository-azure.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This plugin can be installed using the plugin manager:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin install repository-azure
----------------------------------------------------------------
// NOTCONSOLE

The plugin must be installed on every node in the cluster, and each node must
be restarted after installation.
Expand All @@ -28,6 +29,7 @@ The plugin can be removed with the following command:
----------------------------------------------------------------
sudo bin/elasticsearch-plugin remove repository-azure
----------------------------------------------------------------
// NOTCONSOLE

The node must be stopped before removing the plugin.

Expand Down
Loading

0 comments on commit ffd226e

Please sign in to comment.