bsglz commented on a change in pull request #1482:
URL: https://github.com/apache/hbase/pull/1482#discussion_r416351467
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/HDFSBlocksDistribution.java
##########
@@ -199,10 +225,23 @@ public long getUniqueBlocksTotalWeight() {
* @return the locality index of the given host
*/
public float getBlockLocalityIndex(String host) {
+ return getBlockLocalityIndex(host, false);
+ }
+ /**
+ * return the locality index of a given host
+ * @param host the host name
+ * @param forSsd only calc ssd type
+ * @return the locality index of the given host
+ */
+ public float getBlockLocalityIndex(String host, boolean forSsd) {
float localityIndex = 0;
HostAndWeight hostAndWeight = this.hostAndWeights.get(host);
if (hostAndWeight != null && uniqueBlocksTotalWeight != 0) {
- localityIndex=(float)hostAndWeight.weight/(float)uniqueBlocksTotalWeight;
+ if (forSsd){
+
localityIndex=(float)hostAndWeight.weightForSsd/(float)uniqueBlocksTotalWeight;
+ }else {
Review comment:
will fix.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]