Interface BalancerEnvironment

All Superinterfaces:
PluginEnvironment, ServiceEnvironment

public interface BalancerEnvironment extends ServiceEnvironment
This interface is an extension of ServiceEnvironment that exposes system level information that is specific to tablet balancing.
Since:
2.1.0
  • Method Details

    • getTableIdMap

      Map<String,TableId> 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

      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.
      Parameters:
      tableId - The id of the table to check.
      Returns:
      true if the table is online and false if not
    • listTabletLocations

      Map<TabletId,TabletServerId> listTabletLocations(TableId tableId)
      Fetch the locations for each of tableId's tablets from the metadata table. If there is no location available for a given tablet, then the returned mapping will have a null value stored for the tablet id.
      Parameters:
      tableId - The id of the table for which to retrieve tablets.
      Returns:
      a mapping of TabletId to TabletServerId (or @null if no location is available) for each tablet belonging to tableId
    • 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

      String tableContext(TableId tableId)
      Retrieve the classloader context that is configured for tableId, or null if none is configured.