Examples of startUpdate()


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

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

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

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

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

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

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

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

      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

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

      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

Examples of org.apache.hadoop.hbase.io.BatchUpdate.startUpdate()

          metaRegionName + " with startcode " +
          Writables.bytesToLong(this.startCode) + " and server "+
          serverAddress.toString());
        try {
          BatchUpdate b = new BatchUpdate(rand.nextLong());
          long lockid = b.startUpdate(regionInfo.getRegionName());
          b.put(lockid, COL_SERVER,
            Writables.stringToBytes(serverAddress.toString()));
          b.put(lockid, COL_STARTCODE, startCode);
          server.batchUpdate(metaRegionName, System.currentTimeMillis(), b);
          if (isMetaTable) {
View Full Code Here

Examples of org.apache.hadoop.hbase.io.BatchUpdate.startUpdate()

        if (LOG.isDebugEnabled()) {
          LOG.debug("updating columns in row: " + i.getRegionName());
        }

        BatchUpdate b = new BatchUpdate(rand.nextLong());
        lockid = b.startUpdate(i.getRegionName());
        updateRegionInfo(b, i);
        b.delete(lockid, COL_SERVER);
        b.delete(lockid, COL_STARTCODE);
        server.batchUpdate(m.getRegionName(), System.currentTimeMillis(), b);
        if (LOG.isDebugEnabled()) {
View Full Code Here

Examples of org.apache.hadoop.hbase.io.BatchUpdate.startUpdate()

    protected void updateRegionInfo(HRegionInterface server, Text regionName,
        HRegionInfo i) throws IOException {

      BatchUpdate b = new BatchUpdate(rand.nextLong());
      long lockid = b.startUpdate(i.getRegionName());
      b.put(lockid, COL_REGIONINFO, Writables.getBytes(i));
      server.batchUpdate(regionName, System.currentTimeMillis(), b);
      if (LOG.isDebugEnabled()) {
        LOG.debug("updated columns in row: " + i.getRegionName());
      }
View Full Code Here

Examples of org.apache.hadoop.hbase.io.BatchUpdate.startUpdate()

   */
  static void offlineRegionInMETA(final HRegionInterface srvr,
      final Text metaRegionName, final HRegionInfo info)
  throws IOException {
    BatchUpdate b = new BatchUpdate(rand.nextLong());
    long lockid = b.startUpdate(info.getRegionName());
    info.setOffline(true);
    b.put(lockid, COL_REGIONINFO, Writables.getBytes(info));
    b.delete(lockid, COL_SERVER);
    b.delete(lockid, COL_STARTCODE);
    // If carrying splits, they'll be in place when we show up on new
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.