Java 类org.apache.hadoop.hbase.replication.ReplicationSourceDummy 实例源码

项目:hbase    文件:TestReplicationSourceManager.java   
private static void waitPeer(final String peerId,
    ReplicationSourceManager manager, final boolean waitForSource) {
  ReplicationPeers rp = manager.getReplicationPeers();
  Waiter.waitFor(conf, 20000, () -> {
    if (waitForSource) {
      ReplicationSourceInterface rs = manager.getSource(peerId);
      if (rs == null) {
        return false;
      }
      if (rs instanceof ReplicationSourceDummy) {
        return ((ReplicationSourceDummy)rs).isStartup();
      }
      return true;
    } else {
      return (rp.getPeer(peerId) != null);
    }
  });
}
项目:hbase    文件:TestReplicationSourceManagerZkImpl.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
    ReplicationSourceDummy.class.getCanonicalName());
  conf.setLong("replication.sleep.before.failover", 2000);
  conf.setInt("replication.source.maxretriesmultiplier", 10);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();
  setupZkAndReplication();
}
项目:LCIndex-HBase-0.94.16    文件:TestReplicationSourceManager.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {

  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
      ReplicationSourceDummy.class.getCanonicalName());
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY, true);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();

  zkw = new ZooKeeperWatcher(conf, "test", null);
  ZKUtil.createWithParents(zkw, "/hbase/replication");
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1",
      Bytes.toBytes(conf.get(HConstants.ZOOKEEPER_QUORUM) + ":"
          + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":/1"));
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1/peer-state");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1/peer-state",
      Bytes.toBytes(ReplicationZookeeper.PeerState.ENABLED.name()));
  ZKUtil.createWithParents(zkw, "/hbase/replication/state");
  ZKUtil.setData(zkw, "/hbase/replication/state", Bytes.toBytes("true"));

  replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
  manager = replication.getReplicationManager();
  fs = FileSystem.get(conf);
  oldLogDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_OLDLOGDIR_NAME);
  logDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_LOGDIR_NAME);

  manager.addSource(slaveId);

  htd = new HTableDescriptor(test);
  HColumnDescriptor col = new HColumnDescriptor("f1");
  col.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  htd.addFamily(col);
  col = new HColumnDescriptor("f2");
  col.setScope(HConstants.REPLICATION_SCOPE_LOCAL);
  htd.addFamily(col);

  hri = new HRegionInfo(htd.getName(), r1, r2);


}
项目:pbase    文件:TestReplicationSourceManager.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {

  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
      ReplicationSourceDummy.class.getCanonicalName());
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY,
      HConstants.REPLICATION_ENABLE_DEFAULT);
  conf.setLong("replication.sleep.before.failover", 2000);
  conf.setInt("replication.source.maxretriesmultiplier", 10);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();

  zkw = new ZooKeeperWatcher(conf, "test", null);
  ZKUtil.createWithParents(zkw, "/hbase/replication");
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1",
      Bytes.toBytes(conf.get(HConstants.ZOOKEEPER_QUORUM) + ":"
          + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":/1"));
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1/peer-state");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1/peer-state",
    ReplicationStateZKBase.ENABLED_ZNODE_BYTES);
  ZKUtil.createWithParents(zkw, "/hbase/replication/state");
  ZKUtil.setData(zkw, "/hbase/replication/state", ReplicationStateZKBase.ENABLED_ZNODE_BYTES);

  ZKClusterId.setClusterId(zkw, new ClusterId());
  FSUtils.setRootDir(utility.getConfiguration(), utility.getDataTestDir());
  fs = FileSystem.get(conf);
  oldLogDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_OLDLOGDIR_NAME);
  logDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_LOGDIR_NAME);
  replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
  manager = replication.getReplicationManager();

  manager.addSource(slaveId);

  htd = new HTableDescriptor(test);
  HColumnDescriptor col = new HColumnDescriptor("f1");
  col.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  htd.addFamily(col);
  col = new HColumnDescriptor("f2");
  col.setScope(HConstants.REPLICATION_SCOPE_LOCAL);
  htd.addFamily(col);

  hri = new HRegionInfo(htd.getTableName(), r1, r2);
}
项目:HIndex    文件:TestReplicationSourceManager.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {

  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
      ReplicationSourceDummy.class.getCanonicalName());
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY,
      HConstants.REPLICATION_ENABLE_DEFAULT);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();

  zkw = new ZooKeeperWatcher(conf, "test", null);
  ZKUtil.createWithParents(zkw, "/hbase/replication");
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1",
      Bytes.toBytes(conf.get(HConstants.ZOOKEEPER_QUORUM) + ":"
          + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":/1"));
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1/peer-state");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1/peer-state",
    ReplicationStateZKBase.ENABLED_ZNODE_BYTES);
  ZKUtil.createWithParents(zkw, "/hbase/replication/state");
  ZKUtil.setData(zkw, "/hbase/replication/state", ReplicationStateZKBase.ENABLED_ZNODE_BYTES);

  ZKClusterId.setClusterId(zkw, new ClusterId());

  replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
  manager = replication.getReplicationManager();
  fs = FileSystem.get(conf);
  oldLogDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_OLDLOGDIR_NAME);
  logDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_LOGDIR_NAME);
  logName = HConstants.HREGION_LOGDIR_NAME;

  manager.addSource(slaveId);

  htd = new HTableDescriptor(test);
  HColumnDescriptor col = new HColumnDescriptor("f1");
  col.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  htd.addFamily(col);
  col = new HColumnDescriptor("f2");
  col.setScope(HConstants.REPLICATION_SCOPE_LOCAL);
  htd.addFamily(col);

  hri = new HRegionInfo(htd.getTableName(), r1, r2);
}
项目:IRIndex    文件:TestReplicationSourceManager.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {

  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
      ReplicationSourceDummy.class.getCanonicalName());
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY, true);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();

  zkw = new ZooKeeperWatcher(conf, "test", null);
  ZKUtil.createWithParents(zkw, "/hbase/replication");
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1",
      Bytes.toBytes(conf.get(HConstants.ZOOKEEPER_QUORUM) + ":"
          + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":/1"));
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1/peer-state");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1/peer-state",
      Bytes.toBytes(ReplicationZookeeper.PeerState.ENABLED.name()));
  ZKUtil.createWithParents(zkw, "/hbase/replication/state");
  ZKUtil.setData(zkw, "/hbase/replication/state", Bytes.toBytes("true"));

  replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
  manager = replication.getReplicationManager();
  fs = FileSystem.get(conf);
  oldLogDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_OLDLOGDIR_NAME);
  logDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_LOGDIR_NAME);

  manager.addSource(slaveId);

  htd = new HTableDescriptor(test);
  HColumnDescriptor col = new HColumnDescriptor("f1");
  col.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  htd.addFamily(col);
  col = new HColumnDescriptor("f2");
  col.setScope(HConstants.REPLICATION_SCOPE_LOCAL);
  htd.addFamily(col);

  hri = new HRegionInfo(htd.getName(), r1, r2);


}
项目:PyroDB    文件:TestReplicationSourceManager.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {

  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
      ReplicationSourceDummy.class.getCanonicalName());
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY,
      HConstants.REPLICATION_ENABLE_DEFAULT);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();

  zkw = new ZooKeeperWatcher(conf, "test", null);
  ZKUtil.createWithParents(zkw, "/hbase/replication");
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1",
      Bytes.toBytes(conf.get(HConstants.ZOOKEEPER_QUORUM) + ":"
          + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":/1"));
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1/peer-state");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1/peer-state",
    ReplicationStateZKBase.ENABLED_ZNODE_BYTES);
  ZKUtil.createWithParents(zkw, "/hbase/replication/state");
  ZKUtil.setData(zkw, "/hbase/replication/state", ReplicationStateZKBase.ENABLED_ZNODE_BYTES);

  ZKClusterId.setClusterId(zkw, new ClusterId());

  replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
  manager = replication.getReplicationManager();
  fs = FileSystem.get(conf);
  oldLogDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_OLDLOGDIR_NAME);
  logDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_LOGDIR_NAME);
  logName = HConstants.HREGION_LOGDIR_NAME;

  manager.addSource(slaveId);

  htd = new HTableDescriptor(test);
  HColumnDescriptor col = new HColumnDescriptor("f1");
  col.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  htd.addFamily(col);
  col = new HColumnDescriptor("f2");
  col.setScope(HConstants.REPLICATION_SCOPE_LOCAL);
  htd.addFamily(col);

  hri = new HRegionInfo(htd.getTableName(), r1, r2);
}
项目:c5    文件:TestReplicationSourceManager.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {

  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
      ReplicationSourceDummy.class.getCanonicalName());
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY,
      HConstants.REPLICATION_ENABLE_DEFAULT);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();

  zkw = new ZooKeeperWatcher(conf, "test", null);
  ZKUtil.createWithParents(zkw, "/hbase/replication");
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1",
      Bytes.toBytes(conf.get(HConstants.ZOOKEEPER_QUORUM) + ":"
          + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":/1"));
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1/peer-state");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1/peer-state",
    ReplicationStateZKBase.ENABLED_ZNODE_BYTES);
  ZKUtil.createWithParents(zkw, "/hbase/replication/state");
  ZKUtil.setData(zkw, "/hbase/replication/state", ReplicationStateZKBase.ENABLED_ZNODE_BYTES);

  ZKClusterId.setClusterId(zkw, new ClusterId());

  replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
  manager = replication.getReplicationManager();
  fs = FileSystem.get(conf);
  oldLogDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_OLDLOGDIR_NAME);
  logDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_LOGDIR_NAME);
  logName = HConstants.HREGION_LOGDIR_NAME;

  manager.addSource(slaveId);

  htd = new HTableDescriptor(test);
  HColumnDescriptor col = new HColumnDescriptor("f1");
  col.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  htd.addFamily(col);
  col = new HColumnDescriptor("f2");
  col.setScope(HConstants.REPLICATION_SCOPE_LOCAL);
  htd.addFamily(col);

  hri = new HRegionInfo(htd.getTableName(), r1, r2);
}
项目:HBase-Research    文件:TestReplicationSourceManager.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {

  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
      ReplicationSourceDummy.class.getCanonicalName());
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY, true);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();

  zkw = new ZooKeeperWatcher(conf, "test", null);
  ZKUtil.createWithParents(zkw, "/hbase/replication");
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1",
      Bytes.toBytes(conf.get(HConstants.ZOOKEEPER_QUORUM) + ":"
          + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":/1"));
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1/peer-state");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1/peer-state",
      Bytes.toBytes(ReplicationZookeeper.PeerState.ENABLED.name()));
  ZKUtil.createWithParents(zkw, "/hbase/replication/state");
  ZKUtil.setData(zkw, "/hbase/replication/state", Bytes.toBytes("true"));

  replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
  manager = replication.getReplicationManager();
  fs = FileSystem.get(conf);
  oldLogDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_OLDLOGDIR_NAME);
  logDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_LOGDIR_NAME);

  manager.addSource(slaveId);

  htd = new HTableDescriptor(test);
  HColumnDescriptor col = new HColumnDescriptor("f1");
  col.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  htd.addFamily(col);
  col = new HColumnDescriptor("f2");
  col.setScope(HConstants.REPLICATION_SCOPE_LOCAL);
  htd.addFamily(col);

  hri = new HRegionInfo(htd.getName(), r1, r2);


}
项目:hbase-0.94.8-qod    文件:TestReplicationSourceManager.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {

  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
      ReplicationSourceDummy.class.getCanonicalName());
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY, true);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();

  zkw = new ZooKeeperWatcher(conf, "test", null);
  ZKUtil.createWithParents(zkw, "/hbase/replication");
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1",
      Bytes.toBytes(conf.get(HConstants.ZOOKEEPER_QUORUM) + ":"
          + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":/1"));
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1/peer-state");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1/peer-state",
      Bytes.toBytes(ReplicationZookeeper.PeerState.ENABLED.name()));
  ZKUtil.createWithParents(zkw, "/hbase/replication/state");
  ZKUtil.setData(zkw, "/hbase/replication/state", Bytes.toBytes("true"));

  replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
  manager = replication.getReplicationManager();
  fs = FileSystem.get(conf);
  oldLogDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_OLDLOGDIR_NAME);
  logDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_LOGDIR_NAME);

  manager.addSource(slaveId);

  htd = new HTableDescriptor(test);
  HColumnDescriptor col = new HColumnDescriptor("f1");
  col.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  htd.addFamily(col);
  col = new HColumnDescriptor("f2");
  col.setScope(HConstants.REPLICATION_SCOPE_LOCAL);
  htd.addFamily(col);

  hri = new HRegionInfo(htd.getName(), r1, r2);


}
项目:hbase-0.94.8-qod    文件:TestReplicationSourceManager.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {

  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
      ReplicationSourceDummy.class.getCanonicalName());
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY, true);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();

  zkw = new ZooKeeperWatcher(conf, "test", null);
  ZKUtil.createWithParents(zkw, "/hbase/replication");
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1",
      Bytes.toBytes(conf.get(HConstants.ZOOKEEPER_QUORUM) + ":"
          + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":/1"));
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1/peer-state");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1/peer-state",
      Bytes.toBytes(ReplicationZookeeper.PeerState.ENABLED.name()));
  ZKUtil.createWithParents(zkw, "/hbase/replication/state");
  ZKUtil.setData(zkw, "/hbase/replication/state", Bytes.toBytes("true"));

  replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
  manager = replication.getReplicationManager();
  fs = FileSystem.get(conf);
  oldLogDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_OLDLOGDIR_NAME);
  logDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_LOGDIR_NAME);

  manager.addSource(slaveId);

  htd = new HTableDescriptor(test);
  HColumnDescriptor col = new HColumnDescriptor("f1");
  col.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  htd.addFamily(col);
  col = new HColumnDescriptor("f2");
  col.setScope(HConstants.REPLICATION_SCOPE_LOCAL);
  htd.addFamily(col);

  hri = new HRegionInfo(htd.getName(), r1, r2);


}
项目:DominoHBase    文件:TestReplicationSourceManager.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {

  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
      ReplicationSourceDummy.class.getCanonicalName());
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY, true);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();

  zkw = new ZooKeeperWatcher(conf, "test", null);
  ZKUtil.createWithParents(zkw, "/hbase/replication");
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1",
      Bytes.toBytes(conf.get(HConstants.ZOOKEEPER_QUORUM) + ":"
          + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":/1"));
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1/peer-state");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1/peer-state",
    ReplicationZookeeper.ENABLED_ZNODE_BYTES);
  ZKUtil.createWithParents(zkw, "/hbase/replication/state");
  ZKUtil.setData(zkw, "/hbase/replication/state", ReplicationZookeeper.ENABLED_ZNODE_BYTES);

  replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
  manager = replication.getReplicationManager();
  fs = FileSystem.get(conf);
  oldLogDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_OLDLOGDIR_NAME);
  logDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_LOGDIR_NAME);
  logName = HConstants.HREGION_LOGDIR_NAME;

  manager.addSource(slaveId);

  htd = new HTableDescriptor(test);
  HColumnDescriptor col = new HColumnDescriptor("f1");
  col.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  htd.addFamily(col);
  col = new HColumnDescriptor("f2");
  col.setScope(HConstants.REPLICATION_SCOPE_LOCAL);
  htd.addFamily(col);

  hri = new HRegionInfo(htd.getName(), r1, r2);
}
项目:hindex    文件:TestReplicationSourceManager.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {

  conf = HBaseConfiguration.create();
  conf.set("replication.replicationsource.implementation",
      ReplicationSourceDummy.class.getCanonicalName());
  conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY, true);
  utility = new HBaseTestingUtility(conf);
  utility.startMiniZKCluster();

  zkw = new ZooKeeperWatcher(conf, "test", null);
  ZKUtil.createWithParents(zkw, "/hbase/replication");
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1",
      Bytes.toBytes(conf.get(HConstants.ZOOKEEPER_QUORUM) + ":"
          + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":/1"));
  ZKUtil.createWithParents(zkw, "/hbase/replication/peers/1/peer-state");
  ZKUtil.setData(zkw, "/hbase/replication/peers/1/peer-state",
      Bytes.toBytes(ReplicationZookeeper.PeerState.ENABLED.name()));
  ZKUtil.createWithParents(zkw, "/hbase/replication/state");
  ZKUtil.setData(zkw, "/hbase/replication/state", Bytes.toBytes("true"));

  replication = new Replication(new DummyServer(), fs, logDir, oldLogDir);
  manager = replication.getReplicationManager();
  fs = FileSystem.get(conf);
  oldLogDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_OLDLOGDIR_NAME);
  logDir = new Path(utility.getDataTestDir(),
      HConstants.HREGION_LOGDIR_NAME);

  manager.addSource(slaveId);

  htd = new HTableDescriptor(test);
  HColumnDescriptor col = new HColumnDescriptor("f1");
  col.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  htd.addFamily(col);
  col = new HColumnDescriptor("f2");
  col.setScope(HConstants.REPLICATION_SCOPE_LOCAL);
  htd.addFamily(col);

  hri = new HRegionInfo(htd.getName(), r1, r2);


}