@ThreadSafe public class ManagerProcessContext extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
ManagerProcessContext(AlluxioConfiguration conf)
Creates a new instance of
ManagerProcessContext . |
Modifier and Type | Method and Description |
---|---|
void |
agentHearbeat(AgentHeartbeatRequest req)
Register agent with hosted Hub.
|
void |
alluxioClusterHeartbeat(AlluxioCluster cluster)
Sends an Alluxio cluster heartbeat to the Hosted Hub.
|
ApplyMountPointResponse.Payload |
applyMount(ApplyMountPointRequest req)
Apply mount hdfs command.
|
void |
close() |
AlluxioConfigurationSet |
configurationSetFor(AlluxioNodeType type)
Gets the configuration for a given alluxio node type.
|
DeleteMountPointResponse.Payload |
deleteMount(MountPointInfo mountPointInfo)
Remove mount point.
|
<T> Map<HubNodeAddress,T> |
execOnHub(java.util.function.Function<AgentManagerServiceGrpc.AgentManagerServiceBlockingStub,T> action)
Execute a function across all Hub agents.
|
<T> Map<HubNodeAddress,T> |
execOnHub(java.util.function.Function<AgentManagerServiceGrpc.AgentManagerServiceBlockingStub,T> action,
AlluxioNodeType type)
Execute a function across a set of Alluxio nodes on the cluster.
|
<T> Map<HubNodeAddress,T> |
execOnHub(java.util.function.Function<AgentManagerServiceGrpc.AgentManagerServiceBlockingStub,T> action,
AlluxioNodeType type,
ExecutionType executionType)
Execute a function across a set of Alluxio nodes on the cluster.
|
<T> Map<HubNodeAddress,T> |
execOnHub(java.util.function.Function<AgentManagerServiceGrpc.AgentManagerServiceBlockingStub,T> action,
String hostname)
Execute a function across a set of Alluxio nodes on the cluster.
|
AlluxioCluster |
getAlluxioCluster() |
AlluxioConfiguration |
getConf() |
FileSystem |
getFileSystem()
Get an instance of the alluxio file system.
|
HubCluster |
getHubCluster() |
ListMountPointResponse.Payload |
getMountPointList()
Get a list of mount points and their information.
|
GetPrestoConfDirResponse.Payload |
getPrestoConf()
Get presto conf.
|
AlluxioConfiguration |
getUpdatedProps(AlluxioConfigurationSet configSet)
Get updated cluster configuration from the configuration set.
|
PrestoCatalogListingResult |
listCatalogs(String confDir)
Gets a list of known UDBs from an Alluxio master.
|
List<ListFile> |
listFiles()
List all files.
|
List<AgentProcessStatusChangeResponse> |
processStatusChange(ProcessStatusChangeRequest batchReq)
Process state change request for Alluxio nodes.
|
void |
registerAgent(RegisterAgentRequest req)
Register agent with hosted Hub.
|
boolean |
removeFile(List<RemoveFile> filesList)
Remove a list of files.
|
SetPrestoConfDirResponse.Payload |
setPrestoConfDir(SetPrestoConfDirRequest request)
Set Presto configuration directory.
|
SpeedTestResponse.Payload |
speedTest(SpeedTestRequest request)
speed test for ufs.
|
void |
startApplyMountPointListener()
Starts a request stream observer for
HostedManagerServiceGrpc ApplyMountPoint
RPC calls. |
void |
startDeleteMountPointListener()
Starts a request stream observer for
HostedManagerServiceGrpc DeleteMountPoint
RPC calls. |
void |
startDetectPrestoListener()
Starts a request stream observer for
HostedManagerServiceGrpc DetectPresto RPC calls. |
void |
startGetConfigurationSetListener()
Starts a request stream observer for
HostedManagerServiceGrpc GetConfigurationSet
RPC calls. |
void |
startGetPrestoConfDirListener()
Starts a request stream observer for
HostedManagerServiceGrpc GetPrestoConfDir
RPC calls. |
void |
startListCatalogListener()
Starts a request stream observer for
HostedManagerServiceGrpc ListCatalog RPC calls. |
void |
startListFileListener()
Starts a request stream observer for
HostedManagerServiceGrpc ListFile RPC calls. |
void |
startListMountPointsListener()
Starts a request stream observer for
HostedManagerServiceGrpc ListMountPoints
RPC calls. |
void |
startPingManagerListener()
Starts a request stream observer for
HostedManagerServiceGrpc PingManager RPC calls. |
void |
startProcessStatusChangeListener()
Starts a request stream observer for
HostedManagerServiceGrpc ProcessStatusChange
RPC calls. |
void |
startRemoveFileListener()
Starts a request stream observer for
HostedManagerServiceGrpc RemoveFile RPC calls. |
void |
startSetPrestoConfDirListener()
Starts a request stream observer for
HostedManagerServiceGrpc SetPrestoConfDir
RPC calls. |
void |
startSpeedTestListener()
Starts a request stream observer for
HostedManagerServiceGrpc SpeedTest RPC calls. |
void |
startUploadFileListener()
Starts a request stream observer for
HostedManagerServiceGrpc UploadFile RPC calls. |
void |
startWriteConfigurationSetListener()
Starts a request stream observer for
HostedManagerServiceGrpc WriteConfigurationSet
RPC calls. |
Set<HubNodeAddress> |
updateConfigurationFor(AlluxioNodeType type,
AlluxioConfigurationSet conf)
Updates the configuration for a set of Alluxio nodes.
|
boolean |
uploadFile(List<UploadFile> fileInfoList)
Add new files.
|
public ManagerProcessContext(AlluxioConfiguration conf)
ManagerProcessContext
.conf
- alluxio configurationpublic void startPingManagerListener()
HostedManagerServiceGrpc
PingManager RPC calls.
The PingManagerResponse
's HubMetadata
must be the PingManagerRequest
's
HubMetadata
in order for the Hosted Hub to properly track where the ping is coming
from. This is to handle scenarios where the cluster id changed due to Alluxio journal formats.public void startProcessStatusChangeListener()
HostedManagerServiceGrpc
ProcessStatusChange
RPC calls.public void startGetConfigurationSetListener()
HostedManagerServiceGrpc
GetConfigurationSet
RPC calls.public void startWriteConfigurationSetListener()
HostedManagerServiceGrpc
WriteConfigurationSet
RPC calls.public void startUploadFileListener()
HostedManagerServiceGrpc
UploadFile RPC calls.public void startListFileListener()
HostedManagerServiceGrpc
ListFile RPC calls.public void startRemoveFileListener()
HostedManagerServiceGrpc
RemoveFile RPC calls.public void startDetectPrestoListener()
HostedManagerServiceGrpc
DetectPresto RPC calls.public void startListCatalogListener()
HostedManagerServiceGrpc
ListCatalog RPC calls.public void startSetPrestoConfDirListener()
HostedManagerServiceGrpc
SetPrestoConfDir
RPC calls.public void startGetPrestoConfDirListener()
HostedManagerServiceGrpc
GetPrestoConfDir
RPC calls.public void startListMountPointsListener()
HostedManagerServiceGrpc
ListMountPoints
RPC calls.public void startApplyMountPointListener()
HostedManagerServiceGrpc
ApplyMountPoint
RPC calls.public void startDeleteMountPointListener()
HostedManagerServiceGrpc
DeleteMountPoint
RPC calls.public void startSpeedTestListener()
HostedManagerServiceGrpc
SpeedTest RPC calls.public AlluxioCluster getAlluxioCluster()
AlluxioCluster
public AlluxioConfiguration getConf()
public HubCluster getHubCluster()
HubCluster
public <T> Map<HubNodeAddress,T> execOnHub(java.util.function.Function<AgentManagerServiceGrpc.AgentManagerServiceBlockingStub,T> action)
T
- the response type that is returned from the client actionaction
- a function that supplies a Hub agent clientpublic <T> Map<HubNodeAddress,T> execOnHub(java.util.function.Function<AgentManagerServiceGrpc.AgentManagerServiceBlockingStub,T> action, String hostname)
T
- the response type that is returned from the client actionaction
- a function that supplies a Hub agent clienthostname
- the host to run onpublic <T> Map<HubNodeAddress,T> execOnHub(java.util.function.Function<AgentManagerServiceGrpc.AgentManagerServiceBlockingStub,T> action, AlluxioNodeType type)
T
- the response type that is returned from the client actionaction
- a function that supplies a Hub agent clienttype
- the hostname it should run onpublic <T> Map<HubNodeAddress,T> execOnHub(java.util.function.Function<AgentManagerServiceGrpc.AgentManagerServiceBlockingStub,T> action, AlluxioNodeType type, ExecutionType executionType)
T
- the response type that is returned from the client actionaction
- a function that supplies a Hub agent clienttype
- the hostname it should run onexecutionType
- parallel or serialpublic List<AgentProcessStatusChangeResponse> processStatusChange(ProcessStatusChangeRequest batchReq)
batchReq
- batch state change requestspublic void registerAgent(RegisterAgentRequest req)
req
- registration requestpublic void agentHearbeat(AgentHeartbeatRequest req)
req
- registration requestpublic void alluxioClusterHeartbeat(AlluxioCluster cluster)
HubMetadata
will always try to use the latest cluster id to handle
journal formats. This allows the Hosted Hub to catch cluster id changes.
If the response fails, re-initialize the connection with the Hosted Hub with
the new cluster id.cluster
- alluxio clusterpublic AlluxioConfigurationSet configurationSetFor(AlluxioNodeType type)
type
- the type of node to get the configuration frompublic Set<HubNodeAddress> updateConfigurationFor(AlluxioNodeType type, AlluxioConfigurationSet conf)
type
- the type of node to write the configuration toconf
- the configuration to writepublic GetPrestoConfDirResponse.Payload getPrestoConf()
public AlluxioConfiguration getUpdatedProps(AlluxioConfigurationSet configSet)
configSet
- cluster config setpublic FileSystem getFileSystem()
public void close() throws IOException
close
in interface AutoCloseable
IOException
public ListMountPointResponse.Payload getMountPointList()
public ApplyMountPointResponse.Payload applyMount(ApplyMountPointRequest req)
req
- validated requestpublic PrestoCatalogListingResult listCatalogs(String confDir)
confDir
- the presto configuration directory to search for catalogspublic boolean uploadFile(List<UploadFile> fileInfoList)
fileInfoList
- add a list of file add requestpublic boolean removeFile(List<RemoveFile> filesList)
filesList
- a list of files to be removedpublic SpeedTestResponse.Payload speedTest(SpeedTestRequest request)
request
- ufs speed test requestpublic SetPrestoConfDirResponse.Payload setPrestoConfDir(SetPrestoConfDirRequest request)
request
- presto conf directory requestpublic DeleteMountPointResponse.Payload deleteMount(MountPointInfo mountPointInfo)
mountPointInfo
- mount point infoCopyright © 2023. All Rights Reserved.