Package io.hgraphdb.giraph
Class HBaseEdgeInputFormat.HBaseEdgeReader
- java.lang.Object
-
- org.apache.giraph.conf.DefaultImmutableClassesGiraphConfigurable<I,V,E>
-
- org.apache.giraph.worker.WorkerAggregatorDelegator<I,org.apache.hadoop.io.Writable,E>
-
- org.apache.giraph.io.EdgeReader<ObjectWritable,EdgeValueWritable>
-
- io.hgraphdb.giraph.HBaseEdgeInputFormat.HBaseEdgeReader
-
- All Implemented Interfaces:
org.apache.giraph.aggregators.AggregatorUsage
,org.apache.giraph.conf.GiraphConfigurationSettable<ObjectWritable,org.apache.hadoop.io.Writable,EdgeValueWritable>
,org.apache.giraph.conf.ImmutableClassesGiraphConfigurable<ObjectWritable,org.apache.hadoop.io.Writable,EdgeValueWritable>
,org.apache.giraph.worker.WorkerAggregatorUsage
,org.apache.giraph.worker.WorkerBroadcastUsage
,org.apache.giraph.worker.WorkerGlobalCommUsage
,org.apache.giraph.worker.WorkerReduceUsage
- Enclosing class:
- HBaseEdgeInputFormat
public static class HBaseEdgeInputFormat.HBaseEdgeReader extends org.apache.giraph.io.EdgeReader<ObjectWritable,EdgeValueWritable>
Takes an instance of RecordReader that supports HBase row-key, result records. Subclasses can focus on edge instantiation details without worrying about connection semantics. Subclasses are expected to implement nextEdge() and getCurrentEdge()
-
-
Constructor Summary
Constructors Constructor Description HBaseEdgeReader(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()
getContextorg.apache.giraph.edge.Edge<ObjectWritable,EdgeValueWritable>
getCurrentEdge()
HBaseEdge
getCurrentHBaseEdge()
Get last HBase edge.ObjectWritable
getCurrentSourceId()
ObjectWritable
getCurrentTargetId()
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
nextEdge()
-
Methods inherited from class org.apache.giraph.worker.WorkerAggregatorDelegator
aggregate, getAggregatedValue, getBroadcast, reduce, reduceMerge, setWorkerGlobalCommUsage
-
-
-
-
Constructor Detail
-
HBaseEdgeReader
public HBaseEdgeReader(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- Specified by:
initialize
in classorg.apache.giraph.io.EdgeReader<ObjectWritable,EdgeValueWritable>
- Parameters:
inputSplit
- Input split to be used for reading vertices.context
- Context from the task.- Throws:
IOException
InterruptedException
-
getCurrentHBaseEdge
public HBaseEdge getCurrentHBaseEdge() throws IOException, InterruptedException
Get last HBase edge. Generate it if missing.- Returns:
- The last HBase edge
- Throws:
IOException
InterruptedException
-
nextEdge
public boolean nextEdge() throws IOException, InterruptedException
- Specified by:
nextEdge
in classorg.apache.giraph.io.EdgeReader<ObjectWritable,EdgeValueWritable>
- Throws:
IOException
InterruptedException
-
getCurrentEdge
public org.apache.giraph.edge.Edge<ObjectWritable,EdgeValueWritable> getCurrentEdge() throws IOException, InterruptedException
- Specified by:
getCurrentEdge
in classorg.apache.giraph.io.EdgeReader<ObjectWritable,EdgeValueWritable>
- Throws:
IOException
InterruptedException
-
getCurrentSourceId
public ObjectWritable getCurrentSourceId() throws IOException, InterruptedException
- Specified by:
getCurrentSourceId
in classorg.apache.giraph.io.EdgeReader<ObjectWritable,EdgeValueWritable>
- Throws:
IOException
InterruptedException
-
getCurrentTargetId
public ObjectWritable getCurrentTargetId() throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
close
public void close() throws IOException
close- Specified by:
close
in classorg.apache.giraph.io.EdgeReader<ObjectWritable,EdgeValueWritable>
- Throws:
IOException
-
getProgress
public float getProgress() throws IOException, InterruptedException
getProgress- Specified by:
getProgress
in classorg.apache.giraph.io.EdgeReader<ObjectWritable,EdgeValueWritable>
- 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.
-
-