Package org.apache.hadoop.hbase.mapreduce

Examples of org.apache.hadoop.hbase.mapreduce.TableInputFormat


class HBaseInputFormat implements InputFormat<ImmutableBytesWritable, Result> {

    private final TableInputFormat inputFormat;

    public HBaseInputFormat() {
        inputFormat = new TableInputFormat();
    }
View Full Code Here


        return null;
    }

    @Override
    public InputFormat getInputFormat() {     
        TableInputFormat inputFormat = new HBaseTableIFBuilder()
        .withLimit(limit_)
        .withGt(gt_)
        .withGte(gte_)
        .withLt(lt_)
        .withLte(lte_)
View Full Code Here

class HBaseInputFormat implements InputFormat<ImmutableBytesWritable, ResultWritable> {

  private final TableInputFormat inputFormat;

  public HBaseInputFormat() {
    inputFormat = new TableInputFormat();
  }
View Full Code Here

        return null;
    }

    @Override
    public InputFormat getInputFormat() {
        TableInputFormat inputFormat = new HBaseTableIFBuilder()
        .withLimit(limit_)
        .withGt(gt_)
        .withGte(gte_)
        .withLt(lt_)
        .withLte(lte_)
        .withConf(m_conf)
        .build();
        inputFormat.setScan(scan);
        return inputFormat;
    }
View Full Code Here

  @Override
  public RecordReader<E, Void> createRecordReader(InputSplit inputSplit,
      TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException {
    Configuration conf = Hadoop.TaskAttemptContext
        .getConfiguration.invoke(taskAttemptContext);
    TableInputFormat delegate = getDelegate(conf);
    RecordReader<E, Void> unfilteredRecordReader = new HBaseRecordReaderWrapper<E>(
        delegate.createRecordReader(inputSplit, taskAttemptContext), entityMapper);
    if (view != null) {
      // use the constraints to filter out entities from the reader
      return new FilteredRecordReader<E>(unfilteredRecordReader,
          view.getConstraints(), view.getAccessor());
    }
View Full Code Here

    }
    return unfilteredRecordReader;
  }

  private TableInputFormat getDelegate(Configuration conf) throws IOException {
    TableInputFormat delegate = new TableInputFormat();
    String tableName = HBaseMetadataProvider.getTableName(dataset.getName());
    conf.set(TableInputFormat.INPUT_TABLE, tableName);
    if (view != null) {
      Job tempJob = new Job();
      Scan scan = ((BaseEntityScanner) view.newEntityScanner()).getScan();
      TableMapReduceUtil.initTableMapperJob(tableName, scan, TableMapper.class, null,
          null, tempJob);
      Configuration tempConf = Hadoop.JobContext.getConfiguration.invoke(tempJob);
      conf.set(SCAN, tempConf.get(SCAN));
    }
    delegate.setConf(conf);
    return delegate;
  }
View Full Code Here

        return null;
    }

    @Override
    public InputFormat getInputFormat() {     
        TableInputFormat inputFormat = new HBaseTableIFBuilder()
        .withLimit(limit_)
        .withGt(gt_)
        .withGte(gte_)
        .withLt(lt_)
        .withLte(lte_)
View Full Code Here

        return null;
    }

    @Override
    public InputFormat getInputFormat() {     
        TableInputFormat inputFormat = new HBaseTableIFBuilder()
        .withLimit(limit_)
        .withGt(gt_)
        .withGte(gte_)
        .withLt(lt_)
        .withLte(lte_)
View Full Code Here

        return null;
    }

    @Override
    public InputFormat getInputFormat() {     
        TableInputFormat inputFormat = new HBaseTableIFBuilder()
        .withLimit(limit_)
        .withGt(gt_)
        .withGte(gte_)
        .withLt(lt_)
        .withLte(lte_)
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.mapreduce.TableInputFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.