Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public class NamespaceDescriptor {
public static final byte [] DEFAULT_NAMESPACE_NAME = Bytes.toBytes("default");
public static final String DEFAULT_NAMESPACE_NAME_STR =
Bytes.toString(DEFAULT_NAMESPACE_NAME);
/** Master local region namespace name. */
public static final byte [] MASTER_NAMESPACE_NAME = Bytes.toBytes("master");
public static final String MASTER_NAMESPACE_NAME_STR =
Bytes.toString(MASTER_NAMESPACE_NAME);

public static final NamespaceDescriptor DEFAULT_NAMESPACE = NamespaceDescriptor.create(
DEFAULT_NAMESPACE_NAME_STR).build();
Expand All @@ -58,6 +62,7 @@ public class NamespaceDescriptor {
Set<String> set = new HashSet<>();
set.add(NamespaceDescriptor.DEFAULT_NAMESPACE_NAME_STR);
set.add(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR);
set.add(NamespaceDescriptor.MASTER_NAMESPACE_NAME_STR);
RESERVED_NAMESPACES = Collections.unmodifiableSet(set);
}
public final static Set<byte[]> RESERVED_NAMESPACES_BYTES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ private TableName(ByteBuffer namespace, ByteBuffer qualifier) throws IllegalArgu
this.namespace = NamespaceDescriptor.SYSTEM_NAMESPACE_NAME;
this.namespaceAsString = NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR;
this.systemTable = true;
} else {
} else if (Bytes.equals(NamespaceDescriptor.MASTER_NAMESPACE_NAME, namespace)) {
this.namespace = NamespaceDescriptor.MASTER_NAMESPACE_NAME;
this.namespaceAsString = NamespaceDescriptor.MASTER_NAMESPACE_NAME_STR;
this.systemTable = true;
} else {
this.namespace = new byte[namespace.remaining()];
namespace.duplicate().get(this.namespace);
this.namespaceAsString = Bytes.toString(this.namespace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ public void testDeleteReservedNS() throws Exception {
} finally {
assertTrue(exceptionCaught);
}

try {
admin.deleteNamespace(NamespaceDescriptor.MASTER_NAMESPACE_NAME_STR);
} catch (IOException exp) {
LOG.warn(exp.toString(), exp);
exceptionCaught = true;
} finally {
assertTrue(exceptionCaught);
}
}

@Test
Expand Down