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 JanusGraph 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. preferring to assign partitions in the local ranges so that the data is hosted locally which is often
faster).
|
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)
IDPlacementStrategyIDManager 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 IDPlacementStrategypublic int getPartition(InternalElement element)
IDPlacementStrategygetPartition in interface IDPlacementStrategyelement - Vertex or relation to assign id to.public void getPartitions(Map<InternalVertex,PartitionAssignment> vertices)
IDPlacementStrategyIt is expected that the passed in map contains the partition assignment after this method returns. Any initial values in the map are meaningless and to be ignored.
This is an optional operation. Check with IDPlacementStrategy.supportsBulkPlacement() first.
getPartitions in interface IDPlacementStrategyvertices - Map containing all vertices and their partition placement.public boolean supportsBulkPlacement()
IDPlacementStrategyIDPlacementStrategy.getPartitions(java.util.Map) will throw UnsupportedOperationExceptionsupportsBulkPlacement in interface IDPlacementStrategypublic void setLocalPartitionBounds(List<PartitionIDRange> localPartitionIdRanges)
IDPlacementStrategyThis method can be called at any time while JanusGraph is running. It is typically called right after construction and when the id space is redistributed.
Depending on the storage backend one or multiple ranges of partition ids may be given. However, this list is never empty.
setLocalPartitionBounds in interface IDPlacementStrategylocalPartitionIdRanges - List of PartitionIDRanges corresponding to the locally hosted partitionspublic boolean isExhaustedPartition(int partitionID)
public void exhaustedPartition(int partitionID)
IDPlacementStrategyexhaustedPartition in interface IDPlacementStrategypartitionID - Id of the partition that has been exhausted.Copyright © 2012–2024. All rights reserved.