HBASE-16377 ServerName check is ineffective in region_mover.rb

This commit is contained in:
tedyu 2016-08-09 18:21:18 -07:00
parent 441bc050b9
commit cebba7b4d8
1 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ def getServerNameForRegion(admin, r)
sleep 0.1
end
# Make a fake servername by appending ','
metaServer = mtl.getMetaRegionLocation(zkw).toString() + ","
metaServer = (mtl.getMetaRegionLocation(zkw).toString() + ",").to_s
return metaServer
ensure
zkw.close()
@ -385,7 +385,7 @@ def loadRegions(options, hostname, port)
end
next unless exists
currentServer = getServerNameForRegion(admin, r)
if currentServer and currentServer == servername
if currentServer and servername and currentServer == servername.to_s
$LOG.info("Region " + r.getRegionNameAsString() + " (" + counter.to_s +
" of " + regions.length.to_s + ") already on target server=" + servername)
counter = counter + 1