Package org.apache.hadoop.hbase

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


    // 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(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

            + new String(row) + ", col=" + new String(column)
            + ", value.length=" + value.length);
      }
      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

      Long lockid = null;
      HTable table = null;
     
      try {
        table = getTable(tableName);
        lockid = table.startUpdate(getText(row));
        for (Mutation m : mutations) {
          if (m.isDelete) {
            table.delete(lockid, getText(m.column));
          } else {
            table.put(lockid, getText(m.column), m.value);
View Full Code Here

      HBaseAdmin admin = new HBaseAdmin(conf);
      HTable hTable = new HTable(conf, tableName);

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

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

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

      for (int i = 0; i < 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

  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

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.