本文整理匯總了Java中org.apache.giraph.partition.PartitionStore類的典型用法代碼示例。如果您正苦於以下問題:Java PartitionStore類的具體用法?Java PartitionStore怎麽用?Java PartitionStore使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PartitionStore類屬於org.apache.giraph.partition包,在下文中一共展示了PartitionStore類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: prepare
import org.apache.giraph.partition.PartitionStore; //導入依賴的package包/類
@Before
public void prepare() throws IOException {
service = Mockito.mock(CentralizedServiceWorker.class);
Mockito.when(
service.getPartitionId(Mockito.any(LongWritable.class))).thenAnswer(
new Answer<Integer>() {
@Override
public Integer answer(InvocationOnMock invocation) {
LongWritable vertexId = (LongWritable) invocation.getArguments()[0];
return (int) (vertexId.get() % NUM_PARTITIONS);
}
}
);
PartitionStore partitionStore = Mockito.mock(PartitionStore.class);
Mockito.when(service.getPartitionStore()).thenReturn(partitionStore);
Mockito.when(partitionStore.getPartitionIds()).thenReturn(
Lists.newArrayList(0, 1));
Partition partition = Mockito.mock(Partition.class);
Mockito.when(partition.getVertexCount()).thenReturn(Long.valueOf(1));
Mockito.when(partitionStore.getPartition(0)).thenReturn(partition);
Mockito.when(partitionStore.getPartition(1)).thenReturn(partition);
}
示例2: prepare
import org.apache.giraph.partition.PartitionStore; //導入依賴的package包/類
@Before
public void prepare() throws IOException {
service = Mockito.mock(CentralizedServiceWorker.class);
Mockito.when(
service.getPartitionId(Mockito.any(IntWritable.class))).thenAnswer(
new Answer<Integer>() {
@Override
public Integer answer(InvocationOnMock invocation) {
IntWritable vertexId = (IntWritable) invocation.getArguments()[0];
return vertexId.get() % NUM_PARTITIONS;
}
}
);
PartitionStore partitionStore = Mockito.mock(PartitionStore.class);
Mockito.when(service.getPartitionStore()).thenReturn(partitionStore);
Mockito.when(partitionStore.getPartitionIds()).thenReturn(
Lists.newArrayList(0, 1));
Partition partition = Mockito.mock(Partition.class);
Mockito.when(partition.getVertexCount()).thenReturn(Long.valueOf(1));
Mockito.when(partitionStore.getPartition(0)).thenReturn(partition);
Mockito.when(partitionStore.getPartition(1)).thenReturn(partition);
}
示例3: finalizePartitionStats
import org.apache.giraph.partition.PartitionStore; //導入依賴的package包/類
@Override
public Collection<PartitionStats> finalizePartitionStats(
Collection<PartitionStats> workerPartitionStats,
PartitionStore<SuperVertexId, Database, NullWritable> partitionStore) {
// No modification necessary
return workerPartitionStats;
}
示例4: getPartitionStore
import org.apache.giraph.partition.PartitionStore; //導入依賴的package包/類
@Override
public PartitionStore<I, V, E> getPartitionStore() {
return getServerData().getPartitionStore();
}
示例5: getPartitionStore
import org.apache.giraph.partition.PartitionStore; //導入依賴的package包/類
@Override
public PartitionStore<I, V, E, M> getPartitionStore() {
return getServerData().getPartitionStore();
}
示例6: getPartitionStore
import org.apache.giraph.partition.PartitionStore; //導入依賴的package包/類
/**
* Return the partition store for this worker.
*
* @return The partition store
*/
public PartitionStore<I, V, E> getPartitionStore() {
return partitionStore;
}
示例7: getPartitionStore
import org.apache.giraph.partition.PartitionStore; //導入依賴的package包/類
/**
* Get the partition store for this worker.
* The partitions contain the vertices for
* this worker and can be used to run compute() for the vertices or do
* checkpointing.
*
* @return The partition store for this worker.
*/
PartitionStore<I, V, E> getPartitionStore();
示例8: getPartitionStore
import org.apache.giraph.partition.PartitionStore; //導入依賴的package包/類
/**
* Return the partition store for this worker.
*
* @return The partition store
*/
public PartitionStore<I, V, E, M> getPartitionStore() {
return partitionStore;
}
示例9: getPartitionStore
import org.apache.giraph.partition.PartitionStore; //導入依賴的package包/類
/**
* Get the partition store for this worker.
* The partitions contain the vertices for
* this worker and can be used to run compute() for the vertices or do
* checkpointing.
*
* @return The partition store for this worker.
*/
PartitionStore<I, V, E, M> getPartitionStore();