Merge branch 'stable-2.15' into stable-2.16
* stable-2.15: Elasticsearch: Base the default number of shards on ES version Disallow change index task duplication AbstractPushForReview: Add tests for pushing with skip-validation option Add extension point to gr-user-header Change-Id: I6de8e61e110046d645c6da0bb71923d491a5764a
This commit is contained in:
@@ -42,7 +42,7 @@ class ElasticConfiguration {
|
||||
static final String KEY_NUMBER_OF_REPLICAS = "numberOfReplicas";
|
||||
static final String DEFAULT_PORT = "9200";
|
||||
static final String DEFAULT_USERNAME = "elastic";
|
||||
static final int DEFAULT_NUMBER_OF_SHARDS = 5;
|
||||
static final int DEFAULT_NUMBER_OF_SHARDS = 0;
|
||||
static final int DEFAULT_NUMBER_OF_REPLICAS = 1;
|
||||
|
||||
private final Config cfg;
|
||||
@@ -100,4 +100,11 @@ class ElasticConfiguration {
|
||||
String getIndexName(String name, int schemaVersion) {
|
||||
return String.format("%s%s_%04d", prefix, name, schemaVersion);
|
||||
}
|
||||
|
||||
int getNumberOfShards(ElasticQueryAdapter adapter) {
|
||||
if (numberOfShards == DEFAULT_NUMBER_OF_SHARDS) {
|
||||
return adapter.getDefaultNumberOfShards();
|
||||
}
|
||||
return numberOfShards;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user