本文整理了Java中org.apache.hadoop.hbase.client.Admin.disableReplicationPeer()
方法的一些代码示例,展示了Admin.disableReplicationPeer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Admin.disableReplicationPeer()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Admin
类名称:Admin
方法名:disableReplicationPeer
[英]Stop the replication stream to the specified peer.
[中]停止到指定对等方的复制流。
代码示例来源:origin: apache/hbase
/**
* Stop 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#disableReplicationPeer(String)}
* instead
*/
@Deprecated
public void disablePeer(String id) throws IOException {
this.admin.disableReplicationPeer(id);
}
代码示例来源:origin: apache/hbase
private void disablePeer(String id, int masterClusterNumber) throws Exception {
try (Admin admin = ConnectionFactory.createConnection(configurations[masterClusterNumber])
.getAdmin()) {
admin.disableReplicationPeer(id);
}
}
代码示例来源:origin: apache/hbase
public void testDisableEnable() throws Exception {
hbaseAdmin.disableReplicationPeer(PEER_ID);
代码示例来源:origin: apache/hbase
hbaseAdmin.disableReplicationPeer(PEER_ID);
Put put2 = new Put(Bytes.toBytes("r1"));
put2.addColumn(famName, qualifierName, ts + 2, Bytes.toBytes("v99"));
代码示例来源:origin: apache/hbase
UTIL1.getAdmin().disableReplicationPeer(PEER_ID);
write(UTIL1, 0, COUNT);
UTIL1.shutdownMiniCluster();
代码示例来源:origin: apache/hbase
@Test
public void testSplitLog() throws Exception {
UTIL1.getAdmin().disableReplicationPeer(PEER_ID);
UTIL2.getAdmin().transitReplicationPeerSyncReplicationState(PEER_ID,
SyncReplicationState.STANDBY);
代码示例来源:origin: apache/hbase
@Test
public void testSplitLog() throws Exception {
UTIL1.getAdmin().disableReplicationPeer(PEER_ID);
UTIL2.getAdmin().disableReplicationPeer(PEER_ID);
UTIL2.getAdmin().transitReplicationPeerSyncReplicationState(PEER_ID,
SyncReplicationState.STANDBY);
代码示例来源:origin: apache/hbase
SyncReplicationState.ACTIVE);
UTIL1.getAdmin().disableReplicationPeer(PEER_ID);
write(UTIL1, 0, 100);
Thread.sleep(2000);
代码示例来源:origin: apache/hbase
verifyReplicationRequestRejection(UTIL2, false);
UTIL1.getAdmin().disableReplicationPeer(PEER_ID);
write(UTIL1, 0, 100);
Thread.sleep(2000);
代码示例来源:origin: apache/hbase
moveRegionAndArchiveOldWals(region, rs);
waitUntilReplicatedToTheCurrentWALFile(rs);
UTIL.getAdmin().disableReplicationPeer(PEER_ID);
UTIL.getAdmin().updateReplicationPeerConfig(PEER_ID,
ReplicationPeerConfig.newBuilder(peerConfig)
代码示例来源: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
SyncReplicationState.ACTIVE);
UTIL1.getAdmin().disableReplicationPeer(PEER_ID);
write(UTIL1, 0, 100);
Thread.sleep(2000);
代码示例来源:origin: apache/hbase
assertThat(remoteWAL.getName(), endsWith(ReplicationUtils.SYNC_WAL_SUFFIX));
UTIL1.getAdmin().disableReplicationPeer(PEER_ID);
write(UTIL1, 100, 200);
UTIL1.getAdmin().transitReplicationPeerSyncReplicationState(PEER_ID,
代码示例来源:origin: apache/hbase
admin1.disableReplicationPeer(PEER_ID2);
代码示例来源:origin: apache/hbase
UTIL1.getAdmin().disableReplicationPeer(PEER_ID);
write(UTIL1, 0, COUNT);
UTIL1.shutdownMiniCluster();
代码示例来源:origin: apache/hbase
admin1.disableReplicationPeer(PEER_ID2);
代码示例来源:origin: apache/hbase
UTIL1.getAdmin().transitReplicationPeerSyncReplicationState(PEER_ID,
SyncReplicationState.ACTIVE);
UTIL1.getAdmin().disableReplicationPeer(PEER_ID);
write(UTIL1, 0, 100);
代码示例来源:origin: apache/hbase
admin.disableReplicationPeer(peerId);
代码示例来源: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.ACTIVE);
UTIL2.getAdmin().disableReplicationPeer(PEER_ID);
内容来源于网络,如有侵权,请联系作者删除!