D
- Data type of partition cache@NotThreadSafe public abstract class SendDataCache<D> extends Object
Constructor and Description |
---|
SendDataCache(ImmutableClassesGiraphConfiguration conf,
CentralizedServiceWorker<?,?,?> serviceWorker,
int maxRequestSize,
float additionalRequestSize)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ImmutableClassesGiraphConfiguration |
getConf() |
D |
getData(int partitionId)
Get the data cache for a partition id
|
int |
getInitialBufferSize(int partitionId)
Get initial buffer size of a partition.
|
protected int |
getNumWorkers() |
protected int |
getSendWorkerInitialBufferSize(int taskId)
Get the initial buffer size for the messages sent to a worker.
|
protected CentralizedServiceWorker |
getServiceWorker()
Get the service worker.
|
protected Map<WorkerInfo,List<Integer>> |
getWorkerPartitions() |
int |
incrDataSize(int partitionId,
int size)
Increment the data size
|
PairList<WorkerInfo,PairList<Integer,D>> |
removeAllData()
Gets all the data and removes it from the cache.
|
PairList<Integer,D> |
removeWorkerData(WorkerInfo workerInfo)
Gets the data for a worker and removes it from the cache.
|
void |
setData(int partitionId,
D data)
Set the data cache for a partition id
|
public SendDataCache(ImmutableClassesGiraphConfiguration conf, CentralizedServiceWorker<?,?,?> serviceWorker, int maxRequestSize, float additionalRequestSize)
conf
- Giraph configurationserviceWorker
- Service workermaxRequestSize
- Maximum request size (in bytes)additionalRequestSize
- Additional request size (expressed as a
ratio of the average request size)public PairList<Integer,D> removeWorkerData(WorkerInfo workerInfo)
workerInfo
- the address of the worker who owns the data
partitions that are receiving the datapublic PairList<WorkerInfo,PairList<Integer,D>> removeAllData()
public D getData(int partitionId)
partitionId
- Partition idpublic void setData(int partitionId, D data)
partitionId
- Partition iddata
- Data to be set for a partition idpublic int getInitialBufferSize(int partitionId)
partitionId
- Partition idpublic int incrDataSize(int partitionId, int size)
partitionId
- Partition idsize
- Size to increment bypublic ImmutableClassesGiraphConfiguration getConf()
protected CentralizedServiceWorker getServiceWorker()
protected int getSendWorkerInitialBufferSize(int taskId)
taskId
- The task ID of a worker.protected int getNumWorkers()
protected Map<WorkerInfo,List<Integer>> getWorkerPartitions()
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.