Interface BalancerEnvironment
- All Superinterfaces:
PluginEnvironment
,ServiceEnvironment
This interface is an extension of
ServiceEnvironment
that exposes system level
information that is specific to tablet balancing.- Since:
- 2.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.accumulo.core.spi.common.ServiceEnvironment
ServiceEnvironment.Configuration
-
Method Summary
Modifier and TypeMethodDescriptionMany Accumulo plugins are given table IDs as this is what Accumulo uses internally to identify tables.boolean
isTableOnline
(TableId tableId) Accumulo plugins working with a table may need to know if the table is online or not before operating on it.listOnlineTabletsForTable
(TabletServerId tabletServerId, TableId tableId) Fetch the tablets for the given table by asking the tablet server.listTabletLocations
(TableId tableId) Fetch the locations for each oftableId
's tablets from the metadata table.tableContext
(TableId tableId) Retrieve the classloader context that is configured fortableId
, ornull
if none is configured.Methods inherited from interface org.apache.accumulo.core.client.PluginEnvironment
getTableName, instantiate, instantiate
Methods inherited from interface org.apache.accumulo.core.spi.common.ServiceEnvironment
getConfiguration, getConfiguration
-
Method Details
-
getTableIdMap
Many Accumulo plugins are given table IDs as this is what Accumulo uses internally to identify tables. This provides a mapping of table names to table IDs for the purposes of translating and/or enumerating the existing tables. -
isTableOnline
Accumulo plugins working with a table may need to know if the table is online or not before operating on it.- Parameters:
tableId
- The id of the table to check.- Returns:
true
if the table is online andfalse
if not
-
listTabletLocations
Fetch the locations for each oftableId
's tablets from the metadata table. If there is no location available for a given tablet, then the returned mapping will have anull
value stored for the tablet id.- Parameters:
tableId
- The id of the table for which to retrieve tablets.- Returns:
- a mapping of
TabletId
toTabletServerId
(or @null if no location is available) for each tablet belonging totableId
-
listOnlineTabletsForTable
List<TabletStatistics> listOnlineTabletsForTable(TabletServerId tabletServerId, TableId tableId) throws AccumuloException, AccumuloSecurityException Fetch the tablets for the given table by asking the tablet server. Useful if your balance strategy needs details at the tablet level to decide what tablets to move.- Parameters:
tabletServerId
- The tablet server to ask.tableId
- The table id- Returns:
- a list of tablet statistics
- Throws:
AccumuloSecurityException
- tablet server disapproves of your internal System password.AccumuloException
- any other problem
-
tableContext
Retrieve the classloader context that is configured fortableId
, ornull
if none is configured.
-