use of org.apache.hadoop.hbase.NamespaceDescriptor in project hbase by apache.
the class ThriftUtilities method namespaceDescriptorsFromThrift.
public static NamespaceDescriptor[] namespaceDescriptorsFromThrift(List<TNamespaceDescriptor> in) {
NamespaceDescriptor[] out = new NamespaceDescriptor[in.size()];
int index = 0;
for (TNamespaceDescriptor descriptor : in) {
out[index++] = namespaceDescriptorFromThrift(descriptor);
}
return out;
}
use of org.apache.hadoop.hbase.NamespaceDescriptor in project hbase by apache.
the class ThriftHBaseServiceHandler method modifyNamespace.
@Override
public void modifyNamespace(TNamespaceDescriptor namespaceDesc) throws TIOError, TException {
try {
NamespaceDescriptor descriptor = namespaceDescriptorFromThrift(namespaceDesc);
connectionCache.getAdmin().modifyNamespace(descriptor);
} catch (IOException e) {
throw getTIOError(e);
}
}
use of org.apache.hadoop.hbase.NamespaceDescriptor in project hbase by apache.
the class TestSimpleRegionNormalizerOnCluster method buildTableNameForQuotaTest.
private static TableName buildTableNameForQuotaTest(final String methodName) throws Exception {
String nsp = "np2";
NamespaceDescriptor nspDesc = NamespaceDescriptor.create(nsp).addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "5").addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "2").build();
admin.createNamespace(nspDesc).get();
return TableName.valueOf(nsp, methodName);
}
use of org.apache.hadoop.hbase.NamespaceDescriptor in project hbase by apache.
the class TestCreateNamespaceProcedure method validateNamespaceCreated.
private void validateNamespaceCreated(NamespaceDescriptor nsd) throws IOException {
NamespaceDescriptor createdNsDescriptor = UTIL.getAdmin().getNamespaceDescriptor(nsd.getName());
assertNotNull(createdNsDescriptor);
}
use of org.apache.hadoop.hbase.NamespaceDescriptor in project hbase by apache.
the class TestCreateNamespaceProcedure method testCreateNamespaceWithInvalidRegionCount.
@Test
public void testCreateNamespaceWithInvalidRegionCount() throws Exception {
final NamespaceDescriptor nsd = NamespaceDescriptor.create("testCreateNamespaceWithInvalidRegionCount").build();
final String nsKey = "hbase.namespace.quota.maxregions";
final String nsValue = "-1";
final ProcedureExecutor<MasterProcedureEnv> procExec = getMasterProcedureExecutor();
nsd.setConfiguration(nsKey, nsValue);
long procId = procExec.submitProcedure(new CreateNamespaceProcedure(procExec.getEnvironment(), nsd));
// Wait the completion
ProcedureTestingUtility.waitProcedure(procExec, procId);
Procedure<?> result = procExec.getResult(procId);
assertTrue(result.isFailed());
LOG.debug("Create namespace failed with exception: " + result.getException());
assertTrue(ProcedureTestingUtility.getExceptionCause(result) instanceof ConstraintException);
}
Aggregations