@Override public void initialize(final InputSplit inputSplit, final TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException { reader.initialize(inputSplit, taskAttemptContext); }
@Override public boolean nextKeyValue() throws IOException, InterruptedException { return reader.nextKeyValue(); }
@Override public void close() throws IOException { this.reader.close(); }
this.tableRecordReader = new TableRecordReader(); sc.setStartRow(tSplit.getStartRow()); sc.setStopRow(tSplit.getEndRow()); trr.setScan(sc); trr.setTable(table); return new RecordReader<ImmutableBytesWritable, Result>() { trr.close(); connection.close(); throw ioe;
trr = new TableRecordReader(); trr.setScan(sc); trr.setHTable(table); try { trr.initialize(tSplit, context); } catch (InterruptedException e) { throw new InterruptedIOException(e.getMessage());
LOG.info("Input split length: " + StringUtils.humanReadableInt(tSplit.getLength()) + " bytes."); final TableRecordReader trr = this.tableRecordReader != null ? this.tableRecordReader : new TableRecordReader(); Scan sc = new Scan(this.scan); sc.setStartRow(tSplit.getStartRow()); sc.setStopRow(tSplit.getEndRow()); trr.setScan(sc); trr.setTable(getTable()); return new RecordReader<ImmutableBytesWritable, Result>() {
@Override public boolean nextKeyValue() throws IOException, InterruptedException { while (this.reader.nextKeyValue()) { final FaunusVertex temp = this.graph.readFaunusVertex(this.reader.getCurrentKey().copyBytes(), this.reader.getCurrentValue().getMap().get(TitanHBaseInputFormat.EDGE_STORE_FAMILY)); if (null != temp) { if (this.pathEnabled) temp.enablePath(true); this.vertex = temp; this.vertexQuery.defaultFilter(this.vertex); return true; } } return false; }
@Override public float getProgress() { return this.reader.getProgress(); }
@Override public ImmutableBytesWritable getCurrentKey() throws IOException, InterruptedException { return trr.getCurrentKey(); }
@Override public Result getCurrentValue() throws IOException, InterruptedException { return trr.getCurrentValue(); }
@Override public void setScan(Scan scan) { super.setScan(scan); startRow_ = scan.getStartRow(); endRow_ = scan.getStopRow(); byte[] startPadded; byte[] endPadded; if (startRow_.length < endRow_.length) { startPadded = Bytes.padTail(startRow_, endRow_.length - startRow_.length); endPadded = endRow_; } else if (endRow_.length < startRow_.length) { startPadded = startRow_; endPadded = Bytes.padTail(endRow_, startRow_.length - endRow_.length); } else { startPadded = startRow_; endPadded = endRow_; } currRow_ = startRow_; byte [] prependHeader = {1, 0}; bigStart_ = new BigInteger(Bytes.add(prependHeader, startPadded)); bigEnd_ = new BigInteger(Bytes.add(prependHeader, endPadded)); bigRange_ = new BigDecimal(bigEnd_.subtract(bigStart_)); LOG.info("setScan with ranges: " + bigStart_ + " - " + bigEnd_ + " ( " + bigRange_ + ")"); }
/** * Sets the HBase table. * * @param htable The table to scan. * @deprecated Use setTable() instead. */ @Deprecated public void setHTable(Table htable) { this.setTable(htable); }
this.tableRecordReader = new TableRecordReader(); sc.setStartRow(tSplit.getStartRow()); sc.setStopRow(tSplit.getEndRow()); trr.setScan(sc); trr.setTable(table); return new RecordReader<ImmutableBytesWritable, Result>() { trr.close(); connection.close(); throw ioe;
trr = new TableRecordReader(); trr.setScan(sc); trr.setHTable(table); trr.initialize(split, context); return trr;
LOG.info("Input split length: " + StringUtils.humanReadableInt(tSplit.getLength()) + " bytes."); final TableRecordReader trr = this.tableRecordReader != null ? this.tableRecordReader : new TableRecordReader(); Scan sc = new Scan(this.scan); sc.setStartRow(tSplit.getStartRow()); sc.setStopRow(tSplit.getEndRow()); trr.setScan(sc); trr.setTable(getTable()); return new RecordReader<ImmutableBytesWritable, Result>() {
@Override public float getProgress() throws IOException, InterruptedException { return trr.getProgress(); }
@Override public ImmutableBytesWritable getCurrentKey() throws IOException, InterruptedException { return trr.getCurrentKey(); }
@Override public Result getCurrentValue() throws IOException, InterruptedException { return trr.getCurrentValue(); }
this.tableRecordReader = new TableRecordReader(); sc.setStartRow(tSplit.getStartRow()); sc.setStopRow(tSplit.getEndRow()); trr.setScan(sc); trr.setTable(table); return new RecordReader<ImmutableBytesWritable, Result>() { trr.close(); connection.close(); throw ioe;
LOG.info("Input split length: " + StringUtils.humanReadableInt(tSplit.getLength()) + " bytes."); final TableRecordReader trr = this.tableRecordReader != null ? this.tableRecordReader : new TableRecordReader(); Scan sc = new Scan(this.scan); sc.setStartRow(tSplit.getStartRow()); sc.setStopRow(tSplit.getEndRow()); trr.setScan(sc); trr.setTable(getTable()); return new RecordReader<ImmutableBytesWritable, Result>() {