MembershipStoreImpl (Apache Hadoop HDFS-RBF 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.federation.store.impl, class: MembershipStoreImpl

Package org.apache.hadoop.hdfs.server.federation.store.impl

# Class MembershipStoreImpl

java.lang.Object
org.apache.hadoop.hdfs.server.federation.store.RecordStore<R>
org.apache.hadoop.hdfs.server.federation.store.CachedRecordStore<MembershipState>
org.apache.hadoop.hdfs.server.federation.store.MembershipStore
org.apache.hadoop.hdfs.server.federation.store.impl.MembershipStoreImpl

All Implemented Interfaces:
  `StateStoreCache`

@Private @Evolving public class MembershipStoreImpl extends MembershipStore implements StateStoreCache
Implementation of the `MembershipStore` State Store API.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MembershipStoreImpl(StateStoreDriver driver)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `GetNamenodeRegistrationsResponse`
  `getExpiredNamenodeRegistrations(GetNamenodeRegistrationsRequest request)`
  Get the expired registrations from the registration cache.
  `GetNamenodeRegistrationsResponse`
  `getNamenodeRegistrations(GetNamenodeRegistrationsRequest request)`
  Queries for a single cached registration entry matching the given parameters.
  `GetNamespaceInfoResponse`
  `getNamespaceInfo(GetNamespaceInfoRequest request)`
  Retrieves a list of registered nameservices and their associated info.
  `boolean`
  `loadCache(boolean force)`
  Load the cache from the State Store.
  `NamenodeHeartbeatResponse`
  `namenodeHeartbeat(NamenodeHeartbeatRequest request)`
  Inserts or updates a namenode membership entry into the table.
  `UpdateNamenodeRegistrationResponse`
  `updateNamenodeRegistration(UpdateNamenodeRegistrationRequest request)`
  Overrides a cached namenode state with an updated state.

  ### Methods inherited from class org.apache.hadoop.hdfs.server.federation.store.CachedRecordStore

  `getCachedRecords, getCachedRecordsAndTimeStamp, overrideExpiredRecord, overrideExpiredRecords`

  ### Methods inherited from class org.apache.hadoop.hdfs.server.federation.store.RecordStore

  `getDriver, getRecordClass, newInstance`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MembershipStoreImpl

    public MembershipStoreImpl(StateStoreDriver driver)

- ## Method Details

  - ### getExpiredNamenodeRegistrations

    public GetNamenodeRegistrationsResponse getExpiredNamenodeRegistrations(GetNamenodeRegistrationsRequest request) throws IOException
    Description copied from class: `MembershipStore`
    Get the expired registrations from the registration cache.
    Specified by:
      `getExpiredNamenodeRegistrations` in class `MembershipStore`
    Parameters:
      `request` - Request to get the expired registrations.
    Returns:
      Expired registrations or zero-length list if none are found.
    Throws:
      `StateStoreUnavailableException` - Throws exception if the data store is not initialized.
      `IOException` - if the data store could not be queried or the query is invalid.

  - ### getNamespaceInfo

    public GetNamespaceInfoResponse getNamespaceInfo(GetNamespaceInfoRequest request) throws IOException
    Description copied from class: `MembershipStore`
    Retrieves a list of registered nameservices and their associated info.
    Specified by:
      `getNamespaceInfo` in class `MembershipStore`
    Parameters:
      `request` - Request to get the name spaces.
    Returns:
      Collection of information for each registered nameservice.
    Throws:
      `IOException` - if the data store could not be queried or the query is invalid.

  - ### getNamenodeRegistrations

    public GetNamenodeRegistrationsResponse getNamenodeRegistrations(GetNamenodeRegistrationsRequest request) throws IOException
    Description copied from class: `MembershipStore`
    Queries for a single cached registration entry matching the given parameters. Possible keys are the names of data structure elements Possible values are matching SQL "LIKE" targets.
    Specified by:
      `getNamenodeRegistrations` in class `MembershipStore`
    Parameters:
      `request` - Fully populated GetNamenodeRegistrationsRequest request.
    Returns:
      Single matching FederationMembershipStateEntry or null if not found or more than one entry matches.
    Throws:
      `StateStoreUnavailableException` - Throws exception if the data store is not initialized.
      `IOException` - if the data store could not be queried or the query is invalid.

  - ### namenodeHeartbeat

    public NamenodeHeartbeatResponse namenodeHeartbeat(NamenodeHeartbeatRequest request) throws IOException
    Description copied from class: `MembershipStore`
    Inserts or updates a namenode membership entry into the table.
    Specified by:
      `namenodeHeartbeat` in class `MembershipStore`
    Parameters:
      `request` - Fully populated NamenodeHeartbeatRequest request.
    Returns:
      True if successful, false otherwise.
    Throws:
      `StateStoreUnavailableException` - Throws exception if the data store is not initialized.
      `IOException` - if the data store could not be queried or the query is invalid.

  - ### loadCache

    public boolean loadCache(boolean force) throws IOException
    Description copied from interface: `StateStoreCache`
    Load the cache from the State Store. Called by the cache update service when the data has been reloaded.
    Specified by:
      `loadCache` in interface `StateStoreCache`
    Overrides:
      `loadCache` in class `CachedRecordStore<MembershipState>`
    Parameters:
      `force` - If we force the load.
    Returns:
      If the cache was loaded successfully.
    Throws:
      `IOException` - If there was an error loading the cache.

  - ### updateNamenodeRegistration

    public UpdateNamenodeRegistrationResponse updateNamenodeRegistration(UpdateNamenodeRegistrationRequest request) throws IOException
    Description copied from class: `MembershipStore`
    Overrides a cached namenode state with an updated state.
    Specified by:
      `updateNamenodeRegistration` in class `MembershipStore`
    Parameters:
      `request` - Fully populated OverrideNamenodeRegistrationRequest request.
    Returns:
      OverrideNamenodeRegistrationResponse
    Throws:
      `StateStoreUnavailableException` - if the data store is not initialized.
      `IOException` - if the data store could not be queried or the query is invalid.