Class RouterAdminProtocolTranslatorPB
java.lang.Object
org.apache.hadoop.hdfs.protocolPB.RouterAdminProtocolTranslatorPB
- All Implemented Interfaces:
Closeable,AutoCloseable,MountTableManager,RouterGenericManager,NameserviceManager,RouterStateManager,org.apache.hadoop.ipc.ProtocolMetaInterface,org.apache.hadoop.ipc.ProtocolTranslator
@Private
@Stable
public class RouterAdminProtocolTranslatorPB
extends Object
implements org.apache.hadoop.ipc.ProtocolMetaInterface, MountTableManager, Closeable, org.apache.hadoop.ipc.ProtocolTranslator, RouterStateManager, NameserviceManager, RouterGenericManager
This class forwards RouterAdminProtocol calls as RPC calls to the RouterAdmin server
while translating from the parameter types used in RouterAdminProtocol to the
new PB types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd multiple entries to the mount table.Add an entry to the mount table.voidclose()Disable a name service.Enable a name service.enterSafeMode(EnterSafeModeRequest request) Enter safe mode and change Router state to RouterServiceState#SAFEMODE.getDestination(GetDestinationRequest request) Get the destination subcluster (namespace) of a file/directory.Get the list of disabled name service.List all mount table entries present at or below the path.getSafeMode(GetSafeModeRequest request) Verify if current Router state is safe mode.booleanisMethodSupported(String methodName) leaveSafeMode(LeaveSafeModeRequest request) Leave safe mode and change Router state to RouterServiceState#RUNNING.Refresh mount table entries cache from the state store.booleanRefresh superuser proxy groups mappings (used in RBF).Remove an entry from the mount table.Updates an existing entry in the mount table.
-
Constructor Details
-
RouterAdminProtocolTranslatorPB
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getUnderlyingProxyObject
- Specified by:
getUnderlyingProxyObjectin interfaceorg.apache.hadoop.ipc.ProtocolTranslator
-
isMethodSupported
- Specified by:
isMethodSupportedin interfaceorg.apache.hadoop.ipc.ProtocolMetaInterface- Throws:
IOException
-
addMountTableEntry
public AddMountTableEntryResponse addMountTableEntry(AddMountTableEntryRequest request) throws IOException Description copied from interface:MountTableManagerAdd an entry to the mount table.- Specified by:
addMountTableEntryin interfaceMountTableManager- Parameters:
request- Fully populated request object.- Returns:
- True if the mount table entry was successfully committed to the data store.
- Throws:
IOException- Throws exception if the data store is not initialized.
-
addMountTableEntries
public AddMountTableEntriesResponse addMountTableEntries(AddMountTableEntriesRequest request) throws IOException Description copied from interface:MountTableManagerAdd multiple entries to the mount table.- Specified by:
addMountTableEntriesin interfaceMountTableManager- Parameters:
request- Request object with fully populated list of mount point entries.- Returns:
- True if all the mount table entries were successfully committed to the data store.
- Throws:
IOException- Throws exception if the data store is not initialized.
-
updateMountTableEntry
public UpdateMountTableEntryResponse updateMountTableEntry(UpdateMountTableEntryRequest request) throws IOException Description copied from interface:MountTableManagerUpdates an existing entry in the mount table.- Specified by:
updateMountTableEntryin interfaceMountTableManager- Parameters:
request- Fully populated request object.- Returns:
- True if the mount table entry was successfully committed to the data store.
- Throws:
IOException- Throws exception if the data store is not initialized.
-
removeMountTableEntry
public RemoveMountTableEntryResponse removeMountTableEntry(RemoveMountTableEntryRequest request) throws IOException Description copied from interface:MountTableManagerRemove an entry from the mount table.- Specified by:
removeMountTableEntryin interfaceMountTableManager- Parameters:
request- Fully populated request object.- Returns:
- True the mount table entry was removed from the data store.
- Throws:
IOException- Throws exception if the data store is not initialized.
-
getMountTableEntries
public GetMountTableEntriesResponse getMountTableEntries(GetMountTableEntriesRequest request) throws IOException Description copied from interface:MountTableManagerList all mount table entries present at or below the path. Fetches from the state store.- Specified by:
getMountTableEntriesin interfaceMountTableManager- Parameters:
request- Fully populated request object.- Returns:
- List of all mount table entries under the path. Zero-length list if none are found.
- Throws:
IOException- Throws exception if the data store cannot be queried.
-
enterSafeMode
Description copied from interface:RouterStateManagerEnter safe mode and change Router state to RouterServiceState#SAFEMODE.- Specified by:
enterSafeModein interfaceRouterStateManager- Parameters:
request- Request to enter safe mode.- Returns:
- Response to enter safe mode.
- Throws:
IOException- If it cannot perform the operation.
-
leaveSafeMode
Description copied from interface:RouterStateManagerLeave safe mode and change Router state to RouterServiceState#RUNNING.- Specified by:
leaveSafeModein interfaceRouterStateManager- Parameters:
request- Request to leave safe mode.- Returns:
- Response to leave safe mode.
- Throws:
IOException- If it cannot perform the operation.
-
getSafeMode
Description copied from interface:RouterStateManagerVerify if current Router state is safe mode.- Specified by:
getSafeModein interfaceRouterStateManager- Parameters:
request- Request to get the safe mode state.- Returns:
- Response to get the safe mode state.
- Throws:
IOException- If it cannot perform the operation.
-
disableNameservice
public DisableNameserviceResponse disableNameservice(DisableNameserviceRequest request) throws IOException Description copied from interface:NameserviceManagerDisable a name service.- Specified by:
disableNameservicein interfaceNameserviceManager- Parameters:
request- Request to disable a name service.- Returns:
- Response to disable a name service.
- Throws:
IOException- If it cannot perform the operation.
-
enableNameservice
public EnableNameserviceResponse enableNameservice(EnableNameserviceRequest request) throws IOException Description copied from interface:NameserviceManagerEnable a name service.- Specified by:
enableNameservicein interfaceNameserviceManager- Parameters:
request- Request to enable a name service.- Returns:
- Response to disable a name service.
- Throws:
IOException- If it cannot perform the operation.
-
getDisabledNameservices
public GetDisabledNameservicesResponse getDisabledNameservices(GetDisabledNameservicesRequest request) throws IOException Description copied from interface:NameserviceManagerGet the list of disabled name service.- Specified by:
getDisabledNameservicesin interfaceNameserviceManager- Parameters:
request- Request to get the disabled name services.- Returns:
- Response to get the disabled name services.
- Throws:
IOException- If it cannot perform the operation.
-
refreshMountTableEntries
public RefreshMountTableEntriesResponse refreshMountTableEntries(RefreshMountTableEntriesRequest request) throws IOException Description copied from interface:MountTableManagerRefresh mount table entries cache from the state store. Cache is updated periodically but with this API cache can be refreshed immediately. This API is primarily meant to be called from the Admin Server. Admin Server will call this API and refresh mount table cache of all the routers while changing mount table entries.- Specified by:
refreshMountTableEntriesin interfaceMountTableManager- Parameters:
request- Fully populated request object.- Returns:
- True the mount table entry was updated without any error.
- Throws:
IOException- Throws exception if the data store is not initialized.
-
getDestination
Description copied from interface:MountTableManagerGet the destination subcluster (namespace) of a file/directory.- Specified by:
getDestinationin interfaceMountTableManager- Parameters:
request- Fully populated request object including the file to check.- Returns:
- The response including the subcluster where the input file is.
- Throws:
IOException- Throws exception if the data store is not initialized.
-
refreshSuperUserGroupsConfiguration
Description copied from interface:RouterGenericManagerRefresh superuser proxy groups mappings (used in RBF).- Specified by:
refreshSuperUserGroupsConfigurationin interfaceRouterGenericManager- Returns:
- true if the operation was successful.
- Throws:
IOException- if operation was not successful.
-