Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.HTable.startUpdate()


  throws IOException {
    HTable t = new HTable(c, HConstants.META_TABLE_NAME);
    byte [] cell = t.get(row, HConstants.COL_REGIONINFO);
    // Throws exception if null.
    HRegionInfo info = Writables.getHRegionInfo(cell);
    long id = t.startUpdate(row);
    info.setOffline(onlineOffline);
    t.put(id, HConstants.COL_REGIONINFO, Writables.getBytes(info));
    t.delete(id, HConstants.COL_SERVER);
    t.delete(id, HConstants.COL_STARTCODE);
    t.commit(id);
View Full Code Here


    // insert some data into the test table
    HTable table = new HTable(conf, new Text(TABLE_NAME));

    for (int i = 0; i < NUM_ROWS; i++) {
      long id = table.startUpdate(new Text("row_" + String.format("%1$05d", i)));

      table.put(id, TEXT_COLUMN1, VALUE);
      table.put(id, TEXT_COLUMN2, String.format("%1$05d", i).getBytes());
      table.commit(id);
    }
View Full Code Here

    // scanTableWithRowFilter(TABLE_NAME, false);

    // Do some identity write operations on one column of the data.
    for (int n = 0; n < NUM_REWRITES; n++) {
      for (int i = 0; i < NUM_ROWS; i++) {
        long id = table.startUpdate(new Text("row_" + String.format("%1$05d", i)));

        table.put(id, TEXT_COLUMN2, String.format("%1$05d", i).getBytes());
        table.commit(id);
      }
    }
View Full Code Here

    // Wait for the flush to happen
    LOG.info("Done. No flush should happen after this");

    // Do another round so to populate the mem cache
    for (int i = 0; i < NUM_ROWS; i++) {
      long id = table.startUpdate(new Text("row_" + String.format("%1$05d", i)));

      table.put(id, TEXT_COLUMN2, String.format("%1$05d", i).getBytes());
      table.commit(id);
    }
View Full Code Here

    // insert some data into the test table
    HTable table = new HTable(conf, new Text(SINGLE_REGION_TABLE_NAME));

    for(int i = 0; i < values.length; i++) {
      long lockid = table.startUpdate(new Text("row_"
          + String.format("%1$05d", i)));

      try {
        table.put(lockid, TEXT_INPUT_COLUMN, values[i]);
        table.commit(lockid, System.currentTimeMillis());
View Full Code Here

      throw new IllegalArgumentException("Column list is null");
    }
    try {
      HBaseAdmin admin = new HBaseAdmin(conf);
      HTable hTable = new HTable(conf, new Text(tableName));
      long lockID = hTable.startUpdate(new Text(rowKey));
      for (Text column : getColumnList(admin, hTable)) {
        hTable.delete(lockID, new Text(column));
      }
      hTable.commit(lockID);
      return new ReturnMsg(1, "Column(s) deleted successfully.");
View Full Code Here

      return new ReturnMsg(0,
          "Mismatch between values list and columnfamilies list");

    try {
      HTable table = new HTable(conf, this.tableName);
      long lockId = table.startUpdate(getRow());

      for (int i = 0; i < this.values.size(); i++) {
        Text column = null;
        if(getColumn(i).toString().contains(":"))
          column = getColumn(i);
View Full Code Here

    // insert some data into the test table
    HTable table = new HTable(conf, new Text(SINGLE_REGION_TABLE_NAME));

    try {
      for(int i = 0; i < values.length; i++) {
        long lockid = table.startUpdate(new Text("row_"
            + String.format("%1$05d", i)));

        try {
          table.put(lockid, TEXT_INPUT_COLUMN, values[i]);
          table.commit(lockid, System.currentTimeMillis());
View Full Code Here

    // insert some data into the test table
    HTable table = new HTable(conf, new Text(TABLE_NAME));

    for (int i = 0; i < NUM_ROWS; i++) {
      long id = table.startUpdate(new Text("row_" + String.format("%1$05d", i)));

      table.put(id, TEXT_COLUMN1, VALUE);
      table.put(id, TEXT_COLUMN2, String.format("%1$05d", i).getBytes());
      table.commit(id);
    }
View Full Code Here

    // scanTableWithRowFilter(TABLE_NAME, false);

    // Do some identity write operations on one column of the data.
    for (int n = 0; n < NUM_REWRITES; n++) {
      for (int i = 0; i < NUM_ROWS; i++) {
        long id = table.startUpdate(new Text("row_" + String.format("%1$05d", i)));

        table.put(id, TEXT_COLUMN2, String.format("%1$05d", i).getBytes());
        table.commit(id);
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.