- All Superinterfaces:
Serializable
A manager of intermediate storage. StorageManager deletion and creation
should only be performed on the client. StorageManagers can be serialized to
the cluster and, within the cluster, nodes can call
#getLocalStorageLocation(StorageBucketId,PartitionInstanceInfo) to
determine their storage "slot" or
#getRemoteStorageLocations(StorageBucketId) to find other nodes
storage slots.-
Method Summary
Modifier and TypeMethodDescriptiongetMyStorageLocation(StorageBucketId bucketId, NodeAllocationPlan.AssignmentPlan assignment) Returns "my" storage locationReturns the node allocation plan associated with this storage managerintgetNumWorkers(int maxParallelism) Returns the number of workers allocated or0if this is a master storage manager.getOtherStorageLocations(StorageBucketId bucketId, int maxParallelism) Returns storage locations for all workers up to the specifiedmaxParallelism.voidreleaseStorage(FileClient client) Releases all storage for this storage managervoidreleaseStorage(FileClient fileClient, StoragePlanner storagePlanner) Releases all storage for this storage manager that was allocated by the given plannertoString()
-
Method Details
-
getNodeAllocationPlan
NodeAllocationPlan getNodeAllocationPlan()Returns the node allocation plan associated with this storage manager- Returns:
- the node allocation plan associated with this storage manager
- Throws:
UnsupportedOperationException- if this is a master storage manager
-
getNumWorkers
int getNumWorkers(int maxParallelism) Returns the number of workers allocated or0if this is a master storage manager. The result will be capped at the specifiedmaxParallelism.- Parameters:
maxParallelism- the max parallelism- Returns:
- the number of nodes allocated
-
getOtherStorageLocations
Returns storage locations for all workers up to the specifiedmaxParallelism. Data written to these locations will be visible to individual nodes at their "my" storage locations and vice-versa. In the case where maxParallelism is 1, this returns from the master storage location.- Parameters:
maxParallelism- the max parallelism- Returns:
- remote storage locations
- Throws:
UnsupportedOperationException- if this is a master storage manager and maxParallelism is greater than 1.
-
getMyStorageLocation
Returns "my" storage location- Parameters:
assignment- "my" assignment- Returns:
- "my" storage location
- Throws:
UnsupportedOperationException- if this is a master storage manager and assignment is for anything other than themasterassignment.
-
releaseStorage
Releases all storage for this storage manager- Parameters:
client- the file client
-
toString
String toString() -
releaseStorage
Releases all storage for this storage manager that was allocated by the given planner- Parameters:
fileClient- the file clientstoragePlanner- the storage planner
-