org.apache.hadoop.hbase.client.Admin.enableReplicationPeer()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中org.apache.hadoop.hbase.client.Admin.enableReplicationPeer()方法的一些代码示例,展示了Admin.enableReplicationPeer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Admin.enableReplicationPeer()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Admin
类名称:Admin
方法名:enableReplicationPeer

Admin.enableReplicationPeer介绍

[英]Restart the replication stream to the specified peer.
[中]将复制流重新启动到指定的对等方。

代码示例

代码示例来源:origin: apache/hbase

/**
 * Restart the replication stream to the specified peer.
 * @param id a short name that identifies the cluster
 * @deprecated use {@link org.apache.hadoop.hbase.client.Admin#enableReplicationPeer(String)}
 *             instead
 */
@Deprecated
public void enablePeer(String id) throws IOException {
 this.admin.enableReplicationPeer(id);
}

代码示例来源:origin: apache/hbase

private void enablePeer(String id, int masterClusterNumber) throws Exception {
 try (Admin admin = ConnectionFactory.createConnection(configurations[masterClusterNumber])
   .getAdmin()) {
  admin.enableReplicationPeer(id);
 }
}

代码示例来源:origin: apache/hbase

protected final void enablePeerAndWaitUntilReplicationDone(int expectedEntries) throws Exception {
 UTIL.getAdmin().enableReplicationPeer(PEER_ID);
 waitUntilReplicationDone(expectedEntries);
}

代码示例来源:origin: apache/hbase

hbaseAdmin.enableReplicationPeer(PEER_ID);

代码示例来源:origin: org.apache.hbase/hbase-client

/**
 * Restart the replication stream to the specified peer.
 * @param id a short name that identifies the cluster
 * @deprecated use {@link org.apache.hadoop.hbase.client.Admin#enableReplicationPeer(String)}
 *             instead
 */
@Deprecated
public void enablePeer(String id) throws IOException {
 this.admin.enableReplicationPeer(id);
}

代码示例来源:origin: apache/hbase

runVerifyReplication(args, 0, 1);
} finally {
 hbaseAdmin.enableReplicationPeer(PEER_ID);

代码示例来源:origin: apache/hbase

UTIL2.getAdmin().enableReplicationPeer(PEER_ID);

代码示例来源:origin: apache/hbase

ReplicationPeerConfig.newBuilder(peerConfig)
  .setTableCFsMap(ImmutableMap.of(tableName, Collections.emptyList())).build());
UTIL.getAdmin().enableReplicationPeer(PEER_ID);
try (Table table = UTIL.getConnection().getTable(tableName)) {
 for (int i = 0; i < 100; i++) {

代码示例来源:origin: apache/hbase

@Test
public void testChangeToSerial() throws Exception {
 ReplicationPeerConfig peerConfig =
  ReplicationPeerConfig.newBuilder().setClusterKey("127.0.0.1:2181:/hbase")
   .setReplicationEndpointImpl(LocalReplicationEndpoint.class.getName()).build();
 UTIL.getAdmin().addReplicationPeer(PEER_ID, peerConfig, true);
 TableName tableName = createTable();
 try (Table table = UTIL.getConnection().getTable(tableName)) {
  for (int i = 0; i < 100; i++) {
   table.put(new Put(Bytes.toBytes(i)).addColumn(CF, CQ, Bytes.toBytes(i)));
  }
 }
 RegionInfo region = UTIL.getAdmin().getRegions(tableName).get(0);
 HRegionServer srcRs = UTIL.getRSForFirstRegionInTable(tableName);
 HRegionServer rs = UTIL.getOtherRegionServer(srcRs);
 moveRegionAndArchiveOldWals(region, rs);
 waitUntilReplicationDone(100);
 waitUntilReplicatedToTheCurrentWALFile(srcRs);
 UTIL.getAdmin().disableReplicationPeer(PEER_ID);
 UTIL.getAdmin().updateReplicationPeerConfig(PEER_ID,
  ReplicationPeerConfig.newBuilder(peerConfig).setSerial(true).build());
 UTIL.getAdmin().enableReplicationPeer(PEER_ID);
 try (Table table = UTIL.getConnection().getTable(tableName)) {
  for (int i = 0; i < 100; i++) {
   table.put(new Put(Bytes.toBytes(i)).addColumn(CF, CQ, Bytes.toBytes(i)));
  }
 }
 waitUntilReplicationDone(200);
 checkOrder(200);
}

代码示例来源:origin: apache/hbase

UTIL1.getAdmin().enableReplicationPeer(PEER_ID);
waitUntilReplicationDone(UTIL2, 200);
verifyThroughRegion(UTIL2, 100, 200);

代码示例来源:origin: apache/hbase

admin1.enableReplicationPeer(PEER_ID2);

代码示例来源:origin: apache/hbase

admin1.enableReplicationPeer(PEER_ID2);

代码示例来源:origin: apache/hbase

admin.enableReplicationPeer(peerId);
Waiter.waitFor(conf, 20000, new Waiter.Predicate<Exception>() {
 @Override public boolean evaluate() throws Exception {

代码示例来源:origin: apache/hbase

UTIL2.getAdmin().transitReplicationPeerSyncReplicationState(PEER_ID,
 SyncReplicationState.STANDBY);
UTIL1.getAdmin().enableReplicationPeer(PEER_ID);

代码示例来源:origin: apache/hbase

assertEquals(SyncReplicationState.DOWNGRADE_ACTIVE,
 hbaseAdmin.getReplicationPeerSyncReplicationState(ID_SECOND));
hbaseAdmin.enableReplicationPeer(ID_SECOND);
assertEquals(SyncReplicationState.DOWNGRADE_ACTIVE,
 hbaseAdmin.getReplicationPeerSyncReplicationState(ID_SECOND));

代码示例来源:origin: apache/hbase

private void doTest() throws IOException {
 Admin admin = UTIL.getAdmin();
 String peerId = "1";
 ReplicationPeerConfig peerConfig = ReplicationPeerConfig.newBuilder()
   .setClusterKey("localhost:" + UTIL.getZkCluster().getClientPort() + ":/hbase2").build();
 admin.addReplicationPeer(peerId, peerConfig, true);
 assertEquals(peerConfig.getClusterKey(),
  admin.getReplicationPeerConfig(peerId).getClusterKey());
 ReplicationPeerConfig newPeerConfig =
   ReplicationPeerConfig.newBuilder(peerConfig).setBandwidth(123456).build();
 admin.updateReplicationPeerConfig(peerId, newPeerConfig);
 assertEquals(newPeerConfig.getBandwidth(),
  admin.getReplicationPeerConfig(peerId).getBandwidth());
 admin.disableReplicationPeer(peerId);
 assertFalse(admin.listReplicationPeers().get(0).isEnabled());
 admin.enableReplicationPeer(peerId);
 assertTrue(admin.listReplicationPeers().get(0).isEnabled());
 admin.removeReplicationPeer(peerId);
 assertTrue(admin.listReplicationPeers().isEmpty());
 // make sure that we have run into the mocked method
 MockHMaster master = (MockHMaster) UTIL.getHBaseCluster().getMaster();
 assertTrue(master.addPeerCalled);
 assertTrue(master.removePeerCalled);
 assertTrue(master.updatePeerConfigCalled);
 assertTrue(master.enablePeerCalled);
 assertTrue(master.disablePeerCalled);
}

代码示例来源:origin: apache/hbase

SyncReplicationState.DOWNGRADE_ACTIVE);
UTIL2.getAdmin().enableReplicationPeer(PEER_ID);

代码示例来源:origin: com.aliyun.hbase/alihbase-client

/**
 * Restart the replication stream to the specified peer.
 * @param id a short name that identifies the cluster
 * @deprecated use {@link org.apache.hadoop.hbase.client.Admin#enableReplicationPeer(String)}
 *             instead
 */
@Deprecated
public void enablePeer(String id) throws IOException {
 this.admin.enableReplicationPeer(id);
}

代码示例来源:origin: org.apache.hbase/hbase-server

private void enablePeer(String id, int masterClusterNumber) throws Exception {
 try (Admin admin = ConnectionFactory.createConnection(configurations[masterClusterNumber])
   .getAdmin()) {
  admin.enableReplicationPeer(id);
 }
}

代码示例来源:origin: org.apache.hbase/hbase-server

protected final void enablePeerAndWaitUntilReplicationDone(int expectedEntries) throws Exception {
 UTIL.getAdmin().enableReplicationPeer(PEER_ID);
 waitUntilReplicationDone(expectedEntries);
}

相关文章

Admin类方法