Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.HBaseConfiguration


  /**
   * @param args
   * @throws Exception
   */
  public static void main(String[] args) throws Exception {
    HBaseConfiguration c = new HBaseConfiguration();
    int errCode = ToolRunner.run(c, new RowCounter(), args);
    System.exit(errCode);
  }
View Full Code Here


     * Constructs an HBaseHandler object.
     *
     * @throws MasterNotRunningException
     */
    HBaseHandler() throws MasterNotRunningException {
      conf = new HBaseConfiguration();
      admin = new HBaseAdmin(conf);
      scannerMap = new HashMap<Integer, Scanner>();
    }
View Full Code Here

    job.set(TableOutputFormat.OUTPUT_TABLE, table);
    job.setOutputKeyClass(ImmutableBytesWritable.class);
    job.setOutputValueClass(BatchUpdate.class);
    if (partitioner == HRegionPartitioner.class) {
      job.setPartitionerClass(HRegionPartitioner.class);
      HTable outputTable = new HTable(new HBaseConfiguration(job), table);
      int regions = outputTable.getRegionsInfo().size();
      if (job.getNumReduceTasks() > regions) {
        job.setNumReduceTasks(outputTable.getRegionsInfo().size());
      }
    } else if (partitioner != null) {
View Full Code Here

   * @param job  The current job configuration to adjust.
   * @throws IOException When retrieving the table details fails.
   */
  public void limitNumReduceTasks(String table, JobConf job)
  throws IOException {
    HTable outputTable = new HTable(new HBaseConfiguration(job), table);
    int regions = outputTable.getRegionsInfo().size();
    if (job.getNumReduceTasks() > regions)
      job.setNumReduceTasks(regions);
  }
View Full Code Here

   * @param job  The current job configuration to adjust.
   * @throws IOException When retrieving the table details fails.
   */
  public void limitNumMapTasks(String table, JobConf job)
  throws IOException {
    HTable outputTable = new HTable(new HBaseConfiguration(job), table);
    int regions = outputTable.getRegionsInfo().size();
    if (job.getNumMapTasks() > regions)
      job.setNumMapTasks(regions);
  }
View Full Code Here

   * @param job  The current job configuration to adjust.
   * @throws IOException When retrieving the table details fails.
   */
  public void setNumReduceTasks(String table, JobConf job)
  throws IOException {
    HTable outputTable = new HTable(new HBaseConfiguration(job), table);
    int regions = outputTable.getRegionsInfo().size();
    job.setNumReduceTasks(regions);
  }
View Full Code Here

   * @param job  The current job configuration to adjust.
   * @throws IOException When retrieving the table details fails.
   */
  public void setNumMapTasks(String table, JobConf job)
  throws IOException {
    HTable outputTable = new HTable(new HBaseConfiguration(job), table);
    int regions = outputTable.getRegionsInfo().size();
    job.setNumMapTasks(regions);
  }
View Full Code Here

  private static final String MIGRATION_LINK =
    " See http://wiki.apache.org/hadoop/Hbase/HowToMigrate for more information.";

  /** default constructor */
  public Migrate() {
    this(new HBaseConfiguration());
  }
View Full Code Here

    for (int i = 0; i < m_cols.length; i++) {
      m_cols[i] = Bytes.toBytes(colNames[i]);
    }
    setInputColumns(m_cols);
    try {
      setHTable(new HTable(new HBaseConfiguration(job), tableNames[0].getName()));
    } catch (Exception e) {
      LOG.error(e);
    }
  }
View Full Code Here

  private HTable table;
  private byte[][] startKeys;
 
  public void configure(JobConf job) {
    try {
      this.table = new HTable(new HBaseConfiguration(job),
        job.get(TableOutputFormat.OUTPUT_TABLE));
    } catch (IOException e) {
      LOG.error(e);
    }
   
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.HBaseConfiguration

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.