trait BlockReplicationPolicy extends AnyRef
::DeveloperApi:: BlockReplicationPrioritization provides logic for prioritizing a sequence of peers for replicating blocks. BlockManager will replicate to each peer returned in order until the desired replication order is reached. If a replication fails, prioritize() will be called again to get a fresh prioritization.
- Annotations
- @DeveloperApi()
- Source
- BlockReplicationPolicy.scala
- Alphabetic
- By Inheritance
- BlockReplicationPolicy
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
prioritize(blockManagerId: BlockManagerId, peers: Seq[BlockManagerId], peersReplicatedTo: HashSet[BlockManagerId], blockId: BlockId, numReplicas: Int): List[BlockManagerId]
Method to prioritize a bunch of candidate peers of a block
Method to prioritize a bunch of candidate peers of a block
- blockManagerId
Id of the current BlockManager for self identification
- peers
A list of peers of a BlockManager
- peersReplicatedTo
Set of peers already replicated to
- blockId
BlockId of the block being replicated. This can be used as a source of randomness if needed.
- numReplicas
Number of peers we need to replicate to
- returns
A prioritized list of peers. Lower the index of a peer, higher its priority. This returns a list of size at most
numPeersToReplicateTo
.