Package org.apache.hadoop.hbase.client

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


    for (int n = 0; n < NUM_REWRITES; n++) {
      for (int i = 0; i < NUM_ROWS; i++) {
        BatchUpdate b = new BatchUpdate("row_" + String.format("%1$05d", i));

        b.put(TEXT_COLUMN2, String.format("%1$05d", i).getBytes());
        table.commit(b);
      }
    }

    // Wait for the flush to happen
    LOG.info("Waiting, for flushes to complete");
View Full Code Here


    // Do another round so to populate the mem cache
    for (int i = 0; i < NUM_ROWS; i++) {
      BatchUpdate b = new BatchUpdate("row_" + String.format("%1$05d", i));
      b.put(TEXT_COLUMN2, String.format("%1$05d", i).getBytes());
      table.commit(b);
    }

    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

    HTable table = new HTable(conf, getName());
    try {
      byte[] value = Bytes.toBytes("somedata");
      BatchUpdate update = new BatchUpdate();
      update.put(colName, value);
      table.commit(update);
      fail("BatchUpdate on read only table succeeded")
    } catch (Exception e) {
      // expected
    }
  }
View Full Code Here

   
    BatchUpdate update = new BatchUpdate(oldRegionInfo.getRegionName());
    update.put(COL_REGIONINFO, Writables.getBytes(oldRegionInfo));
    update.put(COL_SPLITA, Writables.getBytes(newRegions[0].getRegionInfo()));
    update.put(COL_SPLITB, Writables.getBytes(newRegions[1].getRegionInfo()));
    t.commit(update);
   
    // Add new regions to META
    for (int i = 0; i < newRegions.length; i++) {
      update = new BatchUpdate(newRegions[i].getRegionName());
      update.put(COL_REGIONINFO, Writables.getBytes(
View Full Code Here

    for (int i = 0; i < NUM_ROWS; i++) {
      BatchUpdate b = new BatchUpdate("row_" + String.format("%1$05d", i));
      b.put(TEXT_COLUMN1, VALUE);
      b.put(TEXT_COLUMN2, String.format("%1$05d", i).getBytes());
      table.commit(b);
    }

    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

            batchUpdate = new BatchUpdate(Bytes.toBytes(
                "00".substring(v.length()) + v));
            batchUpdate.put(TESTCOLUMN_A, Bytes.toBytes(v));
            batchUpdate.put(TESTCOLUMN_B, Bytes.toBytes(v));
            batchUpdate.put(TESTCOLUMN_C, Bytes.toBytes("TEXT" + i));
            table.commit(batchUpdate);
        }
    }
   
    private void deleteTable() throws IOException {
        // delete the table
View Full Code Here

            batchUpdate.delete(m.column);
          } else {
            batchUpdate.put(m.column, m.value);
          }
        }
        table.commit(batchUpdate);
      } catch (IOException e) {
        throw new IOError(e.getMessage());
      } catch (IllegalArgumentException e) {
        throw new IllegalArgument(e.getMessage());
      }
View Full Code Here

      }

      HTable table = null;
      try {
        table = getTable(tableName);
        table.commit(batchUpdates);
      } catch (IOException e) {
        throw new IOError(e.getMessage());
      } catch (IllegalArgumentException e) {
        throw new IllegalArgument(e.getMessage());
      }
View Full Code Here

            batchUpdate = new BatchUpdate(Bytes.toBytes(
                "00".substring(v.length()) + v));
            batchUpdate.put(TESTCOLUMN_A, Bytes.toBytes(v));
            batchUpdate.put(TESTCOLUMN_B, Bytes.toBytes(v));
            batchUpdate.put(TESTCOLUMN_C, Bytes.toBytes("TEXT" + i));
            table.commit(batchUpdate);
        }
    }
   
    private void deleteTable() throws IOException {
        // delete the table
View Full Code Here

            batchUpdate.delete(getText(m.column));
          } else {
            batchUpdate.put(getText(m.column), m.value);
          }
        }
        table.commit(batchUpdate);
      } catch (IOException e) {
        throw new IOError(e.getMessage());
      } catch (IllegalArgumentException e) {
        throw new IllegalArgument(e.getMessage());
      }
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.