Index: hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java (revision c080a136843b35828b7a88d0b4bfe3fda9b2abab) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java (revision ) @@ -75,7 +75,6 @@ private final Class masterClass; private final Class regionServerClass; - ConsensusProvider consensusProvider; /** * Constructor. * @param conf @@ -142,7 +141,6 @@ final Class regionServerClass) throws IOException { this.conf = conf; - consensusProvider = ConsensusProviderFactory.getConsensusProvider(conf); // Always have masters and regionservers come up on port '0' so we don't // clash over default ports. @@ -177,8 +175,14 @@ // Create each regionserver with its own Configuration instance so each has // its HConnection instance rather than share (see HBASE_INSTANCES down in // the guts of HConnectionManager. + + // Also, create separate ConsensusProvider instance per Server. + // This is special case when we have to have more than 1 ConsensusProvider + // within 1 process. + ConsensusProvider cp = ConsensusProviderFactory.getConsensusProvider(conf); + JVMClusterUtil.RegionServerThread rst = - JVMClusterUtil.createRegionServerThread(config, consensusProvider, + JVMClusterUtil.createRegionServerThread(config, cp, this.regionServerClass, index); this.regionThreads.add(rst); return rst; @@ -204,7 +208,13 @@ // Create each master with its own Configuration instance so each has // its HConnection instance rather than share (see HBASE_INSTANCES down in // the guts of HConnectionManager. - JVMClusterUtil.MasterThread mt = JVMClusterUtil.createMasterThread(c, consensusProvider, + + // Also, create separate ConsensusProvider instance per Server. + // This is special case when we have to have more than 1 ConsensusProvider + // within 1 process. + ConsensusProvider cp = ConsensusProviderFactory.getConsensusProvider(conf); + + JVMClusterUtil.MasterThread mt = JVMClusterUtil.createMasterThread(c, cp, (Class) conf.getClass(HConstants.MASTER_IMPL, this.masterClass), index); this.masterThreads.add(mt); return mt;