@Override
  protected boolean acquireLock(final MasterProcedureEnv env) {
    if (!env.getMasterServices().isInitialized()) {
      // Namespace manager might not be ready if master is not fully initialized,
      // return false to reject user namespace creation; return true for default
      // and system namespace creation (this is part of master initialization).
      if (nsDescriptor.equals(NamespaceDescriptor.DEFAULT_NAMESPACE)
          || nsDescriptor.equals(NamespaceDescriptor.SYSTEM_NAMESPACE)) {
        return true;
      }

      return false;
    }
    return getTableNamespaceManager(env).acquireExclusiveLock();
  }
示例#2
0
 private boolean isBootstrapNamespace() {
   return nsDescriptor.equals(NamespaceDescriptor.DEFAULT_NAMESPACE)
       || nsDescriptor.equals(NamespaceDescriptor.SYSTEM_NAMESPACE);
 }