本文整理汇总了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();