public class MockUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MockUtils.MockedEnvironment<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>
mocks and holds "environment objects" that are injected into a vertex
|
Modifier and Type | Method and Description |
---|---|
static ServerData<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable> |
createNewServerData(ImmutableClassesGiraphConfiguration conf,
org.apache.hadoop.mapreduce.Mapper.Context context)
Prepare a ServerData object.
|
static CentralizedServiceWorker<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable> |
mockServiceGetVertexPartitionOwner(int numOfPartitions)
Prepare a mocked CentralizedServiceWorker.
|
static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable> |
prepareVertexAndComputation(Vertex<I,V,E> vertex,
I vertexId,
V vertexValue,
boolean isHalted,
Computation<I,V,E,M,M> computation,
long superstep)
prepare a vertex and computation for use in a unit test by setting its
internal state and injecting mocked dependencies,
|
public static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable> MockUtils.MockedEnvironment<I,V,E,M> prepareVertexAndComputation(Vertex<I,V,E> vertex, I vertexId, V vertexValue, boolean isHalted, Computation<I,V,E,M,M> computation, long superstep) throws Exception
I
- vertex idV
- vertex dataE
- edge dataM
- message datavertex
- VertexvertexId
- initial vertex idvertexValue
- initial vertex valueisHalted
- initial halted state of the vertexcomputation
- Computationsuperstep
- SuperstepException
public static CentralizedServiceWorker<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable> mockServiceGetVertexPartitionOwner(int numOfPartitions)
numOfPartitions
- The number of partitionspublic static ServerData<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable> createNewServerData(ImmutableClassesGiraphConfiguration conf, org.apache.hadoop.mapreduce.Mapper.Context context)
conf
- Configurationcontext
- ContextCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.