-
- All Superinterfaces:
Serializable
public interface StorageManager extends 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Path
getMyStorageLocation(StorageBucketId bucketId, NodeAllocationPlan.AssignmentPlan assignment)
Returns "my" storage locationNodeAllocationPlan
getNodeAllocationPlan()
Returns the node allocation plan associated with this storage managerint
getNumWorkers(int maxParallelism)
Returns the number of workers allocated or0
if this is a master storage manager.List<Path>
getOtherStorageLocations(StorageBucketId bucketId, int maxParallelism)
Returns storage locations for all workers up to the specifiedmaxParallelism
.void
releaseStorage(FileClient client)
Releases all storage for this storage managervoid
releaseStorage(FileClient fileClient, StoragePlanner storagePlanner)
Releases all storage for this storage manager that was allocated by the given plannerString
toString()
-
-
-
Method Detail
-
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 or0
if 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
List<Path> getOtherStorageLocations(StorageBucketId bucketId, int maxParallelism)
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
Path getMyStorageLocation(StorageBucketId bucketId, NodeAllocationPlan.AssignmentPlan assignment)
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 themaster
assignment.
-
releaseStorage
void releaseStorage(FileClient client)
Releases all storage for this storage manager- Parameters:
client
- the file client
-
releaseStorage
void releaseStorage(FileClient fileClient, StoragePlanner storagePlanner)
Releases all storage for this storage manager that was allocated by the given planner- Parameters:
fileClient
- the file clientstoragePlanner
- the storage planner
-
-