@InterfaceAudience.Private public class CloneSnapshotHandler extends CreateTableHandler implements SnapshotSentinel
Uses RestoreSnapshotHelper to create a new table with the same
content of the specified snapshot.
EventHandler.EventHandlerListenerconf, fileSystemManager, hTableDescriptoreventType, seqids, server, waitingTimeForEvents| 构造器和说明 |
|---|
CloneSnapshotHandler(MasterServices masterServices,
org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot,
HTableDescriptor hTableDescriptor,
boolean restoreAcl) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
addRegionsToMeta(List<HRegionInfo> regionInfos,
int regionReplication)
Add the specified set of regions to the hbase:meta table.
|
void |
cancel(String why)
Actively cancel a running snapshot.
|
protected void |
completed(Throwable exception)
Called after that process() is completed.
|
long |
getCompletionTimestamp() |
ForeignException |
getExceptionIfFailed()
Get the exception that caused the snapshot to fail, if the snapshot has failed.
|
org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription |
getSnapshot() |
protected List<HRegionInfo> |
handleCreateHdfsRegions(org.apache.hadoop.fs.Path tableRootDir,
TableName tableName)
Create the on-disk regions, using the tableRootDir provided by the CreateTableHandler.
|
boolean |
isFinished()
Check to see if the snapshot is finished, where finished may be success or failure.
|
CloneSnapshotHandler |
prepare()
Event handlers should do all the necessary checks in this method (rather than
in the constructor, or in process()) so that the caller, which is mostly executed
in the ipc context can fail fast.
|
void |
rethrowExceptionIfFailed()
Rethrow the exception returned by
SnapshotSentinel.getExceptionIfFailed(). |
addReplicas, process, toStringcompareTo, getEventType, getInformativeName, getListener, getPriority, getSeqid, handleException, run, setListenerpublic CloneSnapshotHandler(MasterServices masterServices, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot, HTableDescriptor hTableDescriptor, boolean restoreAcl)
public CloneSnapshotHandler prepare() throws NotAllMetaRegionsOnlineException, TableExistsException, IOException
EventHandlerprepare 在类中 CreateTableHandlerNotAllMetaRegionsOnlineExceptionTableExistsExceptionIOExceptionprotected List<HRegionInfo> handleCreateHdfsRegions(org.apache.hadoop.fs.Path tableRootDir, TableName tableName) throws IOException
handleCreateHdfsRegions 在类中 CreateTableHandlertableRootDir - directory where the table is being createdtableName - name of the table under constructionIOExceptionprotected void addRegionsToMeta(List<HRegionInfo> regionInfos, int regionReplication) throws IOException
CreateTableHandleraddRegionsToMeta 在类中 CreateTableHandlerIOExceptionprotected void completed(Throwable exception)
CreateTableHandlercompleted 在类中 CreateTableHandlerexception - null if process() is successful or not null if something has failed.public boolean isFinished()
SnapshotSentinelisFinished 在接口中 SnapshotSentinelpublic long getCompletionTimestamp()
getCompletionTimestamp 在接口中 SnapshotSentinelpublic org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription getSnapshot()
getSnapshot 在接口中 SnapshotSentinelpublic void cancel(String why)
SnapshotSentinelcancel 在接口中 SnapshotSentinelwhy - Reason for cancellation.public ForeignException getExceptionIfFailed()
SnapshotSentinelgetExceptionIfFailed 在接口中 SnapshotSentinelForeignException that caused the snapshot to fail, or null if the
snapshot is still in progress or has succeededpublic void rethrowExceptionIfFailed()
throws ForeignException
SnapshotSentinelSnapshotSentinel.getExceptionIfFailed().
If there is no exception this is a no-op.rethrowExceptionIfFailed 在接口中 SnapshotSentinelForeignException - all exceptions from remote sources are procedure exceptionsCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.