public class SimpleBulkPlacementStrategy extends Object implements IDPlacementStrategy
Modifier and Type | Field and Description |
---|---|
static ConfigOption<Integer> |
CONCURRENT_PARTITIONS |
static int |
PARTITION_FINDING_ATTEMPTS |
Constructor and Description |
---|
SimpleBulkPlacementStrategy(Configuration config) |
SimpleBulkPlacementStrategy(int concurrentPartitions) |
Modifier and Type | Method and Description |
---|---|
void |
exhaustedPartition(int partitionID)
Called when there are no more idAuthorities left in the given partition.
|
int |
getPartition(InternalElement element)
Individually assigns an id to the given vertex or relation.
|
void |
getPartitions(Map<InternalVertex,PartitionAssignment> vertices)
Bulk assignment of idAuthorities to vertices.
|
void |
injectIDManager(IDManager idManager)
After construction, the
IDManager used by this graph instance
is injected into this IDPlacementStrategy so that the id pattern of vertices can be inspected. |
boolean |
isExhaustedPartition(int partitionID) |
void |
setLocalPartitionBounds(List<PartitionIDRange> localPartitionIdRanges)
If Titan is embedded, this method is used to indicate to the placement strategy which
part of the partition id space is hosted locally so that vertex and edge placements can be made accordingly
(i.e.
|
boolean |
supportsBulkPlacement()
Whether this placement strategy supports bulk placement.
|
public static final ConfigOption<Integer> CONCURRENT_PARTITIONS
public static final int PARTITION_FINDING_ATTEMPTS
public SimpleBulkPlacementStrategy(int concurrentPartitions)
public SimpleBulkPlacementStrategy(Configuration config)
public void injectIDManager(IDManager idManager)
IDPlacementStrategy
IDManager
used by this graph instance
is injected into this IDPlacementStrategy so that the id pattern of vertices can be inspected.
This method is guaranteed to be called before any partition assignments are made.injectIDManager
in interface IDPlacementStrategy
public int getPartition(InternalElement element)
IDPlacementStrategy
getPartition
in interface IDPlacementStrategy
element
- Vertex or relation to assign id to.public void getPartitions(Map<InternalVertex,PartitionAssignment> vertices)
IDPlacementStrategy
IDPlacementStrategy.supportsBulkPlacement()
first.getPartitions
in interface IDPlacementStrategy
vertices
- Map containing all vertices and their partition placement.public boolean supportsBulkPlacement()
IDPlacementStrategy
IDPlacementStrategy.getPartitions(java.util.Map)
will throw UnsupportedOperationException
supportsBulkPlacement
in interface IDPlacementStrategy
public void setLocalPartitionBounds(List<PartitionIDRange> localPartitionIdRanges)
IDPlacementStrategy
setLocalPartitionBounds
in interface IDPlacementStrategy
localPartitionIdRanges
- List of PartitionIDRange
s correspondinging to the locally hosted partitionspublic boolean isExhaustedPartition(int partitionID)
public void exhaustedPartition(int partitionID)
IDPlacementStrategy
exhaustedPartition
in interface IDPlacementStrategy
partitionID
- Id of the partition that has been exhausted.Copyright © 2012–2015. All rights reserved.