本文整理了Java中org.apache.hadoop.hbase.client.Admin.disableTableReplication()
方法的一些代码示例,展示了Admin.disableTableReplication()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Admin.disableTableReplication()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Admin
类名称:Admin
方法名:disableTableReplication
[英]Disable a table's replication switch.
[中]禁用表的复制开关。
代码示例来源:origin: apache/hbase
/**
* Disable a table's replication switch.
* @param tableName name of the table
* @throws IOException if a remote or network exception occurs
* @deprecated use {@link org.apache.hadoop.hbase.client.Admin#disableTableReplication(TableName)}
* instead
*/
@Deprecated
public void disableTableRep(final TableName tableName) throws IOException {
admin.disableTableReplication(tableName);
}
代码示例来源:origin: apache/hbase
@Test(expected = IllegalArgumentException.class)
public void testDisableReplicationWhenTableNameAsNull() throws Exception {
admin1.disableTableReplication(null);
}
代码示例来源:origin: apache/hbase
@Test(expected = TableNotFoundException.class)
public void testDisableReplicationForNonExistingTable() throws Exception {
admin1.disableTableReplication(TableName.valueOf(name.getMethodName()));
}
代码示例来源:origin: apache/hbase
@Test
public void disableNotFullReplication() throws Exception {
HTableDescriptor table = new HTableDescriptor(admin2.getTableDescriptor(tableName));
HColumnDescriptor f = new HColumnDescriptor("notReplicatedFamily");
table.addFamily(f);
admin1.disableTable(tableName);
admin1.modifyTable(tableName, table);
admin1.enableTable(tableName);
admin1.disableTableReplication(tableName);
table = admin1.getTableDescriptor(tableName);
for (HColumnDescriptor fam : table.getColumnFamilies()) {
assertEquals(HConstants.REPLICATION_SCOPE_LOCAL, fam.getScope());
}
admin1.deleteColumnFamily(table.getTableName(), f.getName());
}
代码示例来源:origin: org.apache.hbase/hbase-client
/**
* Disable a table's replication switch.
* @param tableName name of the table
* @throws IOException if a remote or network exception occurs
* @deprecated use {@link org.apache.hadoop.hbase.client.Admin#disableTableReplication(TableName)}
* instead
*/
@Deprecated
public void disableTableRep(final TableName tableName) throws IOException {
admin.disableTableReplication(tableName);
}
代码示例来源:origin: apache/hbase
@Test
public void testEnableReplicationWhenSlaveClusterDoesntHaveTable() throws Exception {
admin1.disableTableReplication(tableName);
admin2.disableTable(tableName);
admin2.deleteTable(tableName);
assertFalse(admin2.tableExists(tableName));
admin1.enableTableReplication(tableName);
assertTrue(admin2.tableExists(tableName));
}
代码示例来源:origin: apache/hbase
@Test
public void testDisableAndEnableReplication() throws Exception {
admin1.disableTableReplication(tableName);
HTableDescriptor table = admin1.getTableDescriptor(tableName);
for (HColumnDescriptor fam : table.getColumnFamilies()) {
assertEquals(HConstants.REPLICATION_SCOPE_LOCAL, fam.getScope());
}
admin1.enableTableReplication(tableName);
table = admin1.getTableDescriptor(tableName);
for (HColumnDescriptor fam : table.getColumnFamilies()) {
assertEquals(HConstants.REPLICATION_SCOPE_GLOBAL, fam.getScope());
}
}
代码示例来源:origin: apache/hbase
} finally {
adminExt.removePeerTableCFs(peerId, adminExt.getPeerTableCFs(peerId));
admin1.disableTableReplication(TestReplicationBase.tableName);
代码示例来源:origin: com.aliyun.hbase/alihbase-client
/**
* Disable a table's replication switch.
* @param tableName name of the table
* @throws IOException if a remote or network exception occurs
* @deprecated use {@link org.apache.hadoop.hbase.client.Admin#disableTableReplication(TableName)}
* instead
*/
@Deprecated
public void disableTableRep(final TableName tableName) throws IOException {
admin.disableTableReplication(tableName);
}
代码示例来源:origin: org.apache.hbase/hbase-server
@Test(expected = IllegalArgumentException.class)
public void testDisableReplicationWhenTableNameAsNull() throws Exception {
admin1.disableTableReplication(null);
}
代码示例来源:origin: org.apache.hbase/hbase-server
@Test(expected = TableNotFoundException.class)
public void testDisableReplicationForNonExistingTable() throws Exception {
admin1.disableTableReplication(TableName.valueOf(name.getMethodName()));
}
代码示例来源:origin: org.apache.hbase/hbase-server
@Test
public void disableNotFullReplication() throws Exception {
HTableDescriptor table = new HTableDescriptor(admin2.getTableDescriptor(tableName));
HColumnDescriptor f = new HColumnDescriptor("notReplicatedFamily");
table.addFamily(f);
admin1.disableTable(tableName);
admin1.modifyTable(tableName, table);
admin1.enableTable(tableName);
admin1.disableTableReplication(tableName);
table = admin1.getTableDescriptor(tableName);
for (HColumnDescriptor fam : table.getColumnFamilies()) {
assertEquals(HConstants.REPLICATION_SCOPE_LOCAL, fam.getScope());
}
admin1.deleteColumnFamily(table.getTableName(), f.getName());
}
代码示例来源:origin: org.apache.hbase/hbase-server
@Test
public void testEnableReplicationWhenSlaveClusterDoesntHaveTable() throws Exception {
admin1.disableTableReplication(tableName);
admin2.disableTable(tableName);
admin2.deleteTable(tableName);
assertFalse(admin2.tableExists(tableName));
admin1.enableTableReplication(tableName);
assertTrue(admin2.tableExists(tableName));
}
代码示例来源:origin: org.apache.hbase/hbase-server
@Test
public void testDisableAndEnableReplication() throws Exception {
admin1.disableTableReplication(tableName);
HTableDescriptor table = admin1.getTableDescriptor(tableName);
for (HColumnDescriptor fam : table.getColumnFamilies()) {
assertEquals(HConstants.REPLICATION_SCOPE_LOCAL, fam.getScope());
}
admin1.enableTableReplication(tableName);
table = admin1.getTableDescriptor(tableName);
for (HColumnDescriptor fam : table.getColumnFamilies()) {
assertEquals(HConstants.REPLICATION_SCOPE_GLOBAL, fam.getScope());
}
}
代码示例来源:origin: org.apache.hbase/hbase-server
} finally {
adminExt.removePeerTableCFs(peerId, adminExt.getPeerTableCFs(peerId));
admin1.disableTableReplication(TestReplicationBase.tableName);
内容来源于网络,如有侵权,请联系作者删除!