You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2021/03/10 10:09:52 UTC

[lucene] 20/33: Reformat placement plugin code to right tab size

This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch jira/solr-15016
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 8450ea8ce78d2b89421dedf9d77e749baeeda4b2
Author: Ilan Ginzburg <ig...@salesforce.com>
AuthorDate: Thu Nov 26 11:05:52 2020 +0100

    Reformat placement plugin code to right tab size
---
 .../solr/cluster/placement/AttributeFetcher.java   |  49 ++-
 .../solr/cluster/placement/AttributeValues.java    |  60 ++--
 .../solr/cluster/placement/PlacementPlan.java      |   2 +-
 .../solr/cluster/placement/PlacementPlugin.java    |  14 +-
 .../cluster/placement/PlacementPluginConfig.java   |   4 +-
 .../solr/cluster/placement/PlacementRequest.java   |  54 +--
 .../placement/impl/AttributeFetcherImpl.java       | 376 ++++++++++-----------
 .../placement/impl/AttributeValuesImpl.java        | 146 ++++----
 .../placement/impl/PlacementPlanFactoryImpl.java   |  16 +-
 .../placement/impl/PlacementPluginConfigImpl.java  |  10 +-
 .../placement/impl/PlacementRequestImpl.java       |   4 +-
 .../impl/SimpleClusterAbstractionsImpl.java        | 115 ++++---
 .../plugins/AffinityPlacementFactory.java          |  34 +-
 13 files changed, 487 insertions(+), 397 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/AttributeFetcher.java b/solr/core/src/java/org/apache/solr/cluster/placement/AttributeFetcher.java
index cb368d7..9578326 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/AttributeFetcher.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/AttributeFetcher.java
@@ -25,31 +25,49 @@ import java.util.Set;
  * <p>Instances of this interface are used to fetch various attributes from nodes (and other sources) in the cluster.</p>
  */
 public interface AttributeFetcher {
-  /** Request the number of cores on each node. To get the value use {@link AttributeValues#getCoresCount(Node)} */
+  /**
+   * Request the number of cores on each node. To get the value use {@link AttributeValues#getCoresCount(Node)}
+   */
   AttributeFetcher requestNodeCoreCount();
 
-  /** Request the disk hardware type on each node. To get the value use {@link AttributeValues#getDiskType(Node)} */
+  /**
+   * Request the disk hardware type on each node. To get the value use {@link AttributeValues#getDiskType(Node)}
+   */
   AttributeFetcher requestNodeDiskType();
 
-  /** Request the free disk size on each node. To get the value use {@link AttributeValues#getFreeDisk(Node)} */
+  /**
+   * Request the free disk size on each node. To get the value use {@link AttributeValues#getFreeDisk(Node)}
+   */
   AttributeFetcher requestNodeFreeDisk();
 
-  /** Request the total disk size on each node. To get the value use {@link AttributeValues#getTotalDisk(Node)} */
+  /**
+   * Request the total disk size on each node. To get the value use {@link AttributeValues#getTotalDisk(Node)}
+   */
   AttributeFetcher requestNodeTotalDisk();
 
-  /** Request the heap usage on each node. To get the value use {@link AttributeValues#getHeapUsage(Node)} */
+  /**
+   * Request the heap usage on each node. To get the value use {@link AttributeValues#getHeapUsage(Node)}
+   */
   AttributeFetcher requestNodeHeapUsage();
 
-  /** Request the system load average on each node. To get the value use {@link AttributeValues#getSystemLoadAverage(Node)} */
+  /**
+   * Request the system load average on each node. To get the value use {@link AttributeValues#getSystemLoadAverage(Node)}
+   */
   AttributeFetcher requestNodeSystemLoadAverage();
 
-  /** Request a given system property on each node. To get the value use {@link AttributeValues#getSystemProperty(Node, String)} */
+  /**
+   * Request a given system property on each node. To get the value use {@link AttributeValues#getSystemProperty(Node, String)}
+   */
   AttributeFetcher requestNodeSystemProperty(String name);
 
-  /** Request an environment variable on each node. To get the value use {@link AttributeValues#getEnvironmentVariable(Node, String)} */
+  /**
+   * Request an environment variable on each node. To get the value use {@link AttributeValues#getEnvironmentVariable(Node, String)}
+   */
   AttributeFetcher requestNodeEnvironmentVariable(String name);
 
-  /** Request a node metric from each node. To get the value use {@link AttributeValues#getMetric(Node, String, NodeMetricRegistry)} */
+  /**
+   * Request a node metric from each node. To get the value use {@link AttributeValues#getMetric(Node, String, NodeMetricRegistry)}
+   */
   AttributeFetcher requestNodeMetric(String metricName, NodeMetricRegistry registry);
 
 
@@ -59,12 +77,15 @@ public interface AttributeFetcher {
    */
   AttributeFetcher fetchFrom(Set<Node> nodes);
 
-  /** Requests a (non node) metric of a given scope and name. To get the value use {@link AttributeValues#getMetric(String, String)} */
+  /**
+   * Requests a (non node) metric of a given scope and name. To get the value use {@link AttributeValues#getMetric(String, String)}
+   */
   AttributeFetcher requestMetric(String scope, String metricName);
 
   /**
    * Fetches all requested node attributes from all nodes passed to {@link #fetchFrom(Set)} as well as non node attributes
    * (those requested for example using {@link #requestMetric(String, String)}.
+   *
    * @return An instance allowing retrieval of all attributed that could be fetched.
    */
   AttributeValues fetchAttributes();
@@ -73,9 +94,13 @@ public interface AttributeFetcher {
    * Registry options for {@link Node} metrics.
    */
   enum NodeMetricRegistry {
-    /** corresponds to solr.node */
+    /**
+     * corresponds to solr.node
+     */
     SOLR_NODE,
-    /** corresponds to solr.jvm */
+    /**
+     * corresponds to solr.jvm
+     */
     SOLR_JVM
   }
 
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/AttributeValues.java b/solr/core/src/java/org/apache/solr/cluster/placement/AttributeValues.java
index 4519c8a..24fcb6f 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/AttributeValues.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/AttributeValues.java
@@ -22,34 +22,54 @@ import org.apache.solr.cluster.Node;
 import java.util.Optional;
 
 public interface AttributeValues {
-    /** For the given node: number of cores */
-    Optional<Integer> getCoresCount(Node node);
+  /**
+   * For the given node: number of cores
+   */
+  Optional<Integer> getCoresCount(Node node);
 
-    /** For the given node: Hardware type of the disk partition where cores are stored */
-    Optional<AttributeFetcher.DiskHardwareType> getDiskType(Node node);
+  /**
+   * For the given node: Hardware type of the disk partition where cores are stored
+   */
+  Optional<AttributeFetcher.DiskHardwareType> getDiskType(Node node);
 
-    /** For the given node: Free disk size in Gigabytes of the partition on which cores are stored */
-    Optional<Long> getFreeDisk(Node node);
+  /**
+   * For the given node: Free disk size in Gigabytes of the partition on which cores are stored
+   */
+  Optional<Long> getFreeDisk(Node node);
 
-    /** For the given node: Total disk size in Gigabytes of the partition on which cores are stored */
-    Optional<Long> getTotalDisk(Node node);
+  /**
+   * For the given node: Total disk size in Gigabytes of the partition on which cores are stored
+   */
+  Optional<Long> getTotalDisk(Node node);
 
-    /** For the given node: Percentage between 0 and 100 of used heap over max heap */
-    Optional<Double> getHeapUsage(Node node);
+  /**
+   * For the given node: Percentage between 0 and 100 of used heap over max heap
+   */
+  Optional<Double> getHeapUsage(Node node);
 
-    /** For the given node: matches {@link java.lang.management.OperatingSystemMXBean#getSystemLoadAverage()} */
-    Optional<Double> getSystemLoadAverage(Node node);
+  /**
+   * For the given node: matches {@link java.lang.management.OperatingSystemMXBean#getSystemLoadAverage()}
+   */
+  Optional<Double> getSystemLoadAverage(Node node);
 
-    /** For the given node: system property value (system properties are passed to Java using {@code -Dname=value} */
-    Optional<String> getSystemProperty(Node node, String name);
+  /**
+   * For the given node: system property value (system properties are passed to Java using {@code -Dname=value}
+   */
+  Optional<String> getSystemProperty(Node node, String name);
 
-    /** For the given node: environment variable value */
-    Optional<String> getEnvironmentVariable(Node node, String name);
+  /**
+   * For the given node: environment variable value
+   */
+  Optional<String> getEnvironmentVariable(Node node, String name);
 
-    /** For the given node: metric of specific name and registry */
-    Optional<Double> getMetric(Node node, String metricName, AttributeFetcher.NodeMetricRegistry registry);
+  /**
+   * For the given node: metric of specific name and registry
+   */
+  Optional<Double> getMetric(Node node, String metricName, AttributeFetcher.NodeMetricRegistry registry);
 
 
-    /** Get a non node related metric of specific scope and name */
-    Optional<Double> getMetric(String scope, String metricName);
+  /**
+   * Get a non node related metric of specific scope and name
+   */
+  Optional<Double> getMetric(String scope, String metricName);
 }
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPlan.java b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPlan.java
index c4738a5..331578b 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPlan.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPlan.java
@@ -24,7 +24,7 @@ import java.util.Set;
 /**
  * A fully specified plan or instructions for placement, deletion or move to be applied to the cluster.<p>
  * Fully specified means the actual {@link Node}'s on which to place replicas have been decided.
- *
+ * <p>
  * Instances are created by plugin code using {@link PlacementPlanFactory}. This interface obviously doesn't expose much but
  * the underlying Solr side implementation has all that is needed (and will do at least one cast in order to execute the
  * plan, likely then using some type of visitor pattern).
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPlugin.java b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPlugin.java
index 28b6476..bbb52cb 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPlugin.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPlugin.java
@@ -36,13 +36,13 @@ public interface PlacementPlugin {
    *
    * <p>Configuration is passed upon creation of a new instance of this class by {@link PlacementPluginFactory#createPluginInstance}.
    *
-   * @param cluster initial state of the cluster. Note there are {@link java.util.Set}'s and {@link java.util.Map}'s
-   *                accessible from the {@link Cluster} and other reachable instances. These collection will not change
-   *                while the plugin is executing and will be thrown away once the plugin is done. The plugin code can
-   *                therefore modify them if needed.
-   * @param placementRequest request for placing new replicas or moving existing replicas on the cluster.
-   * @param attributeFetcher Factory used by the plugin to fetch additional attributes from the cluster nodes, such as
-   *                         count of coresm ssytem properties etc..
+   * @param cluster              initial state of the cluster. Note there are {@link java.util.Set}'s and {@link java.util.Map}'s
+   *                             accessible from the {@link Cluster} and other reachable instances. These collection will not change
+   *                             while the plugin is executing and will be thrown away once the plugin is done. The plugin code can
+   *                             therefore modify them if needed.
+   * @param placementRequest     request for placing new replicas or moving existing replicas on the cluster.
+   * @param attributeFetcher     Factory used by the plugin to fetch additional attributes from the cluster nodes, such as
+   *                             count of coresm ssytem properties etc..
    * @param placementPlanFactory Factory used to create instances of {@link PlacementPlan} to return computed decision.
    * @return plan satisfying the placement request.
    */
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginConfig.java b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginConfig.java
index 4f17051..d223dcc 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginConfig.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginConfig.java
@@ -73,7 +73,9 @@ public interface PlacementPluginConfig {
    * The key in {@code clusterprops.json} under which the plugin factory and the plugin configuration are defined.
    */
   String PLACEMENT_PLUGIN_CONFIG_KEY = "placement-plugin";
-  /** Name of the property containing the factory class */
+  /**
+   * Name of the property containing the factory class
+   */
   String FACTORY_CLASS = "class";
 
   /**
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementRequest.java b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementRequest.java
index 61b49dd..44222a2 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementRequest.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementRequest.java
@@ -31,34 +31,34 @@ import java.util.Set;
  * is specified (defaults to being equal to the set returned by {@link Cluster#getLiveNodes()}).
  */
 public interface PlacementRequest {
-    /**
-     * The {@link SolrCollection} to add {@link Replica}(s) to.
-     */
-    SolrCollection getCollection();
+  /**
+   * The {@link SolrCollection} to add {@link Replica}(s) to.
+   */
+  SolrCollection getCollection();
 
-    /**
-     * <p>Shard name(s) for which new replicas placement should be computed. The shard(s) might exist or not (that's why this
-     * method returns a {@link Set} of {@link String}'s and not directly a set of {@link Shard} instances).
-     *
-     * <p>Note the Collection API allows specifying the shard name or a {@code _route_} parameter. The Solr implementation will
-     * convert either specification into the relevant shard name so the plugin code doesn't have to worry about this.
-     */
-    Set<String> getShardNames();
+  /**
+   * <p>Shard name(s) for which new replicas placement should be computed. The shard(s) might exist or not (that's why this
+   * method returns a {@link Set} of {@link String}'s and not directly a set of {@link Shard} instances).
+   *
+   * <p>Note the Collection API allows specifying the shard name or a {@code _route_} parameter. The Solr implementation will
+   * convert either specification into the relevant shard name so the plugin code doesn't have to worry about this.
+   */
+  Set<String> getShardNames();
 
-    /**
-     * <p>Replicas should only be placed on nodes in the set returned by this method.
-     *
-     * <p>When Collection API calls do not specify a specific set of target nodes, replicas can be placed on any live node of
-     * the cluster. In such cases, this set will be equal to the set of all live nodes. The plugin placement code does not
-     * need to worry (or care) if a set of nodes was explicitly specified or not.
-     *
-     * @return never {@code null} and never empty set (if that set was to be empty for any reason, no placement would be
-     * possible and the Solr infrastructure driving the plugin code would detect the error itself rather than calling the plugin).
-     */
-    Set<Node> getTargetNodes();
+  /**
+   * <p>Replicas should only be placed on nodes in the set returned by this method.
+   *
+   * <p>When Collection API calls do not specify a specific set of target nodes, replicas can be placed on any live node of
+   * the cluster. In such cases, this set will be equal to the set of all live nodes. The plugin placement code does not
+   * need to worry (or care) if a set of nodes was explicitly specified or not.
+   *
+   * @return never {@code null} and never empty set (if that set was to be empty for any reason, no placement would be
+   * possible and the Solr infrastructure driving the plugin code would detect the error itself rather than calling the plugin).
+   */
+  Set<Node> getTargetNodes();
 
-    /**
-     * Returns the number of replica to create for the given replica type.
-     */
-    int getCountReplicasToCreate(Replica.ReplicaType replicaType);
+  /**
+   * Returns the number of replica to create for the given replica type.
+   */
+  int getCountReplicasToCreate(Replica.ReplicaType replicaType);
 }
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/AttributeFetcherImpl.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/AttributeFetcherImpl.java
index 97d4ba1..3c3bf49 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/AttributeFetcherImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/AttributeFetcherImpl.java
@@ -35,194 +35,194 @@ import java.util.*;
 import java.util.function.BiConsumer;
 
 public class AttributeFetcherImpl implements AttributeFetcher {
-    private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-    boolean requestedNodeCoreCount;
-    boolean requestedNodeDiskType;
-    boolean requestedNodeFreeDisk;
-    boolean requestedNodeTotalDisk;
-    boolean requestedNodeHeapUsage;
-    boolean requestedNodeSystemLoadAverage;
-    Set<String> requestedNodeSystemPropertiesSnitchTags = new HashSet<>();
-    Set<String> requestedNodeMetricSnitchTags  = new HashSet<>();
-
-    Set<Node> nodes = Collections.emptySet();
-
-    private final SolrCloudManager cloudManager;
-
-    AttributeFetcherImpl(SolrCloudManager cloudManager) {
-        this.cloudManager = cloudManager;
-    }
-
-    @Override
-    public AttributeFetcher requestNodeCoreCount() {
-        requestedNodeCoreCount = true;
-        return this;
-    }
-
-    @Override
-    public AttributeFetcher requestNodeDiskType() {
-        requestedNodeDiskType = true;
-        return this;
-    }
-
-    @Override
-    public AttributeFetcher requestNodeFreeDisk() {
-        requestedNodeFreeDisk = true;
-        return this;
-    }
-
-    @Override
-    public AttributeFetcher requestNodeTotalDisk() {
-        requestedNodeTotalDisk = true;
-        return this;
-    }
-
-    @Override
-    public AttributeFetcher requestNodeHeapUsage() {
-        requestedNodeHeapUsage = true;
-        return this;
-    }
-
-    @Override
-    public AttributeFetcher requestNodeSystemLoadAverage() {
-        requestedNodeSystemLoadAverage = true;
-        return this;
-    }
-
-    @Override
-    public AttributeFetcher requestNodeSystemProperty(String name) {
-        requestedNodeSystemPropertiesSnitchTags.add(getSystemPropertySnitchTag(name));
-        return this;
-    }
-
-    @Override
-    public AttributeFetcher requestNodeEnvironmentVariable(String name) {
-        throw new UnsupportedOperationException("Not yet implemented...");
-    }
-
-    @Override
-    public AttributeFetcher requestNodeMetric(String metricName, NodeMetricRegistry registry) {
-        requestedNodeMetricSnitchTags.add(getMetricSnitchTag(metricName, registry));
-        return this;
-    }
-
-    @Override
-    public AttributeFetcher fetchFrom(Set<Node> nodes) {
-        this.nodes = nodes;
-        return this;
-    }
-
-    @Override
-    public AttributeFetcher requestMetric(String scope, String metricName) {
-        throw new UnsupportedOperationException("Not yet implemented...");
-    }
-
-    @Override
-    public AttributeValues fetchAttributes() {
-        // TODO Code here only supports node related attributes for now
-
-        // Maps in which attribute values will be added
-        Map<Node, Integer> nodeToCoreCount = Maps.newHashMap();
-        Map<Node, DiskHardwareType> nodeToDiskType = Maps.newHashMap();
-        Map<Node, Long> nodeToFreeDisk = Maps.newHashMap();
-        Map<Node, Long> nodeToTotalDisk = Maps.newHashMap();
-        Map<Node, Double> nodeToHeapUsage = Maps.newHashMap();
-        Map<Node, Double> nodeToSystemLoadAverage = Maps.newHashMap();
-        Map<String, Map<Node, String>> syspropSnitchToNodeToValue = Maps.newHashMap();
-        Map<String, Map<Node, Double>> metricSnitchToNodeToValue = Maps.newHashMap();
-
-        // In order to match the returned values for the various snitches, we need to keep track of where each
-        // received value goes. Given the target maps are of different types (the maps from Node to whatever defined
-        // above) we instead pass a function taking two arguments, the node and the (non null) returned value,
-        // that will cast the value into the appropriate type for the snitch tag and insert it into the appropriate map
-        // with the node as the key.
-        Map<String, BiConsumer<Node, Object>> allSnitchTagsToInsertion = Maps.newHashMap();
-        if (requestedNodeCoreCount) {
-            allSnitchTagsToInsertion.put(ImplicitSnitch.CORES, (node, value) -> nodeToCoreCount.put(node, ((Number) value).intValue()));
-        }
-        if (requestedNodeDiskType) {
-            allSnitchTagsToInsertion.put(ImplicitSnitch.DISKTYPE, (node, value) -> {
-                if ("rotational".equals(value)) {
-                    nodeToDiskType.put(node, DiskHardwareType.ROTATIONAL);
-                } else if ("ssd".equals(value)) {
-                    nodeToDiskType.put(node, DiskHardwareType.SSD);
-                }
-                // unknown disk type: insert no value, returned optional will be empty
-            });
-        }
-        if (requestedNodeFreeDisk) {
-            allSnitchTagsToInsertion.put(SolrClientNodeStateProvider.Variable.FREEDISK.tagName,
-                    // Convert from bytes to GB
-                    (node, value) -> nodeToFreeDisk.put(node, ((Number) value).longValue() / 1024 / 1024 / 1024));
-        }
-        if (requestedNodeTotalDisk) {
-            allSnitchTagsToInsertion.put(SolrClientNodeStateProvider.Variable.TOTALDISK.tagName,
-                    // Convert from bytes to GB
-                    (node, value) -> nodeToTotalDisk.put(node, ((Number) value).longValue() / 1024 / 1024 / 1024));
-        }
-        if (requestedNodeHeapUsage) {
-            allSnitchTagsToInsertion.put(ImplicitSnitch.HEAPUSAGE,
-                    (node, value) -> nodeToHeapUsage.put(node, ((Number) value).doubleValue()));
-        }
-        if (requestedNodeSystemLoadAverage) {
-            allSnitchTagsToInsertion.put(ImplicitSnitch.SYSLOADAVG,
-                    (node, value) -> nodeToSystemLoadAverage.put(node, ((Number) value).doubleValue()));
-        }
-        for (String sysPropSnitch : requestedNodeSystemPropertiesSnitchTags) {
-            final Map<Node, String> sysPropMap = Maps.newHashMap();
-            syspropSnitchToNodeToValue.put(sysPropSnitch, sysPropMap);
-            allSnitchTagsToInsertion.put(sysPropSnitch, (node, value) -> sysPropMap.put(node, (String) value));
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  boolean requestedNodeCoreCount;
+  boolean requestedNodeDiskType;
+  boolean requestedNodeFreeDisk;
+  boolean requestedNodeTotalDisk;
+  boolean requestedNodeHeapUsage;
+  boolean requestedNodeSystemLoadAverage;
+  Set<String> requestedNodeSystemPropertiesSnitchTags = new HashSet<>();
+  Set<String> requestedNodeMetricSnitchTags = new HashSet<>();
+
+  Set<Node> nodes = Collections.emptySet();
+
+  private final SolrCloudManager cloudManager;
+
+  AttributeFetcherImpl(SolrCloudManager cloudManager) {
+    this.cloudManager = cloudManager;
+  }
+
+  @Override
+  public AttributeFetcher requestNodeCoreCount() {
+    requestedNodeCoreCount = true;
+    return this;
+  }
+
+  @Override
+  public AttributeFetcher requestNodeDiskType() {
+    requestedNodeDiskType = true;
+    return this;
+  }
+
+  @Override
+  public AttributeFetcher requestNodeFreeDisk() {
+    requestedNodeFreeDisk = true;
+    return this;
+  }
+
+  @Override
+  public AttributeFetcher requestNodeTotalDisk() {
+    requestedNodeTotalDisk = true;
+    return this;
+  }
+
+  @Override
+  public AttributeFetcher requestNodeHeapUsage() {
+    requestedNodeHeapUsage = true;
+    return this;
+  }
+
+  @Override
+  public AttributeFetcher requestNodeSystemLoadAverage() {
+    requestedNodeSystemLoadAverage = true;
+    return this;
+  }
+
+  @Override
+  public AttributeFetcher requestNodeSystemProperty(String name) {
+    requestedNodeSystemPropertiesSnitchTags.add(getSystemPropertySnitchTag(name));
+    return this;
+  }
+
+  @Override
+  public AttributeFetcher requestNodeEnvironmentVariable(String name) {
+    throw new UnsupportedOperationException("Not yet implemented...");
+  }
+
+  @Override
+  public AttributeFetcher requestNodeMetric(String metricName, NodeMetricRegistry registry) {
+    requestedNodeMetricSnitchTags.add(getMetricSnitchTag(metricName, registry));
+    return this;
+  }
+
+  @Override
+  public AttributeFetcher fetchFrom(Set<Node> nodes) {
+    this.nodes = nodes;
+    return this;
+  }
+
+  @Override
+  public AttributeFetcher requestMetric(String scope, String metricName) {
+    throw new UnsupportedOperationException("Not yet implemented...");
+  }
+
+  @Override
+  public AttributeValues fetchAttributes() {
+    // TODO Code here only supports node related attributes for now
+
+    // Maps in which attribute values will be added
+    Map<Node, Integer> nodeToCoreCount = Maps.newHashMap();
+    Map<Node, DiskHardwareType> nodeToDiskType = Maps.newHashMap();
+    Map<Node, Long> nodeToFreeDisk = Maps.newHashMap();
+    Map<Node, Long> nodeToTotalDisk = Maps.newHashMap();
+    Map<Node, Double> nodeToHeapUsage = Maps.newHashMap();
+    Map<Node, Double> nodeToSystemLoadAverage = Maps.newHashMap();
+    Map<String, Map<Node, String>> syspropSnitchToNodeToValue = Maps.newHashMap();
+    Map<String, Map<Node, Double>> metricSnitchToNodeToValue = Maps.newHashMap();
+
+    // In order to match the returned values for the various snitches, we need to keep track of where each
+    // received value goes. Given the target maps are of different types (the maps from Node to whatever defined
+    // above) we instead pass a function taking two arguments, the node and the (non null) returned value,
+    // that will cast the value into the appropriate type for the snitch tag and insert it into the appropriate map
+    // with the node as the key.
+    Map<String, BiConsumer<Node, Object>> allSnitchTagsToInsertion = Maps.newHashMap();
+    if (requestedNodeCoreCount) {
+      allSnitchTagsToInsertion.put(ImplicitSnitch.CORES, (node, value) -> nodeToCoreCount.put(node, ((Number) value).intValue()));
+    }
+    if (requestedNodeDiskType) {
+      allSnitchTagsToInsertion.put(ImplicitSnitch.DISKTYPE, (node, value) -> {
+        if ("rotational".equals(value)) {
+          nodeToDiskType.put(node, DiskHardwareType.ROTATIONAL);
+        } else if ("ssd".equals(value)) {
+          nodeToDiskType.put(node, DiskHardwareType.SSD);
         }
-        for (String metricSnitch : requestedNodeMetricSnitchTags) {
-            final Map<Node, Double> metricMap = Maps.newHashMap();
-            metricSnitchToNodeToValue.put(metricSnitch, metricMap);
-            allSnitchTagsToInsertion.put(metricSnitch, (node, value) -> metricMap.put(node, (Double) value));
+        // unknown disk type: insert no value, returned optional will be empty
+      });
+    }
+    if (requestedNodeFreeDisk) {
+      allSnitchTagsToInsertion.put(SolrClientNodeStateProvider.Variable.FREEDISK.tagName,
+          // Convert from bytes to GB
+          (node, value) -> nodeToFreeDisk.put(node, ((Number) value).longValue() / 1024 / 1024 / 1024));
+    }
+    if (requestedNodeTotalDisk) {
+      allSnitchTagsToInsertion.put(SolrClientNodeStateProvider.Variable.TOTALDISK.tagName,
+          // Convert from bytes to GB
+          (node, value) -> nodeToTotalDisk.put(node, ((Number) value).longValue() / 1024 / 1024 / 1024));
+    }
+    if (requestedNodeHeapUsage) {
+      allSnitchTagsToInsertion.put(ImplicitSnitch.HEAPUSAGE,
+          (node, value) -> nodeToHeapUsage.put(node, ((Number) value).doubleValue()));
+    }
+    if (requestedNodeSystemLoadAverage) {
+      allSnitchTagsToInsertion.put(ImplicitSnitch.SYSLOADAVG,
+          (node, value) -> nodeToSystemLoadAverage.put(node, ((Number) value).doubleValue()));
+    }
+    for (String sysPropSnitch : requestedNodeSystemPropertiesSnitchTags) {
+      final Map<Node, String> sysPropMap = Maps.newHashMap();
+      syspropSnitchToNodeToValue.put(sysPropSnitch, sysPropMap);
+      allSnitchTagsToInsertion.put(sysPropSnitch, (node, value) -> sysPropMap.put(node, (String) value));
+    }
+    for (String metricSnitch : requestedNodeMetricSnitchTags) {
+      final Map<Node, Double> metricMap = Maps.newHashMap();
+      metricSnitchToNodeToValue.put(metricSnitch, metricMap);
+      allSnitchTagsToInsertion.put(metricSnitch, (node, value) -> metricMap.put(node, (Double) value));
+    }
+
+    // Now that we know everything we need to fetch (and where to put it), just do it.
+    for (Node node : nodes) {
+      Map<String, Object> tagValues = cloudManager.getNodeStateProvider().getNodeValues(node.getName(), allSnitchTagsToInsertion.keySet());
+      for (Map.Entry<String, Object> e : tagValues.entrySet()) {
+        String tag = e.getKey();
+        Object value = e.getValue(); // returned value from the node
+
+        BiConsumer<Node, Object> inserter = allSnitchTagsToInsertion.get(tag);
+        // If inserter is null it's a return of a tag that we didn't request
+        if (inserter != null) {
+          inserter.accept(node, value);
+        } else {
+          log.error("Received unsolicited snitch tag {} from node {}", tag, node);
         }
-
-        // Now that we know everything we need to fetch (and where to put it), just do it.
-        for (Node node : nodes) {
-            Map<String, Object> tagValues = cloudManager.getNodeStateProvider().getNodeValues(node.getName(), allSnitchTagsToInsertion.keySet());
-            for (Map.Entry<String, Object> e : tagValues.entrySet()) {
-                String tag = e.getKey();
-                Object value = e.getValue(); // returned value from the node
-
-                BiConsumer<Node, Object> inserter = allSnitchTagsToInsertion.get(tag);
-                // If inserter is null it's a return of a tag that we didn't request
-                if (inserter != null) {
-                    inserter.accept(node, value);
-                } else {
-                    log.error("Received unsolicited snitch tag {} from node {}", tag, node);
-                }
-            }
-        }
-
-        return new AttributeValuesImpl(nodeToCoreCount,
-                                       nodeToDiskType,
-                                       nodeToFreeDisk,
-                                       nodeToTotalDisk,
-                                       nodeToHeapUsage,
-                                       nodeToSystemLoadAverage,
-                                       syspropSnitchToNodeToValue,
-                                       metricSnitchToNodeToValue);
-    }
-
-    private static SolrInfoBean.Group getGroupFromMetricRegistry(NodeMetricRegistry registry) {
-        switch (registry) {
-            case SOLR_JVM:
-                return SolrInfoBean.Group.jvm;
-            case SOLR_NODE:
-                return SolrInfoBean.Group.node;
-            default:
-                throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unsupported registry value " + registry);
-        }
-    }
-
-    public static String getMetricSnitchTag(String metricName, NodeMetricRegistry registry) {
-        return SolrClientNodeStateProvider.METRICS_PREFIX + SolrMetricManager.getRegistryName(getGroupFromMetricRegistry(registry), metricName);
-    }
-
-    public static String getSystemPropertySnitchTag(String name) {
-        return ImplicitSnitch.SYSPROP + name;
-    }
+      }
+    }
+
+    return new AttributeValuesImpl(nodeToCoreCount,
+        nodeToDiskType,
+        nodeToFreeDisk,
+        nodeToTotalDisk,
+        nodeToHeapUsage,
+        nodeToSystemLoadAverage,
+        syspropSnitchToNodeToValue,
+        metricSnitchToNodeToValue);
+  }
+
+  private static SolrInfoBean.Group getGroupFromMetricRegistry(NodeMetricRegistry registry) {
+    switch (registry) {
+      case SOLR_JVM:
+        return SolrInfoBean.Group.jvm;
+      case SOLR_NODE:
+        return SolrInfoBean.Group.node;
+      default:
+        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unsupported registry value " + registry);
+    }
+  }
+
+  public static String getMetricSnitchTag(String metricName, NodeMetricRegistry registry) {
+    return SolrClientNodeStateProvider.METRICS_PREFIX + SolrMetricManager.getRegistryName(getGroupFromMetricRegistry(registry), metricName);
+  }
+
+  public static String getSystemPropertySnitchTag(String name) {
+    return ImplicitSnitch.SYSPROP + name;
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/AttributeValuesImpl.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/AttributeValuesImpl.java
index 0f4c1ab..ce68094 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/AttributeValuesImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/AttributeValuesImpl.java
@@ -25,90 +25,90 @@ import java.util.Map;
 import java.util.Optional;
 
 public class AttributeValuesImpl implements AttributeValues {
-    final Map<Node, Integer> nodeToCoreCount;
-    final Map<Node, AttributeFetcher.DiskHardwareType> nodeToDiskType;
-    final Map<Node, Long> nodeToFreeDisk;
-    final Map<Node, Long> nodeToTotalDisk;
-    final Map<Node, Double> nodeToHeapUsage;
-    final Map<Node, Double> nodeToSystemLoadAverage;
-    final Map<String, Map<Node, String>> syspropSnitchToNodeToValue;
-    final Map<String, Map<Node, Double>> metricSnitchToNodeToValue;
+  final Map<Node, Integer> nodeToCoreCount;
+  final Map<Node, AttributeFetcher.DiskHardwareType> nodeToDiskType;
+  final Map<Node, Long> nodeToFreeDisk;
+  final Map<Node, Long> nodeToTotalDisk;
+  final Map<Node, Double> nodeToHeapUsage;
+  final Map<Node, Double> nodeToSystemLoadAverage;
+  final Map<String, Map<Node, String>> syspropSnitchToNodeToValue;
+  final Map<String, Map<Node, Double>> metricSnitchToNodeToValue;
 
-    public AttributeValuesImpl(Map<Node, Integer> nodeToCoreCount,
-                        Map<Node, AttributeFetcher.DiskHardwareType> nodeToDiskType,
-                        Map<Node, Long> nodeToFreeDisk,
-                        Map<Node, Long> nodeToTotalDisk,
-                        Map<Node, Double> nodeToHeapUsage,
-                        Map<Node, Double> nodeToSystemLoadAverage,
-                        Map<String, Map<Node, String>> syspropSnitchToNodeToValue,
-                        Map<String, Map<Node, Double>> metricSnitchToNodeToValue) {
-        this.nodeToCoreCount = nodeToCoreCount;
-        this.nodeToDiskType = nodeToDiskType;
-        this.nodeToFreeDisk = nodeToFreeDisk;
-        this.nodeToTotalDisk = nodeToTotalDisk;
-        this.nodeToHeapUsage = nodeToHeapUsage;
-        this.nodeToSystemLoadAverage = nodeToSystemLoadAverage;
-        this.syspropSnitchToNodeToValue = syspropSnitchToNodeToValue;
-        this.metricSnitchToNodeToValue = metricSnitchToNodeToValue;
-    }
+  public AttributeValuesImpl(Map<Node, Integer> nodeToCoreCount,
+                             Map<Node, AttributeFetcher.DiskHardwareType> nodeToDiskType,
+                             Map<Node, Long> nodeToFreeDisk,
+                             Map<Node, Long> nodeToTotalDisk,
+                             Map<Node, Double> nodeToHeapUsage,
+                             Map<Node, Double> nodeToSystemLoadAverage,
+                             Map<String, Map<Node, String>> syspropSnitchToNodeToValue,
+                             Map<String, Map<Node, Double>> metricSnitchToNodeToValue) {
+    this.nodeToCoreCount = nodeToCoreCount;
+    this.nodeToDiskType = nodeToDiskType;
+    this.nodeToFreeDisk = nodeToFreeDisk;
+    this.nodeToTotalDisk = nodeToTotalDisk;
+    this.nodeToHeapUsage = nodeToHeapUsage;
+    this.nodeToSystemLoadAverage = nodeToSystemLoadAverage;
+    this.syspropSnitchToNodeToValue = syspropSnitchToNodeToValue;
+    this.metricSnitchToNodeToValue = metricSnitchToNodeToValue;
+  }
 
-    @Override
-    public Optional<Integer> getCoresCount(Node node) {
-        return Optional.ofNullable(nodeToCoreCount.get(node));
-    }
+  @Override
+  public Optional<Integer> getCoresCount(Node node) {
+    return Optional.ofNullable(nodeToCoreCount.get(node));
+  }
 
-    @Override
-    public Optional<AttributeFetcher.DiskHardwareType> getDiskType(Node node) {
-        return Optional.ofNullable(nodeToDiskType.get(node));
-    }
+  @Override
+  public Optional<AttributeFetcher.DiskHardwareType> getDiskType(Node node) {
+    return Optional.ofNullable(nodeToDiskType.get(node));
+  }
 
-    @Override
-    public Optional<Long> getFreeDisk(Node node) {
-        return Optional.ofNullable(nodeToFreeDisk.get(node));
-    }
+  @Override
+  public Optional<Long> getFreeDisk(Node node) {
+    return Optional.ofNullable(nodeToFreeDisk.get(node));
+  }
 
-    @Override
-    public Optional<Long> getTotalDisk(Node node) {
-        return Optional.ofNullable(nodeToTotalDisk.get(node));
-    }
+  @Override
+  public Optional<Long> getTotalDisk(Node node) {
+    return Optional.ofNullable(nodeToTotalDisk.get(node));
+  }
 
-    @Override
-    public Optional<Double> getHeapUsage(Node node) {
-        return Optional.ofNullable(nodeToHeapUsage.get(node));
-    }
+  @Override
+  public Optional<Double> getHeapUsage(Node node) {
+    return Optional.ofNullable(nodeToHeapUsage.get(node));
+  }
 
-    @Override
-    public Optional<Double> getSystemLoadAverage(Node node) {
-        return Optional.ofNullable(nodeToSystemLoadAverage.get(node));
-    }
+  @Override
+  public Optional<Double> getSystemLoadAverage(Node node) {
+    return Optional.ofNullable(nodeToSystemLoadAverage.get(node));
+  }
 
-    @Override
-    public Optional<String> getSystemProperty(Node node, String name) {
-        Map<Node, String> nodeToValue = syspropSnitchToNodeToValue.get(AttributeFetcherImpl.getSystemPropertySnitchTag(name));
-        if (nodeToValue == null) {
-            return Optional.empty();
-        }
-        return Optional.ofNullable(nodeToValue.get(node));
+  @Override
+  public Optional<String> getSystemProperty(Node node, String name) {
+    Map<Node, String> nodeToValue = syspropSnitchToNodeToValue.get(AttributeFetcherImpl.getSystemPropertySnitchTag(name));
+    if (nodeToValue == null) {
+      return Optional.empty();
     }
+    return Optional.ofNullable(nodeToValue.get(node));
+  }
 
-    @Override
-    public Optional<String> getEnvironmentVariable(Node node, String name) {
-        // TODO implement
-        return Optional.empty();
-    }
+  @Override
+  public Optional<String> getEnvironmentVariable(Node node, String name) {
+    // TODO implement
+    return Optional.empty();
+  }
 
-    @Override
-    public Optional<Double> getMetric(Node node, String metricName, AttributeFetcher.NodeMetricRegistry registry) {
-        Map<Node, Double> nodeToValue = metricSnitchToNodeToValue.get(AttributeFetcherImpl.getMetricSnitchTag(metricName, registry));
-        if (nodeToValue == null) {
-            return Optional.empty();
-        }
-        return Optional.ofNullable(nodeToValue.get(node));
+  @Override
+  public Optional<Double> getMetric(Node node, String metricName, AttributeFetcher.NodeMetricRegistry registry) {
+    Map<Node, Double> nodeToValue = metricSnitchToNodeToValue.get(AttributeFetcherImpl.getMetricSnitchTag(metricName, registry));
+    if (nodeToValue == null) {
+      return Optional.empty();
     }
+    return Optional.ofNullable(nodeToValue.get(node));
+  }
 
-    @Override
-    public Optional<Double> getMetric(String scope, String metricName) {
-        // TODO implement
-        return Optional.empty();
-    }
+  @Override
+  public Optional<Double> getMetric(String scope, String metricName) {
+    // TODO implement
+    return Optional.empty();
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPlanFactoryImpl.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPlanFactoryImpl.java
index 56071da..7f7f89f 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPlanFactoryImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPlanFactoryImpl.java
@@ -25,13 +25,13 @@ import org.apache.solr.cluster.placement.*;
 import java.util.Set;
 
 public class PlacementPlanFactoryImpl implements PlacementPlanFactory {
-    @Override
-    public PlacementPlan createPlacementPlan(PlacementRequest request, Set<ReplicaPlacement> replicaPlacements) {
-        return new PlacementPlanImpl(request, replicaPlacements);
-    }
+  @Override
+  public PlacementPlan createPlacementPlan(PlacementRequest request, Set<ReplicaPlacement> replicaPlacements) {
+    return new PlacementPlanImpl(request, replicaPlacements);
+  }
 
-    @Override
-    public ReplicaPlacement createReplicaPlacement(SolrCollection solrCollection, String shardName, Node node, Replica.ReplicaType replicaType) {
-        return new ReplicaPlacementImpl(solrCollection, shardName, node, replicaType);
-    }
+  @Override
+  public ReplicaPlacement createReplicaPlacement(SolrCollection solrCollection, String shardName, Node node, Replica.ReplicaType replicaType) {
+    return new ReplicaPlacementImpl(solrCollection, shardName, node, replicaType);
+  }
 }
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPluginConfigImpl.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPluginConfigImpl.java
index 98d02b7..30cb6ef 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPluginConfigImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPluginConfigImpl.java
@@ -85,7 +85,7 @@ public class PlacementPluginConfigImpl implements PlacementPluginConfig {
 
   @Override
   public Long getLongConfig(String configName, long defaultValue) {
-    Long  retval = longConfigs.get(configName);
+    Long retval = longConfigs.get(configName);
     return retval != null ? retval : defaultValue;
   }
 
@@ -181,13 +181,13 @@ public class PlacementPluginConfigImpl implements PlacementPluginConfig {
     PlacementPluginFactory placementPluginFactory;
     try {
       Class<? extends PlacementPluginFactory> factoryClazz =
-              Class.forName(pluginFactoryClassName, true, PlacementPluginConfigImpl.class.getClassLoader())
-                      .asSubclass(PlacementPluginFactory.class);
+          Class.forName(pluginFactoryClassName, true, PlacementPluginConfigImpl.class.getClassLoader())
+              .asSubclass(PlacementPluginFactory.class);
 
       placementPluginFactory = factoryClazz.getConstructor().newInstance(); // no args constructor - that's why we introduced a factory...
     } catch (Exception e) {
-      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,  "Unable to instantiate placement-plugin factory: " +
-              Utils.toJSONString(pluginConfigMap) + " please review /clusterprops.json config for " + PlacementPluginConfig.PLACEMENT_PLUGIN_CONFIG_KEY, e);
+      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unable to instantiate placement-plugin factory: " +
+          Utils.toJSONString(pluginConfigMap) + " please review /clusterprops.json config for " + PlacementPluginConfig.PLACEMENT_PLUGIN_CONFIG_KEY, e);
     }
 
     // Translate the config from the properties where they are defined into the abstraction seen by the plugin
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementRequestImpl.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementRequestImpl.java
index 555b103..ff3f090 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementRequestImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementRequestImpl.java
@@ -35,8 +35,8 @@ public class PlacementRequestImpl implements PlacementRequest {
   private final EnumMap<Replica.ReplicaType, Integer> countReplicas = new EnumMap<>(Replica.ReplicaType.class);
 
   public PlacementRequestImpl(SolrCollection solrCollection,
-                               Set<String> shardNames, Set<Node> targetNodes,
-                               int countNrtReplicas, int countTlogReplicas, int countPullReplicas) {
+                              Set<String> shardNames, Set<Node> targetNodes,
+                              int countNrtReplicas, int countTlogReplicas, int countPullReplicas) {
     this.solrCollection = solrCollection;
     this.shardNames = shardNames;
     this.targetNodes = targetNodes;
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimpleClusterAbstractionsImpl.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimpleClusterAbstractionsImpl.java
index 47b8f6c..e26a374 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimpleClusterAbstractionsImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimpleClusterAbstractionsImpl.java
@@ -112,9 +112,15 @@ class SimpleClusterAbstractionsImpl {
      * with names equal to existing instances (See {@link ReplicaImpl} constructor).
      */
     public boolean equals(Object obj) {
-      if (obj == null) { return false; }
-      if (obj == this) { return true; }
-      if (obj.getClass() != getClass()) { return false; }
+      if (obj == null) {
+        return false;
+      }
+      if (obj == this) {
+        return true;
+      }
+      if (obj.getClass() != getClass()) {
+        return false;
+      }
       NodeImpl other = (NodeImpl) obj;
       return Objects.equals(this.nodeName, other.nodeName);
     }
@@ -127,7 +133,9 @@ class SimpleClusterAbstractionsImpl {
 
   static class SolrCollectionImpl implements SolrCollection {
     private final String collectionName;
-    /** Map from {@link Shard#getShardName()} to {@link Shard} */
+    /**
+     * Map from {@link Shard#getShardName()} to {@link Shard}
+     */
     private final Map<String, Shard> shards;
     private final DocCollection docCollection;
 
@@ -212,12 +220,18 @@ class SimpleClusterAbstractionsImpl {
 
     private ShardState translateState(Slice.State state) {
       switch (state) {
-        case ACTIVE: return ShardState.ACTIVE;
-        case INACTIVE: return ShardState.INACTIVE;
-        case CONSTRUCTION: return ShardState.CONSTRUCTION;
-        case RECOVERY: return ShardState.RECOVERY;
-        case RECOVERY_FAILED: return ShardState.RECOVERY_FAILED;
-        default: throw new RuntimeException("Unexpected " + state);
+        case ACTIVE:
+          return ShardState.ACTIVE;
+        case INACTIVE:
+          return ShardState.INACTIVE;
+        case CONSTRUCTION:
+          return ShardState.CONSTRUCTION;
+        case RECOVERY:
+          return ShardState.RECOVERY;
+        case RECOVERY_FAILED:
+          return ShardState.RECOVERY_FAILED;
+        default:
+          throw new RuntimeException("Unexpected " + state);
       }
     }
 
@@ -258,15 +272,21 @@ class SimpleClusterAbstractionsImpl {
     }
 
     public boolean equals(Object obj) {
-      if (obj == null) { return false; }
-      if (obj == this) { return true; }
-      if (obj.getClass() != getClass()) { return false; }
+      if (obj == null) {
+        return false;
+      }
+      if (obj == this) {
+        return true;
+      }
+      if (obj.getClass() != getClass()) {
+        return false;
+      }
       ShardImpl other = (ShardImpl) obj;
       return Objects.equals(this.shardName, other.shardName)
-              && Objects.equals(this.collection, other.collection)
-              && Objects.equals(this.shardState, other.shardState)
-              && Objects.equals(this.replicas, other.replicas)
-              && Objects.equals(this.leader, other.leader);
+          && Objects.equals(this.collection, other.collection)
+          && Objects.equals(this.shardState, other.shardState)
+          && Objects.equals(this.replicas, other.replicas)
+          && Objects.equals(this.leader, other.leader);
     }
 
     public int hashCode() {
@@ -316,20 +336,29 @@ class SimpleClusterAbstractionsImpl {
 
     private Replica.ReplicaType translateType(org.apache.solr.common.cloud.Replica.Type type) {
       switch (type) {
-        case NRT: return Replica.ReplicaType.NRT;
-        case TLOG: return Replica.ReplicaType.TLOG;
-        case PULL: return Replica.ReplicaType.PULL;
-        default: throw new RuntimeException("Unexpected " + type);
+        case NRT:
+          return Replica.ReplicaType.NRT;
+        case TLOG:
+          return Replica.ReplicaType.TLOG;
+        case PULL:
+          return Replica.ReplicaType.PULL;
+        default:
+          throw new RuntimeException("Unexpected " + type);
       }
     }
 
     private Replica.ReplicaState translateState(org.apache.solr.common.cloud.Replica.State state) {
       switch (state) {
-        case ACTIVE: return Replica.ReplicaState.ACTIVE;
-        case DOWN: return Replica.ReplicaState.DOWN;
-        case RECOVERING: return Replica.ReplicaState.RECOVERING;
-        case RECOVERY_FAILED: return Replica.ReplicaState.RECOVERY_FAILED;
-        default: throw new RuntimeException("Unexpected " + state);
+        case ACTIVE:
+          return Replica.ReplicaState.ACTIVE;
+        case DOWN:
+          return Replica.ReplicaState.DOWN;
+        case RECOVERING:
+          return Replica.ReplicaState.RECOVERING;
+        case RECOVERY_FAILED:
+          return Replica.ReplicaState.RECOVERY_FAILED;
+        default:
+          throw new RuntimeException("Unexpected " + state);
       }
     }
 
@@ -370,24 +399,34 @@ class SimpleClusterAbstractionsImpl {
      */
     static org.apache.solr.common.cloud.Replica.Type toCloudReplicaType(ReplicaType type) {
       switch (type) {
-        case NRT: return org.apache.solr.common.cloud.Replica.Type.NRT;
-        case TLOG: return org.apache.solr.common.cloud.Replica.Type.TLOG;
-        case PULL: return org.apache.solr.common.cloud.Replica.Type.PULL;
-        default: throw new IllegalArgumentException("Unknown " + type);
+        case NRT:
+          return org.apache.solr.common.cloud.Replica.Type.NRT;
+        case TLOG:
+          return org.apache.solr.common.cloud.Replica.Type.TLOG;
+        case PULL:
+          return org.apache.solr.common.cloud.Replica.Type.PULL;
+        default:
+          throw new IllegalArgumentException("Unknown " + type);
       }
     }
 
     public boolean equals(Object obj) {
-      if (obj == null) { return false; }
-      if (obj == this) { return true; }
-      if (obj.getClass() != getClass()) { return false; }
+      if (obj == null) {
+        return false;
+      }
+      if (obj == this) {
+        return true;
+      }
+      if (obj.getClass() != getClass()) {
+        return false;
+      }
       ReplicaImpl other = (ReplicaImpl) obj;
       return Objects.equals(this.replicaName, other.replicaName)
-              && Objects.equals(this.coreName, other.coreName)
-              && Objects.equals(this.shard, other.shard)
-              && Objects.equals(this.replicaType, other.replicaType)
-              && Objects.equals(this.replicaState, other.replicaState)
-              && Objects.equals(this.node, other.node);
+          && Objects.equals(this.coreName, other.coreName)
+          && Objects.equals(this.shard, other.shard)
+          && Objects.equals(this.replicaType, other.replicaType)
+          && Objects.equals(this.replicaState, other.replicaState)
+          && Objects.equals(this.node, other.node);
     }
 
     public int hashCode() {
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
index 0dd7340..379e06c 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
@@ -41,13 +41,13 @@ import java.util.stream.Collectors;
  *
  * <pre>
  *
-  curl -X POST -H 'Content-type:application/json' -d '{
-    "set-placement-plugin": {
-      "class": "org.apache.solr.cluster.placement.plugins.AffinityPlacementFactory",
-      "minimalFreeDiskGB": 10,
-      "prioritizedFreeDiskGB": 50
-    }
-  }' http://localhost:8983/api/cluster
+ * curl -X POST -H 'Content-type:application/json' -d '{
+ * "set-placement-plugin": {
+ * "class": "org.apache.solr.cluster.placement.plugins.AffinityPlacementFactory",
+ * "minimalFreeDiskGB": 10,
+ * "prioritizedFreeDiskGB": 50
+ * }
+ * }' http://localhost:8983/api/cluster
  * </pre>
  *
  * <p>The consequence will be the creation of an element in the Zookeeper file {@code /clusterprops.json} as follows:</p>
@@ -65,9 +65,9 @@ import java.util.stream.Collectors;
  *
  * <pre>
  *
-  curl -X POST -H 'Content-type:application/json' -d '{
-    "set-placement-plugin" : null
-  }' http://localhost:8983/api/cluster
+ * curl -X POST -H 'Content-type:application/json' -d '{
+ * "set-placement-plugin" : null
+ * }' http://localhost:8983/api/cluster
  * </pre>
  *
  *
@@ -136,7 +136,9 @@ public class AffinityPlacementFactory implements PlacementPluginFactory {
    */
   public static final String REPLICA_TYPE_SYSPROP = "replica_type";
 
-  /** This is the "AZ" name for nodes that do not define an AZ. Should not match a real AZ name (I think we're safe) */
+  /**
+   * This is the "AZ" name for nodes that do not define an AZ. Should not match a real AZ name (I think we're safe)
+   */
   public static final String UNDEFINED_AVAILABILITY_ZONE = "uNd3f1NeD";
 
   /**
@@ -231,7 +233,7 @@ public class AffinityPlacementFactory implements PlacementPluginFactory {
         // failure. Current code does fail if placement is impossible (constraint is at most one replica of a shard on any node).
         for (Replica.ReplicaType replicaType : Replica.ReplicaType.values()) {
           makePlacementDecisions(solrCollection, shardName, availabilityZones, replicaType, request.getCountReplicasToCreate(replicaType),
-                  attrValues, replicaTypeToNodes, coresOnNodes, placementPlanFactory, replicaPlacements);
+              attrValues, replicaTypeToNodes, coresOnNodes, placementPlanFactory, replicaPlacements);
         }
       }
 
@@ -287,7 +289,8 @@ public class AffinityPlacementFactory implements PlacementPluginFactory {
      * Also builds the number of existing cores on each node present in the returned EnumMap (2nd member of the returned Pair).
      * Nodes for which the number of cores is not available for whatever reason are excluded from acceptable candidate nodes
      * as it would not be possible to make any meaningful placement decisions.
-     * @param nodes all nodes on which this plugin should compute placement
+     *
+     * @param nodes      all nodes on which this plugin should compute placement
      * @param attrValues attributes fetched for the nodes. This method uses system property {@link #REPLICA_TYPE_SYSPROP} as
      *                   well as the number of cores on each node.
      */
@@ -307,7 +310,8 @@ public class AffinityPlacementFactory implements PlacementPluginFactory {
           }
           // We rely later on the fact that the free disk optional is present (see CoresAndDiskComparator), be careful it you change anything here.
           continue;
-        } if (attrValues.getFreeDisk(node).get() < minimalFreeDiskGB) {
+        }
+        if (attrValues.getFreeDisk(node).get() < minimalFreeDiskGB) {
           if (log.isWarnEnabled()) {
             log.warn("Node {} free disk ({}GB) lower than configured minimum {}GB, excluding it from placement decisions.", node.getName(), attrValues.getFreeDisk(node).get(), minimalFreeDiskGB);
           }
@@ -449,7 +453,7 @@ public class AffinityPlacementFactory implements PlacementPluginFactory {
           // This can happen because not enough nodes for the placement request or already too many nodes with replicas of
           // the shard that can't accept new replicas or not enough nodes with enough free disk space.
           throw new PlacementException("Not enough nodes to place " + numReplicas + " replica(s) of type " + replicaType +
-                  " for shard " + shardName + " of collection " + solrCollection.getName());
+              " for shard " + shardName + " of collection " + solrCollection.getName());
         }
 
         AzWithNodes azWithNodes = azWithNodesEntry.getValue();