Search in sources :

Example 1 with SnapshotResponse

use of org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotResponse in project hbase by apache.

the class TestSnapshotFromAdmin method testBackoffLogic.

/**
   * Test that the logic for doing 'correct' back-off based on exponential increase and the max-time
   * passed from the server ensures the correct overall waiting for the snapshot to finish.
   * @throws Exception
   */
@Test(timeout = 60000)
public void testBackoffLogic() throws Exception {
    final int pauseTime = 100;
    final int maxWaitTime = HConstants.RETRY_BACKOFF[HConstants.RETRY_BACKOFF.length - 1] * pauseTime;
    final int numRetries = HConstants.RETRY_BACKOFF.length;
    // calculate the wait time, if we just do straight backoff (ignoring the expected time from
    // master)
    long ignoreExpectedTime = 0;
    for (int i = 0; i < HConstants.RETRY_BACKOFF.length; i++) {
        ignoreExpectedTime += HConstants.RETRY_BACKOFF[i] * pauseTime;
    }
    // the correct wait time, capping at the maxTime/tries + fudge room
    final long time = pauseTime * 3 + ((maxWaitTime / numRetries) * 3) + 300;
    assertTrue("Capped snapshot wait time isn't less that the uncapped backoff time " + "- further testing won't prove anything.", time < ignoreExpectedTime);
    // setup the mocks
    ConnectionImplementation mockConnection = Mockito.mock(ConnectionImplementation.class);
    Configuration conf = HBaseConfiguration.create();
    // setup the conf to match the expected properties
    conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, numRetries);
    conf.setLong("hbase.client.pause", pauseTime);
    // mock the master admin to our mock
    MasterKeepAliveConnection mockMaster = Mockito.mock(MasterKeepAliveConnection.class);
    Mockito.when(mockConnection.getConfiguration()).thenReturn(conf);
    Mockito.when(mockConnection.getKeepAliveMasterService()).thenReturn(mockMaster);
    // we need a real retrying caller
    RpcRetryingCallerFactory callerFactory = new RpcRetryingCallerFactory(conf);
    RpcControllerFactory controllerFactory = Mockito.mock(RpcControllerFactory.class);
    Mockito.when(controllerFactory.newController()).thenReturn(Mockito.mock(HBaseRpcController.class));
    Mockito.when(mockConnection.getRpcRetryingCallerFactory()).thenReturn(callerFactory);
    Mockito.when(mockConnection.getRpcControllerFactory()).thenReturn(controllerFactory);
    // set the max wait time for the snapshot to complete
    SnapshotResponse response = SnapshotResponse.newBuilder().setExpectedTimeout(maxWaitTime).build();
    Mockito.when(mockMaster.snapshot((RpcController) Mockito.any(), Mockito.any(SnapshotRequest.class))).thenReturn(response);
    // setup the response
    IsSnapshotDoneResponse.Builder builder = IsSnapshotDoneResponse.newBuilder();
    builder.setDone(false);
    // first five times, we return false, last we get success
    Mockito.when(mockMaster.isSnapshotDone((RpcController) Mockito.any(), Mockito.any(IsSnapshotDoneRequest.class))).thenReturn(builder.build(), builder.build(), builder.build(), builder.build(), builder.build(), builder.setDone(true).build());
    // setup the admin and run the test
    Admin admin = new HBaseAdmin(mockConnection);
    String snapshot = "snapshot";
    final TableName table = TableName.valueOf(name.getMethodName());
    // get start time
    long start = System.currentTimeMillis();
    admin.snapshot(snapshot, table);
    long finish = System.currentTimeMillis();
    long elapsed = (finish - start);
    assertTrue("Elapsed time:" + elapsed + " is more than expected max:" + time, elapsed <= time);
    admin.close();
}
Also used : HBaseConfiguration(org.apache.hadoop.hbase.HBaseConfiguration) Configuration(org.apache.hadoop.conf.Configuration) RpcControllerFactory(org.apache.hadoop.hbase.ipc.RpcControllerFactory) TableName(org.apache.hadoop.hbase.TableName) HBaseRpcController(org.apache.hadoop.hbase.ipc.HBaseRpcController) SnapshotResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotResponse) SnapshotRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotRequest) IsSnapshotDoneResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotDoneResponse) IsSnapshotDoneRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotDoneRequest) Test(org.junit.Test)

Example 2 with SnapshotResponse

use of org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotResponse in project hbase by apache.

the class HBaseAdmin method asyncSnapshot.

private SnapshotResponse asyncSnapshot(HBaseProtos.SnapshotDescription snapshot) throws IOException {
    ClientSnapshotDescriptionUtils.assertSnapshotRequestIsValid(snapshot);
    final SnapshotRequest request = SnapshotRequest.newBuilder().setSnapshot(snapshot).build();
    // run the snapshot on the master
    return executeCallable(new MasterCallable<SnapshotResponse>(getConnection(), getRpcControllerFactory()) {

        @Override
        protected SnapshotResponse rpcCall() throws Exception {
            return master.snapshot(getRpcController(), request);
        }
    });
}
Also used : SnapshotResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotResponse) RestoreSnapshotResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RestoreSnapshotResponse) RestoreSnapshotRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RestoreSnapshotRequest) SnapshotRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotRequest) DeleteSnapshotRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteSnapshotRequest) RestoreSnapshotException(org.apache.hadoop.hbase.snapshot.RestoreSnapshotException) SnapshotCreationException(org.apache.hadoop.hbase.snapshot.SnapshotCreationException) InterruptedIOException(java.io.InterruptedIOException) ZooKeeperConnectionException(org.apache.hadoop.hbase.ZooKeeperConnectionException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) TableNotDisabledException(org.apache.hadoop.hbase.TableNotDisabledException) TableNotFoundException(org.apache.hadoop.hbase.TableNotFoundException) HBaseSnapshotException(org.apache.hadoop.hbase.snapshot.HBaseSnapshotException) TimeoutException(java.util.concurrent.TimeoutException) NotServingRegionException(org.apache.hadoop.hbase.NotServingRegionException) ReplicationException(org.apache.hadoop.hbase.replication.ReplicationException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) UnknownRegionException(org.apache.hadoop.hbase.UnknownRegionException) FailedLogCloseException(org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException) MasterNotRunningException(org.apache.hadoop.hbase.MasterNotRunningException) TimeoutIOException(org.apache.hadoop.hbase.exceptions.TimeoutIOException) NamespaceNotFoundException(org.apache.hadoop.hbase.NamespaceNotFoundException) TableExistsException(org.apache.hadoop.hbase.TableExistsException) KeeperException(org.apache.zookeeper.KeeperException) UnknownSnapshotException(org.apache.hadoop.hbase.snapshot.UnknownSnapshotException) RemoteException(org.apache.hadoop.ipc.RemoteException) ServiceException(org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException)

Example 3 with SnapshotResponse

use of org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotResponse in project hbase by apache.

the class HBaseAdmin method snapshot.

@Override
public void snapshot(SnapshotDescription snapshotDesc) throws IOException, SnapshotCreationException, IllegalArgumentException {
    // actually take the snapshot
    HBaseProtos.SnapshotDescription snapshot = ProtobufUtil.createHBaseProtosSnapshotDesc(snapshotDesc);
    SnapshotResponse response = asyncSnapshot(snapshot);
    final IsSnapshotDoneRequest request = IsSnapshotDoneRequest.newBuilder().setSnapshot(snapshot).build();
    IsSnapshotDoneResponse done = null;
    long start = EnvironmentEdgeManager.currentTime();
    long max = response.getExpectedTimeout();
    long maxPauseTime = max / this.numRetries;
    int tries = 0;
    LOG.debug("Waiting a max of " + max + " ms for snapshot '" + ClientSnapshotDescriptionUtils.toString(snapshot) + "'' to complete. (max " + maxPauseTime + " ms per retry)");
    while (tries == 0 || ((EnvironmentEdgeManager.currentTime() - start) < max && !done.getDone())) {
        try {
            // sleep a backoff <= pauseTime amount
            long sleep = getPauseTime(tries++);
            sleep = sleep > maxPauseTime ? maxPauseTime : sleep;
            LOG.debug("(#" + tries + ") Sleeping: " + sleep + "ms while waiting for snapshot completion.");
            Thread.sleep(sleep);
        } catch (InterruptedException e) {
            throw (InterruptedIOException) new InterruptedIOException("Interrupted").initCause(e);
        }
        LOG.debug("Getting current status of snapshot from master...");
        done = executeCallable(new MasterCallable<IsSnapshotDoneResponse>(getConnection(), getRpcControllerFactory()) {

            @Override
            protected IsSnapshotDoneResponse rpcCall() throws Exception {
                return master.isSnapshotDone(getRpcController(), request);
            }
        });
    }
    if (!done.getDone()) {
        throw new SnapshotCreationException("Snapshot '" + snapshot.getName() + "' wasn't completed in expectedTime:" + max + " ms", snapshotDesc);
    }
}
Also used : InterruptedIOException(java.io.InterruptedIOException) SnapshotResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotResponse) RestoreSnapshotResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RestoreSnapshotResponse) SnapshotCreationException(org.apache.hadoop.hbase.snapshot.SnapshotCreationException) IsSnapshotDoneResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotDoneResponse) IsSnapshotDoneRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotDoneRequest) HBaseProtos(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos)

Example 4 with SnapshotResponse

use of org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotResponse in project hbase by apache.

the class RawAsyncHBaseAdmin method snapshot.

@Override
public CompletableFuture<Void> snapshot(SnapshotDescription snapshotDesc) {
    SnapshotProtos.SnapshotDescription snapshot = ProtobufUtil.createHBaseProtosSnapshotDesc(snapshotDesc);
    try {
        ClientSnapshotDescriptionUtils.assertSnapshotRequestIsValid(snapshot);
    } catch (IllegalArgumentException e) {
        return failedFuture(e);
    }
    CompletableFuture<Void> future = new CompletableFuture<>();
    final SnapshotRequest request = SnapshotRequest.newBuilder().setSnapshot(snapshot).build();
    addListener(this.<Long>newMasterCaller().action((controller, stub) -> this.<SnapshotRequest, SnapshotResponse, Long>call(controller, stub, request, (s, c, req, done) -> s.snapshot(c, req, done), resp -> resp.getExpectedTimeout())).call(), (expectedTimeout, err) -> {
        if (err != null) {
            future.completeExceptionally(err);
            return;
        }
        TimerTask pollingTask = new TimerTask() {

            int tries = 0;

            long startTime = EnvironmentEdgeManager.currentTime();

            long endTime = startTime + expectedTimeout;

            long maxPauseTime = expectedTimeout / maxAttempts;

            @Override
            public void run(Timeout timeout) throws Exception {
                if (EnvironmentEdgeManager.currentTime() < endTime) {
                    addListener(isSnapshotFinished(snapshotDesc), (done, err2) -> {
                        if (err2 != null) {
                            future.completeExceptionally(err2);
                        } else if (done) {
                            future.complete(null);
                        } else {
                            // retry again after pauseTime.
                            long pauseTime = ConnectionUtils.getPauseTime(TimeUnit.NANOSECONDS.toMillis(pauseNs), ++tries);
                            pauseTime = Math.min(pauseTime, maxPauseTime);
                            AsyncConnectionImpl.RETRY_TIMER.newTimeout(this, pauseTime, TimeUnit.MILLISECONDS);
                        }
                    });
                } else {
                    future.completeExceptionally(new SnapshotCreationException("Snapshot '" + snapshot.getName() + "' wasn't completed in expectedTime:" + expectedTimeout + " ms", snapshotDesc));
                }
            }
        };
        AsyncConnectionImpl.RETRY_TIMER.newTimeout(pollingTask, 1, TimeUnit.MILLISECONDS);
    });
    return future;
}
Also used : RegionMetricsBuilder(org.apache.hadoop.hbase.RegionMetricsBuilder) CreateTableResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.CreateTableResponse) RunCleanerChoreRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RunCleanerChoreRequest) MoveServersRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.MoveServersRequest) GetRegionInfoResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse) FutureUtils.unwrapCompletionException(org.apache.hadoop.hbase.util.FutureUtils.unwrapCompletionException) SplitTableRegionResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SplitTableRegionResponse) ClusterMetrics(org.apache.hadoop.hbase.ClusterMetrics) RestoreSnapshotException(org.apache.hadoop.hbase.snapshot.RestoreSnapshotException) IsBalancerEnabledRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsBalancerEnabledRequest) GetQuotaStatesResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse) RSGroupInfo(org.apache.hadoop.hbase.rsgroup.RSGroupInfo) GetNamespaceDescriptorRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetNamespaceDescriptorRequest) CompactionSwitchRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CompactionSwitchRequest) Map(java.util.Map) Configuration(org.apache.hadoop.conf.Configuration) DeserializationException(org.apache.hadoop.hbase.exceptions.DeserializationException) DeleteNamespaceRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteNamespaceRequest) EnumSet(java.util.EnumSet) SetCleanerChoreRunningRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetCleanerChoreRunningRequest) Pair(org.apache.hadoop.hbase.util.Pair) Address(org.apache.hadoop.hbase.net.Address) StopMasterRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.StopMasterRequest) IsNormalizerEnabledResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsNormalizerEnabledResponse) CompactRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CompactRegionRequest) MajorCompactionTimestampForRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MajorCompactionTimestampForRegionRequest) CacheEvictionStats(org.apache.hadoop.hbase.CacheEvictionStats) GetLocksResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetLocksResponse) AddColumnResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.AddColumnResponse) EnableCatalogJanitorRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.EnableCatalogJanitorRequest) ModifyColumnStoreFileTrackerResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyColumnStoreFileTrackerResponse) RpcCallback(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback) DecommissionRegionServersRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DecommissionRegionServersRequest) Stream(java.util.stream.Stream) RegionSpecifierType(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier.RegionSpecifierType) UpdateConfigurationResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateConfigurationResponse) ReplicationPeerDescription(org.apache.hadoop.hbase.replication.ReplicationPeerDescription) NameStringPair(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.NameStringPair) ListTableDescriptorsByNamespaceRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListTableDescriptorsByNamespaceRequest) SnapshotCreationException(org.apache.hadoop.hbase.snapshot.SnapshotCreationException) GetProcedureResultRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetProcedureResultRequest) GrantRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GrantRequest) DeleteTableRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteTableRequest) GetReplicationPeerConfigResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.GetReplicationPeerConfigResponse) Supplier(java.util.function.Supplier) UpdateConfigurationRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateConfigurationRequest) GetNamespaceDescriptorResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetNamespaceDescriptorResponse) GetLocksRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetLocksRequest) DisableTableRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DisableTableRequest) ClearRegionBlockCacheRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearRegionBlockCacheRequest) IsInMaintenanceModeResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsInMaintenanceModeResponse) StopServerResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.StopServerResponse) ListNamespacesRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListNamespacesRequest) GetRSGroupInfoOfServerRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetRSGroupInfoOfServerRequest) DecommissionRegionServersResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DecommissionRegionServersResponse) ShutdownRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ShutdownRequest) NormalizeResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.NormalizeResponse) Option(org.apache.hadoop.hbase.ClusterMetrics.Option) GetUserPermissionsResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GetUserPermissionsResponse) TableName(org.apache.hadoop.hbase.TableName) UpdateReplicationPeerConfigRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.UpdateReplicationPeerConfigRequest) IsInMaintenanceModeRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsInMaintenanceModeRequest) AdminService(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService) IOException(java.io.IOException) AddRSGroupResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.AddRSGroupResponse) RpcChannel(org.apache.hbase.thirdparty.com.google.protobuf.RpcChannel) EnableReplicationPeerRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.EnableReplicationPeerRequest) CompactRegionResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CompactRegionResponse) DeleteColumnRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteColumnRequest) GetConfiguredNamespacesAndTablesInRSGroupResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetConfiguredNamespacesAndTablesInRSGroupResponse) RenameRSGroupResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.RenameRSGroupResponse) TableNotDisabledException(org.apache.hadoop.hbase.TableNotDisabledException) SetQuotaResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaResponse) Nullable(edu.umd.cs.findbugs.annotations.Nullable) IsSnapshotDoneRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotDoneRequest) ListTableNamesByNamespaceResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListTableNamesByNamespaceResponse) ClearDeadServersResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ClearDeadServersResponse) DeleteTableResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteTableResponse) GetProceduresRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetProceduresRequest) GetSpaceQuotaRegionSizesRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest) Message(org.apache.hbase.thirdparty.com.google.protobuf.Message) GetTableDescriptorsResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetTableDescriptorsResponse) DeleteSnapshotResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteSnapshotResponse) ProcedureDescription(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ProcedureDescription) RunCatalogScanResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RunCatalogScanResponse) ListNamespacesResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListNamespacesResponse) GetQuotaStatesRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest) SecurityCapability(org.apache.hadoop.hbase.client.security.SecurityCapability) ReplicationException(org.apache.hadoop.hbase.replication.ReplicationException) BalanceRSGroupRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.BalanceRSGroupRequest) RollWALWriterRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.RollWALWriterRequest) ProtobufUtil(org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil) GetRegionLoadResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionLoadResponse) RenameRSGroupRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.RenameRSGroupRequest) EnableTableRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.EnableTableRequest) TimerTask(org.apache.hbase.thirdparty.io.netty.util.TimerTask) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) RevokeResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.RevokeResponse) ListTablesInRSGroupRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.ListTablesInRSGroupRequest) AddReplicationPeerRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.AddReplicationPeerRequest) ListReplicationPeersRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ListReplicationPeersRequest) Collectors(java.util.stream.Collectors) AbortProcedureResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.AbortProcedureResponse) GetSpaceQuotaRegionSizesResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse) CollectionUtils(org.apache.hbase.thirdparty.org.apache.commons.collections4.CollectionUtils) SetBalancerRunningResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetBalancerRunningResponse) ModifyColumnStoreFileTrackerRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyColumnStoreFileTrackerRequest) ListRSGroupInfosRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.ListRSGroupInfosRequest) UnknownRegionException(org.apache.hadoop.hbase.UnknownRegionException) NormalizeRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.NormalizeRequest) SwitchExceedThrottleQuotaRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SwitchExceedThrottleQuotaRequest) AdminRequestCallerBuilder(org.apache.hadoop.hbase.client.AsyncRpcRetryingCallerFactory.AdminRequestCallerBuilder) IsProcedureDoneRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsProcedureDoneRequest) SetSplitOrMergeEnabledRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetSplitOrMergeEnabledRequest) ListRSGroupInfosResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.ListRSGroupInfosResponse) GetTableDescriptorsRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetTableDescriptorsRequest) SetSnapshotCleanupResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetSnapshotCleanupResponse) CacheEvictionStatsAggregator(org.apache.hadoop.hbase.CacheEvictionStatsAggregator) HasUserPermissionsRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.HasUserPermissionsRequest) AssignRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.AssignRegionRequest) TableNotEnabledException(org.apache.hadoop.hbase.TableNotEnabledException) ListNamespaceDescriptorsResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListNamespaceDescriptorsResponse) AddRSGroupRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.AddRSGroupRequest) CompletableFuture(java.util.concurrent.CompletableFuture) RestoreSnapshotResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RestoreSnapshotResponse) TransitReplicationPeerSyncReplicationStateResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TransitReplicationPeerSyncReplicationStateResponse) SetQuotaRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest) RunCatalogScanRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RunCatalogScanRequest) Function(java.util.function.Function) GetRSGroupInfoOfTableResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetRSGroupInfoOfTableResponse) HConstants(org.apache.hadoop.hbase.HConstants) QuotaTableUtil(org.apache.hadoop.hbase.quotas.QuotaTableUtil) ClearCompactionQueuesRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearCompactionQueuesRequest) GetSpaceQuotaSnapshotsRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaSnapshotsRequest) SnapshotRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotRequest) DisableReplicationPeerRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.DisableReplicationPeerRequest) RemoveServersRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.RemoveServersRequest) MoveRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MoveRegionRequest) Bytes(org.apache.hadoop.hbase.util.Bytes) ListReplicationPeersResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ListReplicationPeersResponse) Logger(org.slf4j.Logger) HBaseProtos(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos) TableExistsException(org.apache.hadoop.hbase.TableExistsException) HashedWheelTimer(org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer) MajorCompactionTimestampRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MajorCompactionTimestampRequest) RemoveReplicationPeerResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.RemoveReplicationPeerResponse) SetNormalizerRunningRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetNormalizerRunningRequest) AccessControlProtos(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos) GetClusterStatusResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetClusterStatusResponse) SecurityCapabilitiesRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SecurityCapabilitiesRequest) MasterRequestCallerBuilder(org.apache.hadoop.hbase.client.AsyncRpcRetryingCallerFactory.MasterRequestCallerBuilder) ListNamespaceDescriptorsRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListNamespaceDescriptorsRequest) RequestConverter(org.apache.hadoop.hbase.shaded.protobuf.RequestConverter) RegionMetrics(org.apache.hadoop.hbase.RegionMetrics) DeleteNamespaceResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteNamespaceResponse) Consumer(java.util.function.Consumer) UpdateRSGroupConfigRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.UpdateRSGroupConfigRequest) MergeTableRegionsRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MergeTableRegionsRequest) InterfaceAudience(org.apache.yetus.audience.InterfaceAudience) GetReplicationPeerConfigRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.GetReplicationPeerConfigRequest) HRegionLocation(org.apache.hadoop.hbase.HRegionLocation) QuotaSettings(org.apache.hadoop.hbase.quotas.QuotaSettings) RecommissionRegionServerRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RecommissionRegionServerRequest) DeleteColumnResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteColumnResponse) ModifyTableStoreFileTrackerResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyTableStoreFileTrackerResponse) UpdateReplicationPeerConfigResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.UpdateReplicationPeerConfigResponse) GetRSGroupInfoResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetRSGroupInfoResponse) CompactionSwitchResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CompactionSwitchResponse) ShadedAccessControlUtil(org.apache.hadoop.hbase.security.access.ShadedAccessControlUtil) RunCleanerChoreResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RunCleanerChoreResponse) Arrays(java.util.Arrays) ExecProcedureResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ExecProcedureResponse) GetClusterStatusRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetClusterStatusRequest) BalanceRSGroupResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.BalanceRSGroupResponse) QuotaFilter(org.apache.hadoop.hbase.quotas.QuotaFilter) HasUserPermissionsResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.HasUserPermissionsResponse) IsCatalogJanitorEnabledRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsCatalogJanitorEnabledRequest) DisableTableResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DisableTableResponse) UpdateRSGroupConfigResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.UpdateRSGroupConfigResponse) MasterProtos(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos) IsBalancerEnabledResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsBalancerEnabledResponse) SplitTableRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SplitTableRegionRequest) ForeignExceptionUtil(org.apache.hadoop.hbase.util.ForeignExceptionUtil) IsCatalogJanitorEnabledResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsCatalogJanitorEnabledResponse) SpaceQuotaSnapshot(org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot) GetOnlineRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetOnlineRegionRequest) FlushRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionRequest) ExecProcedureRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ExecProcedureRequest) Set(java.util.Set) IsNormalizerEnabledRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsNormalizerEnabledRequest) ListTableNamesByNamespaceRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListTableNamesByNamespaceRequest) StopServerRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.StopServerRequest) ModifyTableResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyTableResponse) MoveRegionResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MoveRegionResponse) SetSplitOrMergeEnabledResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetSplitOrMergeEnabledResponse) RegionSizes(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse.RegionSizes) MasterService(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterService) IsRpcThrottleEnabledResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsRpcThrottleEnabledResponse) ClusterMetricsBuilder(org.apache.hadoop.hbase.ClusterMetricsBuilder) RevokeRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.RevokeRequest) GetTableNamesRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetTableNamesRequest) IsProcedureDoneResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsProcedureDoneResponse) IsSplitOrMergeEnabledRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSplitOrMergeEnabledRequest) ModifyTableStoreFileTrackerRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyTableStoreFileTrackerRequest) ClientSnapshotDescriptionUtils(org.apache.hadoop.hbase.snapshot.ClientSnapshotDescriptionUtils) RemoveRSGroupResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.RemoveRSGroupResponse) ListTableDescriptorsByNamespaceResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListTableDescriptorsByNamespaceResponse) AddColumnRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.AddColumnRequest) IsCleanerChoreEnabledRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsCleanerChoreEnabledRequest) RestoreSnapshotRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RestoreSnapshotRequest) ArrayList(java.util.ArrayList) GetConfiguredNamespacesAndTablesInRSGroupRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetConfiguredNamespacesAndTablesInRSGroupRequest) RollWALWriterResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.RollWALWriterResponse) RemoveServersResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.RemoveServersResponse) AddReplicationPeerResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.AddReplicationPeerResponse) SnapshotProtos(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos) UnassignRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.UnassignRegionRequest) BiConsumer(java.util.function.BiConsumer) ClearRegionBlockCacheResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearRegionBlockCacheResponse) ModifyColumnResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyColumnResponse) ServerName(org.apache.hadoop.hbase.ServerName) SwitchRpcThrottleRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SwitchRpcThrottleRequest) ModifyNamespaceResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyNamespaceResponse) SecurityCapabilitiesResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SecurityCapabilitiesResponse) SetNormalizerRunningResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetNormalizerRunningResponse) SyncReplicationState(org.apache.hadoop.hbase.replication.SyncReplicationState) GetProcedureResultResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetProcedureResultResponse) ReplicationPeerConfig(org.apache.hadoop.hbase.replication.ReplicationPeerConfig) FlushRegionResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse) IsSplitOrMergeEnabledResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSplitOrMergeEnabledResponse) ShutdownResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ShutdownResponse) GetCompletedSnapshotsRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetCompletedSnapshotsRequest) TruncateTableResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.TruncateTableResponse) AssignRegionResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.AssignRegionResponse) CatalogFamilyFormat(org.apache.hadoop.hbase.CatalogFamilyFormat) TableNotFoundException(org.apache.hadoop.hbase.TableNotFoundException) FutureUtils.addListener(org.apache.hadoop.hbase.util.FutureUtils.addListener) GetRegionLoadRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionLoadRequest) RegionLocations(org.apache.hadoop.hbase.RegionLocations) LoggerFactory(org.slf4j.LoggerFactory) ServerRequestCallerBuilder(org.apache.hadoop.hbase.client.AsyncRpcRetryingCallerFactory.ServerRequestCallerBuilder) Timeout(org.apache.hbase.thirdparty.io.netty.util.Timeout) GetSpaceQuotaSnapshotsResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaSnapshotsResponse) GetProceduresResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetProceduresResponse) MoveServersResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.MoveServersResponse) TransitReplicationPeerSyncReplicationStateRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TransitReplicationPeerSyncReplicationStateRequest) StopMasterResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.StopMasterResponse) UnassignRegionResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.UnassignRegionResponse) TableCFs(org.apache.hadoop.hbase.client.replication.TableCFs) RemoveRSGroupRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.RemoveRSGroupRequest) EnableReplicationPeerResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.EnableReplicationPeerResponse) CreateNamespaceResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.CreateNamespaceResponse) CreateTableRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.CreateTableRequest) IsCleanerChoreEnabledResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsCleanerChoreEnabledResponse) TruncateTableRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.TruncateTableRequest) IsSnapshotCleanupEnabledResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse) HBaseRpcController(org.apache.hadoop.hbase.ipc.HBaseRpcController) ClearCompactionQueuesResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ClearCompactionQueuesResponse) GetRegionInfoRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoRequest) GetRSGroupInfoOfTableRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetRSGroupInfoOfTableRequest) List(java.util.List) ReplicationPeerConfigUtil(org.apache.hadoop.hbase.client.replication.ReplicationPeerConfigUtil) IsSnapshotDoneResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotDoneResponse) HIGH_QOS(org.apache.hadoop.hbase.HConstants.HIGH_QOS) ModifyNamespaceRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyNamespaceRequest) GetRSGroupInfoOfServerResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetRSGroupInfoOfServerResponse) EnvironmentEdgeManager(org.apache.hadoop.hbase.util.EnvironmentEdgeManager) Optional(java.util.Optional) MergeTableRegionsResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MergeTableRegionsResponse) SetCleanerChoreRunningResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetCleanerChoreRunningResponse) Pattern(java.util.regex.Pattern) META_TABLE_NAME(org.apache.hadoop.hbase.TableName.META_TABLE_NAME) Permission(org.apache.hadoop.hbase.security.access.Permission) EnableCatalogJanitorResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.EnableCatalogJanitorResponse) ModifyColumnRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyColumnRequest) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) EnableTableResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.EnableTableResponse) MajorCompactionTimestampResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MajorCompactionTimestampResponse) GetUserPermissionsRequest(org.apache.hadoop.hbase.security.access.GetUserPermissionsRequest) RecommissionRegionServerResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RecommissionRegionServerResponse) SnapshotResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotResponse) Preconditions(org.apache.hbase.thirdparty.com.google.common.base.Preconditions) GetCompletedSnapshotsResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetCompletedSnapshotsResponse) NamespaceDescriptor(org.apache.hadoop.hbase.NamespaceDescriptor) ListTablesInRSGroupResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.ListTablesInRSGroupResponse) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) ListDecommissionedRegionServersResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListDecommissionedRegionServersResponse) DisableReplicationPeerResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.DisableReplicationPeerResponse) GrantResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GrantResponse) GetRSGroupInfoRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetRSGroupInfoRequest) RemoveReplicationPeerRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.RemoveReplicationPeerRequest) SwitchExceedThrottleQuotaResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SwitchExceedThrottleQuotaResponse) ReadType(org.apache.hadoop.hbase.client.Scan.ReadType) ClearDeadServersRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ClearDeadServersRequest) CreateNamespaceRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.CreateNamespaceRequest) SetBalancerRunningRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetBalancerRunningRequest) TableSchema(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableSchema) AbortProcedureRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.AbortProcedureRequest) DeleteSnapshotRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteSnapshotRequest) ModifyTableRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ModifyTableRequest) UserPermission(org.apache.hadoop.hbase.security.access.UserPermission) IsRpcThrottleEnabledRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsRpcThrottleEnabledRequest) GetTableNamesResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetTableNamesResponse) OfflineRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.OfflineRegionRequest) ClientMetaTableAccessor(org.apache.hadoop.hbase.ClientMetaTableAccessor) OfflineRegionResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.OfflineRegionResponse) TimeUnit(java.util.concurrent.TimeUnit) GetOnlineRegionResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetOnlineRegionResponse) ListDecommissionedRegionServersRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.ListDecommissionedRegionServersRequest) SwitchRpcThrottleResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SwitchRpcThrottleResponse) Collections(java.util.Collections) CompletableFuture(java.util.concurrent.CompletableFuture) TimerTask(org.apache.hbase.thirdparty.io.netty.util.TimerTask) Timeout(org.apache.hbase.thirdparty.io.netty.util.Timeout) SnapshotRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotRequest) RestoreSnapshotRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RestoreSnapshotRequest) DeleteSnapshotRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteSnapshotRequest) SnapshotCreationException(org.apache.hadoop.hbase.snapshot.SnapshotCreationException) SnapshotProtos(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos)

Example 5 with SnapshotResponse

use of org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotResponse in project hbase by apache.

the class TestSnapshotFromAdmin method testValidateSnapshotName.

/**
   * Make sure that we validate the snapshot name and the table name before we pass anything across
   * the wire
   * @throws Exception on failure
   */
@Test
public void testValidateSnapshotName() throws Exception {
    ConnectionImplementation mockConnection = Mockito.mock(ConnectionImplementation.class);
    Configuration conf = HBaseConfiguration.create();
    Mockito.when(mockConnection.getConfiguration()).thenReturn(conf);
    // we need a real retrying caller
    RpcRetryingCallerFactory callerFactory = new RpcRetryingCallerFactory(conf);
    RpcControllerFactory controllerFactory = Mockito.mock(RpcControllerFactory.class);
    Mockito.when(controllerFactory.newController()).thenReturn(Mockito.mock(HBaseRpcController.class));
    Mockito.when(mockConnection.getRpcRetryingCallerFactory()).thenReturn(callerFactory);
    Mockito.when(mockConnection.getRpcControllerFactory()).thenReturn(controllerFactory);
    Admin admin = new HBaseAdmin(mockConnection);
    // check that invalid snapshot names fail
    failSnapshotStart(admin, new SnapshotDescription(HConstants.SNAPSHOT_DIR_NAME));
    failSnapshotStart(admin, new SnapshotDescription("-snapshot"));
    failSnapshotStart(admin, new SnapshotDescription("snapshot fails"));
    failSnapshotStart(admin, new SnapshotDescription("snap$hot"));
    failSnapshotStart(admin, new SnapshotDescription("snap:hot"));
    // check the table name also get verified
    failSnapshotDescriptorCreation("snapshot", ".table");
    failSnapshotDescriptorCreation("snapshot", "-table");
    failSnapshotDescriptorCreation("snapshot", "table fails");
    failSnapshotDescriptorCreation("snapshot", "tab%le");
    // mock the master connection
    MasterKeepAliveConnection master = Mockito.mock(MasterKeepAliveConnection.class);
    Mockito.when(mockConnection.getKeepAliveMasterService()).thenReturn(master);
    SnapshotResponse response = SnapshotResponse.newBuilder().setExpectedTimeout(0).build();
    Mockito.when(master.snapshot((RpcController) Mockito.any(), Mockito.any(SnapshotRequest.class))).thenReturn(response);
    IsSnapshotDoneResponse doneResponse = IsSnapshotDoneResponse.newBuilder().setDone(true).build();
    Mockito.when(master.isSnapshotDone((RpcController) Mockito.any(), Mockito.any(IsSnapshotDoneRequest.class))).thenReturn(doneResponse);
    // make sure that we can use valid names
    admin.snapshot(new SnapshotDescription("snapshot", TableName.valueOf(name.getMethodName())));
}
Also used : HBaseConfiguration(org.apache.hadoop.hbase.HBaseConfiguration) Configuration(org.apache.hadoop.conf.Configuration) RpcControllerFactory(org.apache.hadoop.hbase.ipc.RpcControllerFactory) HBaseRpcController(org.apache.hadoop.hbase.ipc.HBaseRpcController) SnapshotResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotResponse) SnapshotRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotRequest) IsSnapshotDoneResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotDoneResponse) IsSnapshotDoneRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotDoneRequest) Test(org.junit.Test)

Aggregations

SnapshotResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotResponse)5 IsSnapshotDoneRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotDoneRequest)4 IsSnapshotDoneResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotDoneResponse)4 SnapshotRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SnapshotRequest)4 Configuration (org.apache.hadoop.conf.Configuration)3 HBaseRpcController (org.apache.hadoop.hbase.ipc.HBaseRpcController)3 RestoreSnapshotResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RestoreSnapshotResponse)3 SnapshotCreationException (org.apache.hadoop.hbase.snapshot.SnapshotCreationException)3 IOException (java.io.IOException)2 InterruptedIOException (java.io.InterruptedIOException)2 TableExistsException (org.apache.hadoop.hbase.TableExistsException)2 TableName (org.apache.hadoop.hbase.TableName)2 TableNotDisabledException (org.apache.hadoop.hbase.TableNotDisabledException)2 TableNotFoundException (org.apache.hadoop.hbase.TableNotFoundException)2 UnknownRegionException (org.apache.hadoop.hbase.UnknownRegionException)2 ReplicationException (org.apache.hadoop.hbase.replication.ReplicationException)2 HBaseProtos (org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos)2 DeleteSnapshotRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteSnapshotRequest)2 RestoreSnapshotRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RestoreSnapshotRequest)2 RestoreSnapshotException (org.apache.hadoop.hbase.snapshot.RestoreSnapshotException)2