Skip to content

Commit

Permalink
HBASE-6432 HRegionServer doesn't properly set clusterId in conf
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.94@1381907 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
saintstack committed Sep 7, 2012
1 parent 7500995 commit 8ae631e
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
import org.apache.hadoop.hbase.util.Strings;
import org.apache.hadoop.hbase.util.Threads;
import org.apache.hadoop.hbase.util.VersionInfo;
import org.apache.hadoop.hbase.zookeeper.ClusterId;
import org.apache.hadoop.hbase.zookeeper.ClusterStatusTracker;
import org.apache.hadoop.hbase.zookeeper.ZKUtil;
import org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker;
Expand Down Expand Up @@ -353,6 +354,11 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
*/
private ObjectName mxBean = null;

/**
* ClusterId
*/
private ClusterId clusterId = null;

/**
* Starts a HRegionServer at the default location
*
Expand Down Expand Up @@ -552,6 +558,12 @@ public Integer apply(Writable from) {
private void preRegistrationInitialization(){
try {
initializeZooKeeper();

clusterId = new ClusterId(zooKeeper, this);
if(clusterId.hasId()) {
conf.set(HConstants.CLUSTER_ID, clusterId.getId());
}

initializeThreads();
int nbBlocks = conf.getInt("hbase.regionserver.nbreservationblocks", 4);
for (int i = 0; i < nbBlocks; i++) {
Expand Down

0 comments on commit 8ae631e

Please sign in to comment.