Package org.apache.hadoop.hbase.master
Class ClusterSchemaServiceImpl
java.lang.Object
org.apache.hbase.thirdparty.com.google.common.util.concurrent.AbstractService
org.apache.hadoop.hbase.master.ClusterSchemaServiceImpl
- All Implemented Interfaces:
ClusterSchema
,ClusterSchemaService
,org.apache.hbase.thirdparty.com.google.common.util.concurrent.Service
@Private
class ClusterSchemaServiceImpl
extends org.apache.hbase.thirdparty.com.google.common.util.concurrent.AbstractService
implements ClusterSchemaService
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hbase.thirdparty.com.google.common.util.concurrent.Service
org.apache.hbase.thirdparty.com.google.common.util.concurrent.Service.Listener, org.apache.hbase.thirdparty.com.google.common.util.concurrent.Service.State
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final List<NamespaceDescriptor>
private final MasterServices
private final TableNamespaceManager
Fields inherited from interface org.apache.hadoop.hbase.master.ClusterSchema
DEFAULT_HBASE_MASTER_CLUSTER_SCHEMA_OPERATION_TIMEOUT, HBASE_MASTER_CLUSTER_SCHEMA_OPERATION_TIMEOUT_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
long
createNamespace
(NamespaceDescriptor namespaceDescriptor, NonceKey nonceKey, ProcedurePrepareLatch latch) Create a new Namespace.long
deleteNamespace
(String name, NonceKey nonceKey, ProcedurePrepareLatch latch) Delete an existing Namespace.protected void
doStart()
protected void
doStop()
getNamespace
(String name) Get a NamespaceGet all NamespacesFor internals use only.long
modifyNamespace
(NamespaceDescriptor namespaceDescriptor, NonceKey nonceKey, ProcedurePrepareLatch latch) Modify an existing Namespace.private long
submitProcedure
(Procedure<MasterProcedureEnv> procedure, NonceKey nonceKey) Methods inherited from class org.apache.hbase.thirdparty.com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, doCancelStart, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.hbase.thirdparty.com.google.common.util.concurrent.Service
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync
-
Field Details
-
tableNamespaceManager
-
masterServices
-
EMPTY_NAMESPACE_LIST
-
-
Constructor Details
-
ClusterSchemaServiceImpl
ClusterSchemaServiceImpl(MasterServices masterServices)
-
-
Method Details
-
checkIsRunning
- Throws:
ServiceNotRunningException
-
doStart
- Specified by:
doStart
in classorg.apache.hbase.thirdparty.com.google.common.util.concurrent.AbstractService
-
doStop
- Specified by:
doStop
in classorg.apache.hbase.thirdparty.com.google.common.util.concurrent.AbstractService
-
getTableNamespaceManager
Description copied from interface:ClusterSchema
For internals use only. Do not use! Provisionally part of this Interface. Prefer the high-level APIs available elsewhere in this API.- Specified by:
getTableNamespaceManager
in interfaceClusterSchema
- Returns:
- Instance of
TableNamespaceManager
-
submitProcedure
private long submitProcedure(Procedure<MasterProcedureEnv> procedure, NonceKey nonceKey) throws ServiceNotRunningException - Throws:
ServiceNotRunningException
-
createNamespace
public long createNamespace(NamespaceDescriptor namespaceDescriptor, NonceKey nonceKey, ProcedurePrepareLatch latch) throws IOException Description copied from interface:ClusterSchema
Create a new Namespace.- Specified by:
createNamespace
in interfaceClusterSchema
- Parameters:
namespaceDescriptor
- descriptor for new NamespacenonceKey
- A unique identifier for this operation from the client or process.latch
- A latch to block on for precondition validation- Returns:
- procedure id
- Throws:
IOException
- if service is not running seeServiceNotRunningException
-
modifyNamespace
public long modifyNamespace(NamespaceDescriptor namespaceDescriptor, NonceKey nonceKey, ProcedurePrepareLatch latch) throws IOException Description copied from interface:ClusterSchema
Modify an existing Namespace.- Specified by:
modifyNamespace
in interfaceClusterSchema
nonceKey
- A unique identifier for this operation from the client or process.latch
- A latch to block on for precondition validation- Returns:
- procedure id
- Throws:
IOException
- if service is not running seeServiceNotRunningException
-
deleteNamespace
public long deleteNamespace(String name, NonceKey nonceKey, ProcedurePrepareLatch latch) throws IOException Description copied from interface:ClusterSchema
Delete an existing Namespace. Only empty Namespaces (no tables) can be removed.- Specified by:
deleteNamespace
in interfaceClusterSchema
nonceKey
- A unique identifier for this operation from the client or process.latch
- A latch to block on for precondition validation- Returns:
- procedure id
- Throws:
IOException
- if service is not running seeServiceNotRunningException
-
getNamespace
Description copied from interface:ClusterSchema
Get a Namespace- Specified by:
getNamespace
in interfaceClusterSchema
- Parameters:
name
- Name of the Namespace- Returns:
- Namespace descriptor for
name
- Throws:
IOException
- if namespace does not exist
-
getNamespaces
Description copied from interface:ClusterSchema
Get all Namespaces- Specified by:
getNamespaces
in interfaceClusterSchema
- Returns:
- All Namespace descriptors
- Throws:
IOException
-