You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2018/01/23 05:14:02 UTC
lucene-solr:branch_7x: SOLR-11051: Use disk free metric in default
cluster preferences
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x d61aec090 -> 7da8145f7
SOLR-11051: Use disk free metric in default cluster preferences
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/7da8145f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/7da8145f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/7da8145f
Branch: refs/heads/branch_7x
Commit: 7da8145f7fc0b7ae6d1842397e4291d7a9e7ca93
Parents: d61aec0
Author: Noble Paul <no...@apache.org>
Authored: Tue Jan 23 16:04:48 2018 +1100
Committer: Noble Paul <no...@apache.org>
Committed: Tue Jan 23 16:13:46 2018 +1100
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
.../solr/client/solrj/cloud/autoscaling/Policy.java | 10 ++++++----
2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7da8145f/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f11cca7..3e18cca 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -155,6 +155,8 @@ Other Changes
collection is deleted and re-created, the autocreated configset will be left behind and will be re-used for
the re-created collection (Ishan Chattopadhyaya, Abhishek Kumar Singh)
+* SOLR-11051: Use disk free metric in default cluster preferences (noble)
+
================== 7.2.1 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7da8145f/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Policy.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Policy.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Policy.java
index 4697572..91932ea 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Policy.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Policy.java
@@ -70,7 +70,10 @@ public class Policy implements MapWriter {
public static final String CLUSTER_POLICY = "cluster-policy";
public static final String CLUSTER_PREFERENCES = "cluster-preferences";
public static final Set<String> GLOBAL_ONLY_TAGS = Collections.singleton("cores");
- public static final Preference DEFAULT_PREFERENCE = new Preference((Map<String, Object>) Utils.fromJSONString("{minimize : cores, precision:1}"));
+ public static final List<Preference> DEFAULT_PREFERENCES = Collections.unmodifiableList(
+ Arrays.asList(
+ new Preference((Map<String, Object>) Utils.fromJSONString("{minimize : cores, precision:1}")),
+ new Preference((Map<String, Object>) Utils.fromJSONString("{maximize : freedisk}"))));
final Map<String, List<Clause>> policies;
final List<Clause> clusterPolicy;
final List<Preference> clusterPreferences;
@@ -91,7 +94,7 @@ public class Policy implements MapWriter {
preference.next = initialClusterPreferences.get(i + 1);
}
if (initialClusterPreferences.isEmpty()) {
- initialClusterPreferences.add(DEFAULT_PREFERENCE);
+ initialClusterPreferences.addAll(DEFAULT_PREFERENCES);
}
this.clusterPreferences = Collections.unmodifiableList(initialClusterPreferences);
final SortedSet<String> paramsOfInterest = new TreeSet<>();
@@ -122,8 +125,7 @@ public class Policy implements MapWriter {
private Policy(Map<String, List<Clause>> policies, List<Clause> clusterPolicy, List<Preference> clusterPreferences) {
this.policies = policies != null ? Collections.unmodifiableMap(policies) : Collections.emptyMap();
this.clusterPolicy = clusterPolicy != null ? Collections.unmodifiableList(clusterPolicy) : Collections.emptyList();
- this.clusterPreferences = clusterPreferences != null ? Collections.unmodifiableList(clusterPreferences) :
- Collections.singletonList(DEFAULT_PREFERENCE);
+ this.clusterPreferences = clusterPreferences != null ? Collections.unmodifiableList(clusterPreferences) : DEFAULT_PREFERENCES;
this.params = Collections.unmodifiableList(buildParams(this.clusterPreferences, this.clusterPolicy, this.policies));
perReplicaAttributes = readPerReplicaAttrs();
}