public class MetaPartitionManager extends Object
| Modifier and Type | Field and Description | 
|---|---|
| static int | NO_PARTITION_TO_PROCESSFlag representing no partitions is left to process in the current iteration
 cycle over all partitions. | 
| Constructor and Description | 
|---|
| MetaPartitionManager(int numIOThreads,
                    OutOfCoreEngine oocEngine)Constructor | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addPartition(int partitionId)Add a partition | 
| void | doneLoadingPartition(int partitionId,
                    long superstep)Notify this meta store that load of a partition for a specific superstep
 is completed | 
| void | doneOffloadingBuffer(int partitionId)Notify this meta store that offload of raw data buffers (vertex/edges/
 messages) of a particular partition is completed. | 
| void | doneOffloadingMessages(int partitionId)Notify this meta store that offload of messages for a particular partition
 is complete. | 
| void | doneOffloadingPartition(int partitionId)Notify this meta store that offload of a partition (partition data and its
 current messages) is completed. | 
| double | getGraphFractionInMemory()Since the statistics are based on estimates, we assume each partial
 partition is taking about half of the full partition in terms of memory
 footprint. | 
| Integer | getLoadPartitionId(int threadId)Get id of a partition to load its data to memory. | 
| Integer | getNextPartition()Return the id of an unprocessed partition in memory. | 
| int | getNumInMemoryPartitions() | 
| int | getNumPartiallyInMemoryPartitions() | 
| int | getNumPartitions()Get total number of partitions | 
| Integer | getOffloadMessageBufferId(int threadId)Get id of a partition to offload its incoming message buffers on disk | 
| Integer | getOffloadMessageId(int threadId)Get id of a partition to offload its incoming message on disk. | 
| Integer | getOffloadPartitionBufferId(int threadId)Get id of a partition to offload its vertex/edge buffers on disk | 
| Integer | getOffloadPartitionId(int threadId)Get id of a partition to offload to disk. | 
| int | getOwnerThreadId(int partitionId)Get the thread id that is responsible for a particular partition | 
| Iterable<Integer> | getPartitionIds()Return the list of all available partitions as an iterable | 
| boolean | hasPartition(Integer partitionId)Whether a given partition is available | 
| boolean | hasProcessedOnMemory()Whether there is any processed partition stored in memory (excluding those
 that are prefetched to execute in the next superstep). | 
| boolean | isPartitionOnDisk(int partitionId)Whether a partition is on disk (both its data and its current messages) | 
| boolean | isPartitionProcessed(Integer partitionId)Whether a partition is *processed* in the current iteration cycle over
 partitions. | 
| void | markPartitionAsInProcess(int partitionId)Mark a partition as being 'IN_PROCESS' | 
| void | removePartition(Integer partitionId)Remove a partition. | 
| void | resetMessages()Reset messages in the meta store. | 
| void | resetPartitions()Reset the meta store for a new iteration cycle over all partitions. | 
| void | setPartitionIsProcessed(int partitionId)Mark a partition as 'PROCESSED' | 
| boolean | startLoadingPartition(int partitionId,
                     long superstep)Notify this meta store that load of a partition for a specific superstep
 is about to start. | 
| boolean | startOffloadingBuffer(int partitionId)Notify this meta store that offload of raw data buffers (vertex/edges/
 messages) of a particular partition is about to start. | 
| boolean | startOffloadingMessages(int partitionId)Notify this meta store that offload of messages for a particular partition
 is about to start. | 
| boolean | startOffloadingPartition(int partitionId)Notify this meta store that offload of a partition (partition data and its
 current messages) is about to start. | 
public static final int NO_PARTITION_TO_PROCESS
public MetaPartitionManager(int numIOThreads,
                            OutOfCoreEngine oocEngine)
numIOThreads - number of IO threadsoocEngine - out-of-core enginepublic int getNumInMemoryPartitions()
public int getNumPartiallyInMemoryPartitions()
public int getNumPartitions()
public double getGraphFractionInMemory()
public boolean hasPartition(Integer partitionId)
partitionId - id of the partition to check if this worker owns itpublic Iterable<Integer> getPartitionIds()
public int getOwnerThreadId(int partitionId)
partitionId - id of the given partitionpublic void addPartition(int partitionId)
partitionId - id of a partition to addpublic void removePartition(Integer partitionId)
partitionId - id of a partition to removepublic Integer getOffloadPartitionId(int threadId)
threadId - id of the thread who is going to store the partition on
                 diskpublic Integer getOffloadPartitionBufferId(int threadId)
threadId - id of the thread who is going to store the buffers on diskpublic Integer getOffloadMessageBufferId(int threadId)
threadId - id of the thread who is going to store the buffers on diskpublic Integer getOffloadMessageId(int threadId)
threadId - id of the thread who is going to store the incoming
                 messages on diskpublic Integer getLoadPartitionId(int threadId)
threadId - id of the thread who is going to load the partition datapublic void markPartitionAsInProcess(int partitionId)
partitionId - id of the partition to markpublic boolean hasProcessedOnMemory()
public boolean isPartitionProcessed(Integer partitionId)
partitionId - id of the partition to checkpublic void setPartitionIsProcessed(int partitionId)
partitionId - id of the partition to markpublic boolean startLoadingPartition(int partitionId,
                                     long superstep)
partitionId - id of the partition to load to memorysuperstep - superstep in which the partition is needed forpublic void doneLoadingPartition(int partitionId,
                                 long superstep)
partitionId - id of the partition for which the load is completedsuperstep - superstep in which the partition is loaded forpublic boolean startOffloadingMessages(int partitionId)
partitionId - id of the partition that its messages is being offloadedpublic void doneOffloadingMessages(int partitionId)
partitionId - id of the partition that its messages is offloaded to
                    diskpublic boolean startOffloadingBuffer(int partitionId)
partitionId - id of the partition that its buffer is being offloadedpublic void doneOffloadingBuffer(int partitionId)
partitionId - id of the partition that its buffer is offloadedpublic boolean startOffloadingPartition(int partitionId)
partitionId - id of the partition that its data is being offloadedpublic void doneOffloadingPartition(int partitionId)
partitionId - id of the partition that its data is offloadedpublic void resetPartitions()
public void resetMessages()
public Integer getNextPartition()
public boolean isPartitionOnDisk(int partitionId)
partitionId - id of the partition to check if it is on diskCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.