当前位置: 首页>>代码示例>>Java>>正文


Java PartitionStore类代码示例

本文整理汇总了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);
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:23,代码来源:TestLongDoublePrimitiveMessageStores.java

示例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);
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:23,代码来源:TestIntFloatPrimitiveMessageStores.java

示例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;
}
 
开发者ID:wmoustafa,项目名称:granada,代码行数:8,代码来源:IdWorkerPartitioner.java

示例4: getPartitionStore

import org.apache.giraph.partition.PartitionStore; //导入依赖的package包/类
@Override
public PartitionStore<I, V, E> getPartitionStore() {
  return getServerData().getPartitionStore();
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:5,代码来源:BspServiceWorker.java

示例5: getPartitionStore

import org.apache.giraph.partition.PartitionStore; //导入依赖的package包/类
@Override
public PartitionStore<I, V, E, M> getPartitionStore() {
  return getServerData().getPartitionStore();
}
 
开发者ID:zfighter,项目名称:giraph-research,代码行数:5,代码来源:BspServiceWorker.java

示例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;
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:9,代码来源:ServerData.java

示例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();
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:10,代码来源:CentralizedServiceWorker.java

示例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;
}
 
开发者ID:zfighter,项目名称:giraph-research,代码行数:9,代码来源:ServerData.java

示例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();
 
开发者ID:zfighter,项目名称:giraph-research,代码行数:10,代码来源:CentralizedServiceWorker.java


注:本文中的org.apache.giraph.partition.PartitionStore类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。