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 -
Method Summary
Modifier and TypeMethodDescriptionGet the expired registrations from the registration cache.Queries for a single cached registration entry matching the given parameters.getNamespaceInfo(GetNamespaceInfoRequest request) Retrieves a list of registered nameservices and their associated info.booleanloadCache(boolean force) Load the cache from the State Store.Inserts or updates a namenode membership entry into the table.Overrides a cached namenode state with an updated state.Methods inherited from class org.apache.hadoop.hdfs.server.federation.store.CachedRecordStore
getCachedRecords, getCachedRecordsAndTimeStamp, overrideExpiredRecord, overrideExpiredRecordsMethods inherited from class org.apache.hadoop.hdfs.server.federation.store.RecordStore
getDriver, getRecordClass, newInstance
-
Constructor Details
-
MembershipStoreImpl
-
-
Method Details
-
getExpiredNamenodeRegistrations
public GetNamenodeRegistrationsResponse getExpiredNamenodeRegistrations(GetNamenodeRegistrationsRequest request) throws IOException Description copied from class:MembershipStoreGet the expired registrations from the registration cache.- Specified by:
getExpiredNamenodeRegistrationsin classMembershipStore- 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:MembershipStoreRetrieves a list of registered nameservices and their associated info.- Specified by:
getNamespaceInfoin classMembershipStore- 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:MembershipStoreQueries 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:
getNamenodeRegistrationsin classMembershipStore- 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:MembershipStoreInserts or updates a namenode membership entry into the table.- Specified by:
namenodeHeartbeatin classMembershipStore- 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
Description copied from interface:StateStoreCacheLoad the cache from the State Store. Called by the cache update service when the data has been reloaded.- Specified by:
loadCachein interfaceStateStoreCache- Overrides:
loadCachein classCachedRecordStore<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:MembershipStoreOverrides a cached namenode state with an updated state.- Specified by:
updateNamenodeRegistrationin classMembershipStore- 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.
-