Search in sources :

Example 1 with CacheEvictionStats

use of org.apache.hadoop.hbase.CacheEvictionStats in project hbase by apache.

the class RawAsyncHBaseAdmin method clearBlockCache.

@Override
public CompletableFuture<CacheEvictionStats> clearBlockCache(TableName tableName) {
    CompletableFuture<CacheEvictionStats> future = new CompletableFuture<>();
    addListener(getTableHRegionLocations(tableName), (locations, err) -> {
        if (err != null) {
            future.completeExceptionally(err);
            return;
        }
        Map<ServerName, List<RegionInfo>> regionInfoByServerName = locations.stream().filter(l -> l.getRegion() != null).filter(l -> !l.getRegion().isOffline()).filter(l -> l.getServerName() != null).collect(Collectors.groupingBy(l -> l.getServerName(), Collectors.mapping(l -> l.getRegion(), Collectors.toList())));
        List<CompletableFuture<CacheEvictionStats>> futures = new ArrayList<>();
        CacheEvictionStatsAggregator aggregator = new CacheEvictionStatsAggregator();
        for (Map.Entry<ServerName, List<RegionInfo>> entry : regionInfoByServerName.entrySet()) {
            futures.add(clearBlockCache(entry.getKey(), entry.getValue()).whenComplete((stats, err2) -> {
                if (err2 != null) {
                    future.completeExceptionally(unwrapCompletionException(err2));
                } else {
                    aggregator.append(stats);
                }
            }));
        }
        addListener(CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])), (ret, err3) -> {
            if (err3 != null) {
                future.completeExceptionally(unwrapCompletionException(err3));
            } else {
                future.complete(aggregator.sum());
            }
        });
    });
    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) CacheEvictionStats(org.apache.hadoop.hbase.CacheEvictionStats) ServerName(org.apache.hadoop.hbase.ServerName) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) CacheEvictionStatsAggregator(org.apache.hadoop.hbase.CacheEvictionStatsAggregator) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap)

Example 2 with CacheEvictionStats

use of org.apache.hadoop.hbase.CacheEvictionStats in project hbase by apache.

the class TestClearRegionBlockCache method testClearBlockCacheFromAdmin.

@Test
public void testClearBlockCacheFromAdmin() throws Exception {
    Admin admin = HTU.getAdmin();
    BlockCache blockCache1 = rs1.getBlockCache().get();
    BlockCache blockCache2 = rs2.getBlockCache().get();
    long initialBlockCount1 = blockCache1.getBlockCount();
    long initialBlockCount2 = blockCache2.getBlockCount();
    // scan will cause blocks to be added in BlockCache
    scanAllRegionsForRS(rs1);
    assertEquals(blockCache1.getBlockCount() - initialBlockCount1, HTU.getNumHFilesForRS(rs1, TABLE_NAME, FAMILY));
    scanAllRegionsForRS(rs2);
    assertEquals(blockCache2.getBlockCount() - initialBlockCount2, HTU.getNumHFilesForRS(rs2, TABLE_NAME, FAMILY));
    CacheEvictionStats stats = admin.clearBlockCache(TABLE_NAME);
    assertEquals(stats.getEvictedBlocks(), HTU.getNumHFilesForRS(rs1, TABLE_NAME, FAMILY) + HTU.getNumHFilesForRS(rs2, TABLE_NAME, FAMILY));
    assertEquals(initialBlockCount1, blockCache1.getBlockCount());
    assertEquals(initialBlockCount2, blockCache2.getBlockCount());
}
Also used : CacheEvictionStats(org.apache.hadoop.hbase.CacheEvictionStats) BlockCache(org.apache.hadoop.hbase.io.hfile.BlockCache) AsyncAdmin(org.apache.hadoop.hbase.client.AsyncAdmin) Admin(org.apache.hadoop.hbase.client.Admin) Test(org.junit.Test)

Example 3 with CacheEvictionStats

use of org.apache.hadoop.hbase.CacheEvictionStats in project hbase by apache.

the class TestClearRegionBlockCache method testClearBlockCacheFromAsyncAdmin.

@Test
public void testClearBlockCacheFromAsyncAdmin() throws Exception {
    try (AsyncConnection conn = ConnectionFactory.createAsyncConnection(HTU.getConfiguration()).get()) {
        AsyncAdmin admin = conn.getAdmin();
        BlockCache blockCache1 = rs1.getBlockCache().get();
        BlockCache blockCache2 = rs2.getBlockCache().get();
        long initialBlockCount1 = blockCache1.getBlockCount();
        long initialBlockCount2 = blockCache2.getBlockCount();
        // scan will cause blocks to be added in BlockCache
        scanAllRegionsForRS(rs1);
        assertEquals(blockCache1.getBlockCount() - initialBlockCount1, HTU.getNumHFilesForRS(rs1, TABLE_NAME, FAMILY));
        scanAllRegionsForRS(rs2);
        assertEquals(blockCache2.getBlockCount() - initialBlockCount2, HTU.getNumHFilesForRS(rs2, TABLE_NAME, FAMILY));
        CacheEvictionStats stats = admin.clearBlockCache(TABLE_NAME).get();
        assertEquals(stats.getEvictedBlocks(), HTU.getNumHFilesForRS(rs1, TABLE_NAME, FAMILY) + HTU.getNumHFilesForRS(rs2, TABLE_NAME, FAMILY));
        assertEquals(initialBlockCount1, blockCache1.getBlockCount());
        assertEquals(initialBlockCount2, blockCache2.getBlockCount());
    }
}
Also used : AsyncAdmin(org.apache.hadoop.hbase.client.AsyncAdmin) CacheEvictionStats(org.apache.hadoop.hbase.CacheEvictionStats) AsyncConnection(org.apache.hadoop.hbase.client.AsyncConnection) BlockCache(org.apache.hadoop.hbase.io.hfile.BlockCache) Test(org.junit.Test)

Aggregations

CacheEvictionStats (org.apache.hadoop.hbase.CacheEvictionStats)3 AsyncAdmin (org.apache.hadoop.hbase.client.AsyncAdmin)2 BlockCache (org.apache.hadoop.hbase.io.hfile.BlockCache)2 Test (org.junit.Test)2 Nullable (edu.umd.cs.findbugs.annotations.Nullable)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 EnumSet (java.util.EnumSet)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Set (java.util.Set)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)1 TimeUnit (java.util.concurrent.TimeUnit)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1