當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。