Class MasterClusterInfoProvider
java.lang.Object
org.apache.hadoop.hbase.master.balancer.MasterClusterInfoProvider
- All Implemented Interfaces:
ConfigurationObserver,ClusterInfoProvider
Master based cluster info provider.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate NamedQueueRecorderUse to add balancer decision history to ring-bufferprivate OffPeakHoursprivate final MasterServices -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomputeHDFSBlocksDistribution(org.apache.hadoop.conf.Configuration conf, TableDescriptor tableDescriptor, RegionInfo regionInfo) Compute the block distribution for the given region.Get all the regions of this cluster.org.apache.hadoop.conf.ConfigurationGet the configuration.Returns a reference to the cluster's connection.getLoad(ServerName serverName) Returns server metrics of the given server if serverName is known else null(package private) NamedQueueRecorderintReturns the number of tables on this cluster.Returns a copy of the internal list of online servers.getOnlineServersListWithPredicator(List<ServerName> servers, Predicate<ServerMetrics> filter) Returns a copy of the internal list of online servers matched by the givenfilter.getSnapShotOfAssignment(Collection<RegionInfo> regions) Get a snapshot of the current assignment status.getTableDescriptor(TableName tableName) Get the table descriptor for the given table.booleanhasRegionReplica(Collection<RegionInfo> regions) Check whether we have region replicas enabled for the tables of the given regions.booleanTest whether we are in off peak hour.private voidloadConf(org.apache.hadoop.conf.Configuration conf) voidonConfigurationChange(org.apache.hadoop.conf.Configuration conf) This method would be called by theConfigurationManagerobject when theConfigurationobject is reloaded from disk.voidrecordBalancerDecision(Supplier<BalancerDecision> decision) Record the given balancer decision.voidrecordBalancerRejection(Supplier<BalancerRejection> rejection) Record the given balancer rejection.voidunassign(RegionInfo regionInfo) Unassign the given region.
-
Field Details
-
services
-
isBalancerDecisionRecording
-
isBalancerRejectionRecording
-
namedQueueRecorder
Use to add balancer decision history to ring-buffer -
offPeakHours
-
-
Constructor Details
-
MasterClusterInfoProvider
-
-
Method Details
-
loadConf
-
getConfiguration
Description copied from interface:ClusterInfoProviderGet the configuration.- Specified by:
getConfigurationin interfaceClusterInfoProvider
-
getConnection
Description copied from interface:ClusterInfoProviderReturns a reference to the cluster's connection.- Specified by:
getConnectionin interfaceClusterInfoProvider
-
getAssignedRegions
Description copied from interface:ClusterInfoProviderGet all the regions of this cluster. Used to refresh region block locations on HDFS.- Specified by:
getAssignedRegionsin interfaceClusterInfoProvider
-
unassign
Description copied from interface:ClusterInfoProviderUnassign the given region.- Specified by:
unassignin interfaceClusterInfoProvider- Throws:
IOException
-
getTableDescriptor
Description copied from interface:ClusterInfoProviderGet the table descriptor for the given table.- Specified by:
getTableDescriptorin interfaceClusterInfoProvider- Throws:
IOException
-
computeHDFSBlocksDistribution
public HDFSBlocksDistribution computeHDFSBlocksDistribution(org.apache.hadoop.conf.Configuration conf, TableDescriptor tableDescriptor, RegionInfo regionInfo) throws IOException Description copied from interface:ClusterInfoProviderCompute the block distribution for the given region. Used to refresh region block locations on HDFS.- Specified by:
computeHDFSBlocksDistributionin interfaceClusterInfoProvider- Throws:
IOException
-
hasRegionReplica
Description copied from interface:ClusterInfoProviderCheck whether we have region replicas enabled for the tables of the given regions.- Specified by:
hasRegionReplicain interfaceClusterInfoProvider- Throws:
IOException
-
getOnlineServersList
Description copied from interface:ClusterInfoProviderReturns a copy of the internal list of online servers.- Specified by:
getOnlineServersListin interfaceClusterInfoProvider
-
getOnlineServersListWithPredicator
public List<ServerName> getOnlineServersListWithPredicator(List<ServerName> servers, Predicate<ServerMetrics> filter) Description copied from interface:ClusterInfoProviderReturns a copy of the internal list of online servers matched by the givenfilter.- Specified by:
getOnlineServersListWithPredicatorin interfaceClusterInfoProvider
-
getSnapShotOfAssignment
Description copied from interface:ClusterInfoProviderGet a snapshot of the current assignment status.- Specified by:
getSnapShotOfAssignmentin interfaceClusterInfoProvider
-
getNumberOfTables
Description copied from interface:ClusterInfoProviderReturns the number of tables on this cluster.- Specified by:
getNumberOfTablesin interfaceClusterInfoProvider- Throws:
IOException
-
isOffPeakHour
Description copied from interface:ClusterInfoProviderTest whether we are in off peak hour. For peak and off peak hours we may have different cost for the same balancing operation.- Specified by:
isOffPeakHourin interfaceClusterInfoProvider
-
onConfigurationChange
Description copied from interface:ConfigurationObserverThis method would be called by theConfigurationManagerobject when theConfigurationobject is reloaded from disk.- Specified by:
onConfigurationChangein interfaceConfigurationObserver
-
recordBalancerDecision
Description copied from interface:ClusterInfoProviderRecord the given balancer decision.- Specified by:
recordBalancerDecisionin interfaceClusterInfoProvider
-
recordBalancerRejection
Description copied from interface:ClusterInfoProviderRecord the given balancer rejection.- Specified by:
recordBalancerRejectionin interfaceClusterInfoProvider
-
getLoad
Description copied from interface:ClusterInfoProviderReturns server metrics of the given server if serverName is known else null- Specified by:
getLoadin interfaceClusterInfoProvider
-
getNamedQueueRecorder
-