Skip to content

Commit

Permalink
Merge branch 'master' into security_authz_engine
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymode committed Jan 16, 2019
2 parents 1362ab6 + ecf0de3 commit c555a44
Show file tree
Hide file tree
Showing 234 changed files with 8,108 additions and 2,778 deletions.
5 changes: 0 additions & 5 deletions buildSrc/src/main/resources/checkstyle_suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@
<suppress files="client[/\\]rest-high-level[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]client[/\\]documentation[/\\]WatcherDocumentationIT.java" id="SnippetLength" />
<suppress files="modules[/\\]reindex[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]client[/\\]documentation[/\\]ReindexDocumentationIT.java" id="SnippetLength" />

<!-- Hopefully temporary suppression of LineLength on files that don't pass it. We should remove these when we the
files start to pass. -->
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]node[/\\]Node.java" checks="LineLength" />
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]aliases[/\\]IndexAliasesIT.java" checks="LineLength" />

<!-- Gradle requires inputs to be seriablizable -->
<suppress files="buildSrc[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]gradle[/\\]precommit[/\\]TestingConventionRule.java" checks="RegexpSinglelineJava" />
</suppressions>
2 changes: 1 addition & 1 deletion buildSrc/src/main/resources/minimumGradleVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1
5.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@

import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;

import java.io.IOException;
import java.util.Objects;

public class PutWatchResponse implements ToXContentObject {
public class PutWatchResponse {

private static final ObjectParser<PutWatchResponse, Void> PARSER
= new ObjectParser<>("x_pack_put_watch_response", PutWatchResponse::new);
= new ObjectParser<>("x_pack_put_watch_response", true, PutWatchResponse::new);

static {
PARSER.declareString(PutWatchResponse::setId, new ParseField("_id"));
Expand Down Expand Up @@ -90,15 +88,6 @@ public int hashCode() {
return Objects.hash(id, version, created);
}

@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return builder.startObject()
.field("_id", id)
.field("_version", version)
.field("created", created)
.endObject();
}

public static PutWatchResponse fromXContent(XContentParser parser) throws IOException {
return PARSER.parse(parser, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,37 @@
*/
package org.elasticsearch.client.watcher;

import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractXContentTestCase;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.test.ESTestCase;

import java.io.IOException;

public class PutWatchResponseTests extends AbstractXContentTestCase<PutWatchResponse> {
import static org.elasticsearch.test.AbstractXContentTestCase.xContentTester;

@Override
protected PutWatchResponse createTestInstance() {
String id = randomAlphaOfLength(10);
long version = randomLongBetween(1, 10);
boolean created = randomBoolean();
return new PutWatchResponse(id, version, created);
public class PutWatchResponseTests extends ESTestCase {

public void testFromXContent() throws IOException {
xContentTester(this::createParser,
PutWatchResponseTests::createTestInstance,
PutWatchResponseTests::toXContent,
PutWatchResponse::fromXContent)
.supportsUnknownFields(true)
.assertToXContentEquivalence(false)
.test();
}

@Override
protected PutWatchResponse doParseInstance(XContentParser parser) throws IOException {
return PutWatchResponse.fromXContent(parser);
private static XContentBuilder toXContent(PutWatchResponse response, XContentBuilder builder) throws IOException {
return builder.startObject()
.field("_id", response.getId())
.field("_version", response.getVersion())
.field("created", response.isCreated())
.endObject();
}

@Override
protected boolean supportsUnknownFields() {
return false;
private static PutWatchResponse createTestInstance() {
String id = randomAlphaOfLength(10);
long version = randomLongBetween(1, 10);
boolean created = randomBoolean();
return new PutWatchResponse(id, version, created);
}
}
13 changes: 7 additions & 6 deletions distribution/packages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void addProcessFilesTask(String type, boolean oss) {
MavenFilteringHack.filter(it, expansionsForDistribution(type, oss))
}

into('config') {
into('etc/elasticsearch') {
with configFiles(type, oss)
}
MavenFilteringHack.filter(it, expansionsForDistribution(type, oss))
Expand Down Expand Up @@ -173,19 +173,20 @@ Closure commonPackageConfig(String type, boolean oss) {
configurationFile '/etc/elasticsearch/users'
configurationFile '/etc/elasticsearch/users_roles'
}
into('/etc/elasticsearch') {
dirMode 0750
into('/etc') {
dirMode 02750
fileMode 0660
permissionGroup 'elasticsearch'
includeEmptyDirs true
createDirectoryEntry true
fileType CONFIG | NOREPLACE
from "${packagingFiles}/config"
from "${packagingFiles}/etc"
}
String envFile = expansionsForDistribution(type, false)['path.env']
configurationFile envFile
into(new File(envFile).getParent()) {
fileType CONFIG | NOREPLACE
permissionGroup 'elasticsearch'
fileMode 0660
from "${packagingFiles}/env/elasticsearch"
}
Expand Down Expand Up @@ -229,8 +230,8 @@ Closure commonPackageConfig(String type, boolean oss) {
}
}
copyEmptyDir('/var/run/elasticsearch', 'elasticsearch', 'elasticsearch', 0755)
copyEmptyDir('/var/log/elasticsearch', 'elasticsearch', 'elasticsearch', 0750)
copyEmptyDir('/var/lib/elasticsearch', 'elasticsearch', 'elasticsearch', 0750)
copyEmptyDir('/var/log/elasticsearch', 'elasticsearch', 'elasticsearch', 02750)
copyEmptyDir('/var/lib/elasticsearch', 'elasticsearch', 'elasticsearch', 02750)
copyEmptyDir('/usr/share/elasticsearch/plugins', 'root', 'root', 0755)

// the oss package conflicts with the default distribution and vice versa
Expand Down
10 changes: 0 additions & 10 deletions distribution/packages/src/common/scripts/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,6 @@ elif [ "$RESTART_ON_UPGRADE" = "true" ]; then
echo " OK"
fi

chown -R elasticsearch:elasticsearch /var/lib/elasticsearch
chown -R elasticsearch:elasticsearch /var/log/elasticsearch
chown -R root:elasticsearch /etc/elasticsearch
chmod g+s /etc/elasticsearch
chmod 0750 /etc/elasticsearch

if [ -f ${path.env} ]; then
chown root:elasticsearch ${path.env}
fi

# the equivalent code for rpm is in posttrans
if [ "$PACKAGE" = "deb" -a ! -f /etc/elasticsearch/elasticsearch.keystore ]; then
/usr/share/elasticsearch/bin/elasticsearch-keystore create
Expand Down
13 changes: 13 additions & 0 deletions docs/reference/ccr/getting-started.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ remote cluster.
alias `leader`
<2> This shows the number of nodes in the remote cluster the local cluster is
connected to.

Alternatively, you can manage remote clusters on the
*Management / Elasticsearch / Remote Clusters* page in {kib}:

[role="screenshot"]
image::ml/images/remote-clusters.jpg["The Remote Clusters page in {kib}"]


[float]
[[ccr-getting-started-leader-index]]
Expand Down Expand Up @@ -325,3 +332,9 @@ DELETE /_ccr/auto_follow/beats
// TEST[continued]
//////////////////////////

Alternatively, you can manage auto-follow patterns on the
*Management / Elasticsearch / Cross Cluster Replication* page in {kib}:

[role="screenshot"]
image::ml/images/auto-follow-patterns.jpg["The Auto-follow patterns page in {kib}"]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/reference/ccr/images/remote-clusters.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/reference/setup.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ include::setup/bootstrap-checks.asciidoc[]
include::setup/starting.asciidoc[]

include::setup/stopping.asciidoc[]

include::setup/add-nodes.asciidoc[]
37 changes: 37 additions & 0 deletions docs/reference/setup/add-nodes.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[[add-elasticsearch-nodes]]
== Adding nodes to your cluster

When you start an instance of {es}, you are starting a _node_. An {es} _cluster_
is a group of nodes that have the same `cluster.name` attribute. As nodes join
or leave a cluster, the cluster automatically reorganizes itself to evenly
distribute the data across the available nodes.

If you are running a single instance of {es}, you have a cluster of one node.
All primary shards reside on the single node. No replica shards can be
allocated, therefore the cluster state remains yellow. The cluster is fully
functional but is at risk of data loss in the event of a failure.

image::setup/images/elas_0202.png["A cluster with one node and three primary shards"]

You add nodes to a cluster to increase its capacity and reliability. By default,
a node is both a data node and eligible to be elected as the master node that
controls the cluster. You can also configure a new node for a specific purpose,
such as handling ingest requests. For more information, see
<<modules-node,Nodes>>.

When you add more nodes to a cluster, it automatically allocates replica shards.
When all primary and replica shards are active, the cluster state changes to
green.

image::setup/images/elas_0204.png["A cluster with three nodes"]

To add a node to a cluster:

. Set up a new {es} instance.
. Specify the name of the cluster in its `cluster.name` attribute. For example,
to add a node to the `logging-prod` cluster, set `cluster.name: "logging-prod"`
in `elasticsearch.yml`.
. Start {es}. The node automatically discovers and joins the specified cluster.

For more information about discovery and shard allocation, see
<<modules-discovery>> and <<modules-cluster>>.
Binary file added docs/reference/setup/images/elas_0202.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/reference/setup/images/elas_0204.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 31 additions & 28 deletions docs/reference/sql/language/data-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,44 @@

beta[]

Most of {es} <<mapping-types, data types>> are available in {es-sql}, as indicated below:
Most of {es} <<mapping-types, data types>> are available in {es-sql}, as indicated below.
As one can see, all of {es} <<mapping-types, data types>> are mapped to the data type with the same
name in {es-sql}, with the exception of **date** data type which is mapped to **datetime** in {es-sql}:

[cols="^,^m,^"]
[cols="^,^m,^,^"]

|===
s|{es} type
s|{es-sql} type
s|SQL type
s|SQL precision

3+h| Core types

| <<null-value, `null`>> | null | 0
| <<boolean, `boolean`>> | boolean | 1
| <<number, `byte`>> | tinyint | 3
| <<number, `short`>> | smallint | 5
| <<number, `integer`>> | integer | 10
| <<number, `long`>> | bigint | 19
| <<number, `double`>> | double | 15
| <<number, `float`>> | real | 7
| <<number, `half_float`>> | float | 16
| <<number, `scaled_float`>> | float | 19
| <<keyword, `keyword`>> | varchar | based on <<ignore-above>>
| <<text, `text`>> | varchar | 2,147,483,647
| <<binary, `binary`>> | varbinary | 2,147,483,647
| <<date, `date`>> | timestamp | 24
| <<ip, `ip`>> | varchar | 39
3+h| Complex types
| <<object, `object`>> | struct | 0
| <<nested, `nested`>> | struct | 0

3+h| Unsupported types

| _types not mentioned above_ | unsupported | 0
4+h| Core types

| <<null-value, `null`>> | null | NULL | 0
| <<boolean, `boolean`>> | boolean | BOOLEAN | 1
| <<number, `byte`>> | byte | TINYINT | 3
| <<number, `short`>> | short | SMALLINT | 5
| <<number, `integer`>> | integer | INTEGER | 10
| <<number, `long`>> | long | BIGINT | 19
| <<number, `double`>> | double | DOUBLE | 15
| <<number, `float`>> | float | REAL | 7
| <<number, `half_float`>> | half_float | FLOAT | 16
| <<number, `scaled_float`>> | scaled_float | FLOAT | 19
| <<keyword, `keyword`>> | keyword | VARCHAR | based on <<ignore-above>>
| <<text, `text`>> | text | VARCHAR | 2,147,483,647
| <<binary, `binary`>> | binary | VARBINARY | 2,147,483,647
| <<date, `date`>> | datetime | TIMESTAMP | 24
| <<ip, `ip`>> | ip | VARCHAR | 39

4+h| Complex types

| <<object, `object`>> | object | STRUCT | 0
| <<nested, `nested`>> | nested | STRUCT | 0

4+h| Unsupported types

| _types not mentioned above_ | unsupported | OTHER | 0

|===

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=7b8a8b9cce0406733d2d3fab3874386c530657c73c3f4e9a3837d081e26060d8
distributionSha256Sum=53b71812f18cdb2777e9f1b2a0f2038683907c90bdc406bc64d8b400e1fb2c3b
42 changes: 42 additions & 0 deletions libs/ssl-config/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

dependencies {
compile "org.elasticsearch:elasticsearch-core:${version}"

if (isEclipse == false || project.path == ":libs:ssl-config-tests") {
testCompile("org.elasticsearch.test:framework:${version}") {
exclude group: 'org.elasticsearch', module: 'elasticsearch-ssl-config'
}
}

testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
testCompile "junit:junit:${versions.junit}"
testCompile "org.hamcrest:hamcrest-all:${versions.hamcrest}"
}

forbiddenApisMain {
replaceSignatureFiles 'jdk-signatures'
}
forbiddenPatterns {
exclude '**/*.key'
exclude '**/*.pem'
exclude '**/*.p12'
exclude '**/*.jks'
}
Loading

0 comments on commit c555a44

Please sign in to comment.