Interface StorageManager

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 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 or 0 if this is a master storage manager. The result will be capped at the specified maxParallelism.
      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 specified maxParallelism. 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 the master assignment.
    • releaseStorage

      void releaseStorage(FileClient client)
      Releases all storage for this storage manager
      Parameters:
      client - the file client
    • toString

      String toString()
      Overrides:
      toString in class Object
    • 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 client
      storagePlanner - the storage planner