Package org.apache.hadoop.hbase

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


    // 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);
    }

    LOG.info("Print table contents using scanner after map/reduce for " + TABLE_NAME);
    scanTable(TABLE_NAME, true);
    LOG.info("Print table contents using scanner+filter after map/reduce for " + TABLE_NAME);
View Full Code Here


    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);
    }

    LOG.info("Print table contents using scanner before map/reduce for " + TABLE_NAME);
    scanTable(TABLE_NAME, true);
    LOG.info("Print table contents using scanner+filter before map/reduce for " + TABLE_NAME);
View Full Code Here

      }
      try {
        HTable table = getTable(tableName);
        long lockid = table.startUpdate(getText(row));
        table.put(lockid, getText(column), value);
        table.commit(lockid);
      } catch (IOException e) {
        throw new IOError(e.getMessage());
      }
    }
   
View Full Code Here

            table.delete(lockid, getText(m.column));
          } else {
            table.put(lockid, getText(m.column), m.value);
          }
        }
        table.commit(lockid, timestamp);
      } catch (IOException e) {
        if (lockid != null) {
          table.abort(lockid);
        }
        throw new IOError(e.getMessage());
View Full Code Here

      if (rowKey != null) {
        long lockID = hTable.startUpdate(rowKey);
        for (Text column : getColumnList(admin, hTable)) {
          hTable.delete(lockID, new Text(column));
        }
        hTable.commit(lockID);
      } else {
        admin.disableTable(tableName);
        for (Text column : getColumnList(admin, hTable)) {
          admin.deleteColumn(tableName, new Text(column));
        }
View Full Code Here

          column = new Text(getColumn(i) + ":");
        table.put(lockId, column, getValue(i));
      }
     
      if(timestamp != null)
        table.commit(lockId, Long.parseLong(timestamp));
      else
        table.commit(lockId);

      return new ReturnMsg(1, "1 row inserted successfully.");
    } catch (IOException e) {
View Full Code Here

      }
     
      if(timestamp != null)
        table.commit(lockId, Long.parseLong(timestamp));
      else
        table.commit(lockId);

      return new ReturnMsg(1, "1 row inserted successfully.");
    } catch (IOException e) {
      String[] msg = e.getMessage().split("[\n]");
      return new ReturnMsg(0, msg[0]);
View Full Code Here

        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());
          lockid = -1;
        } finally {
          if (lockid != -1)
            table.abort(lockid);
        }
View Full Code Here

    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

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.