Package io.hgraphdb.giraph
Class HBaseVertexInputFormat.HBaseVertexReader
- java.lang.Object
-
- org.apache.giraph.conf.DefaultImmutableClassesGiraphConfigurable<I,V,E>
-
- org.apache.giraph.worker.WorkerAggregatorDelegator<I,V,E>
-
- org.apache.giraph.io.VertexReader<I,V,org.apache.hadoop.io.Writable>
-
- org.apache.giraph.io.BasicVertexValueReader<I,V>
-
- org.apache.giraph.io.VertexValueReader<ObjectWritable,VertexValueWritable>
-
- io.hgraphdb.giraph.HBaseVertexInputFormat.HBaseVertexReader
-
- All Implemented Interfaces:
org.apache.giraph.aggregators.AggregatorUsage
,org.apache.giraph.conf.GiraphConfigurationSettable<ObjectWritable,VertexValueWritable,org.apache.hadoop.io.Writable>
,org.apache.giraph.conf.ImmutableClassesGiraphConfigurable<ObjectWritable,VertexValueWritable,org.apache.hadoop.io.Writable>
,org.apache.giraph.worker.WorkerAggregatorUsage
,org.apache.giraph.worker.WorkerBroadcastUsage
,org.apache.giraph.worker.WorkerGlobalCommUsage
,org.apache.giraph.worker.WorkerReduceUsage
- Enclosing class:
- HBaseVertexInputFormat
public static class HBaseVertexInputFormat.HBaseVertexReader extends org.apache.giraph.io.VertexValueReader<ObjectWritable,VertexValueWritable>
Takes an instance of RecordReader that supports HBase row-key, result records. Subclasses can focus on vertex instantiation details without worrying about connection semantics. Subclasses are expected to implement nextVertex() and getCurrentVertex()
-
-
Constructor Summary
Constructors Constructor Description HBaseVertexReader(org.apache.hadoop.mapreduce.InputSplit split, org.apache.hadoop.mapreduce.TaskAttemptContext context)
Sets the base TableInputFormat and creates a record reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
closeprotected org.apache.hadoop.mapreduce.TaskAttemptContext
getContext()
getContextHBaseVertex
getCurrentHBaseVertex()
Get last HBase vertex.ObjectWritable
getCurrentVertexId()
VertexValueWritable
getCurrentVertexValue()
float
getProgress()
getProgressprotected org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.client.Result>
getRecordReader()
getRecordReadervoid
initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context)
initializeboolean
nextVertex()
-
Methods inherited from class org.apache.giraph.worker.WorkerAggregatorDelegator
aggregate, getAggregatedValue, getBroadcast, reduce, reduceMerge, setWorkerGlobalCommUsage
-
-
-
-
Constructor Detail
-
HBaseVertexReader
public HBaseVertexReader(org.apache.hadoop.mapreduce.InputSplit split, org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException
Sets the base TableInputFormat and creates a record reader.- Parameters:
split
- InputSplitcontext
- Context- Throws:
IOException
-
-
Method Detail
-
initialize
public void initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException, InterruptedException
initialize- Overrides:
initialize
in classorg.apache.giraph.io.VertexValueReader<ObjectWritable,VertexValueWritable>
- Parameters:
inputSplit
- Input split to be used for reading vertices.context
- Context from the task.- Throws:
IOException
InterruptedException
-
getCurrentHBaseVertex
public HBaseVertex getCurrentHBaseVertex() throws IOException, InterruptedException
Get last HBase vertex. Generate it if missing.- Returns:
- The last HBase vertex
- Throws:
IOException
InterruptedException
-
nextVertex
public boolean nextVertex() throws IOException, InterruptedException
- Specified by:
nextVertex
in classorg.apache.giraph.io.VertexReader<ObjectWritable,VertexValueWritable,org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
-
getCurrentVertexId
public ObjectWritable getCurrentVertexId() throws IOException, InterruptedException
- Specified by:
getCurrentVertexId
in classorg.apache.giraph.io.BasicVertexValueReader<ObjectWritable,VertexValueWritable>
- Throws:
IOException
InterruptedException
-
getCurrentVertexValue
public VertexValueWritable getCurrentVertexValue() throws IOException, InterruptedException
- Specified by:
getCurrentVertexValue
in classorg.apache.giraph.io.BasicVertexValueReader<ObjectWritable,VertexValueWritable>
- Throws:
IOException
InterruptedException
-
close
public void close() throws IOException
close- Specified by:
close
in classorg.apache.giraph.io.VertexReader<ObjectWritable,VertexValueWritable,org.apache.hadoop.io.Writable>
- Throws:
IOException
-
getProgress
public float getProgress() throws IOException, InterruptedException
getProgress- Specified by:
getProgress
in classorg.apache.giraph.io.VertexReader<ObjectWritable,VertexValueWritable,org.apache.hadoop.io.Writable>
- Returns:
- progress
- Throws:
IOException
InterruptedException
-
getRecordReader
protected org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.hbase.io.ImmutableBytesWritable,org.apache.hadoop.hbase.client.Result> getRecordReader()
getRecordReader- Returns:
- Record reader to be used for reading.
-
getContext
protected org.apache.hadoop.mapreduce.TaskAttemptContext getContext()
getContext- Returns:
- Context passed to initialize.
-
-