Package org.apache.hadoop.hbase.io

Examples of org.apache.hadoop.hbase.io.BatchUpdate


    long transaction1Id = 1;
    long transaction2Id = 2;
    logMangaer.writeStartToLog(transaction1Id);

    BatchUpdate update1 = new BatchUpdate(row1);
    update1.put(col, val1);
    logMangaer.writeUpdateToLog(transaction1Id, update1);

    logMangaer.writeStartToLog(transaction2Id);
   
    BatchUpdate update2 = new BatchUpdate(row2);
    update2.put(col, val2);
    logMangaer.writeUpdateToLog(transaction2Id, update2);

    BatchUpdate update3 = new BatchUpdate(row3);
    update3.put(col, val3);
    logMangaer.writeUpdateToLog(transaction1Id, update3);

    logMangaer.writeCommitToLog(transaction2Id);
    logMangaer.writeCommitToLog(transaction1Id);
View Full Code Here


    long transaction1Id = 1;
    long transaction2Id = 2;
    logMangaer.writeStartToLog(transaction1Id);

    BatchUpdate update1 = new BatchUpdate(row1);
    update1.put(col, val1);
    logMangaer.writeUpdateToLog(transaction1Id, update1);

    logMangaer.writeStartToLog(transaction2Id);
   
    BatchUpdate update2 = new BatchUpdate(row2);
    update2.put(col, val2);
    logMangaer.writeUpdateToLog(transaction2Id, update2);

    logMangaer.writeAbortToLog(transaction2Id);
   
    BatchUpdate update3 = new BatchUpdate(row3);
    update3.put(col, val3);
    logMangaer.writeUpdateToLog(transaction1Id, update3);

    logMangaer.writeCommitToLog(transaction1Id);

    // log.completeCacheFlush(regionName, tableName, logSeqId);
View Full Code Here

    long transaction1Id = 1;
    long transaction2Id = 2;
    logMangaer.writeStartToLog(transaction1Id);

    BatchUpdate update1 = new BatchUpdate(row1);
    update1.put(col, val1);
    logMangaer.writeUpdateToLog(transaction1Id, update1);

    logMangaer.writeStartToLog(transaction2Id);
   
    BatchUpdate update2 = new BatchUpdate(row2);
    update2.put(col, val2);
    logMangaer.writeUpdateToLog(transaction2Id, update2);

    logMangaer.writeCommitToLog(transaction2Id);
   
    BatchUpdate update3 = new BatchUpdate(row3);
    update3.put(col, val3);
    logMangaer.writeUpdateToLog(transaction1Id, update3);

    logMangaer.writeAbortToLog(transaction1Id);

    // log.completeCacheFlush(regionName, tableName, logSeqId);
View Full Code Here

        admin.createTable(tabledesc);
       
        // put some data into table
        HTable table = new HTable(conf, TESTTABLE);
       
        BatchUpdate batchUpdate;
       
        for(int i = 0 ; i < TEST_ROW_COUNT ; i++) {
            String v = Integer.toString(i);
            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);
        }
    }
View Full Code Here

      // 3. Insert into meta
         
      HRegionInfo info = region.getRegionInfo();
      Text regionName = region.getRegionName();
      BatchUpdate b = new BatchUpdate(rand.nextLong());
      long lockid = b.startUpdate(regionName);
      b.put(lockid, COL_REGIONINFO, Writables.getBytes(info));
      server.batchUpdate(metaRegionName, b);

      // 4. Close the new region to flush it to disk.  Close its log file too.
     
      region.close();
View Full Code Here

      if (LOG.isDebugEnabled()) {
        LOG.debug(split.getRegionName().toString()
            +" no longer has references to " + parent.toString());
      }
     
      BatchUpdate b = new BatchUpdate(rand.nextLong());
      long lockid = b.startUpdate(parent);
      b.delete(lockid, splitColumn);
      srvr.batchUpdate(metaRegionName, b);
       
      return result;
    }
View Full Code Here

        LOG.info("updating row " + regionInfo.getRegionName() + " in table " +
          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, b);
          if (isMetaTable) {
            // It's a meta region.
            MetaRegion m = new MetaRegion(this.serverAddress,
              this.regionInfo.getRegionName(), this.regionInfo.getStartKey());
View Full Code Here

       
        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(), b);
        if (LOG.isDebugEnabled()) {
          LOG.debug("updated columns in row: " + i.getRegionName());
        }
View Full Code Here

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

        BatchUpdate b = new BatchUpdate(rand.nextLong());
        long lockid = b.startUpdate(i.getRegionName());
        updateRegionInfo(lockid, b, i);
        server.batchUpdate(m.getRegionName(), b);
        if (LOG.isDebugEnabled()) {
          LOG.debug("updated columns in row: " + i.getRegionName());
        }
View Full Code Here

    }

    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, b);
      if (LOG.isDebugEnabled()) {
        LOG.debug("updated columns in row: " + i.getRegionName());
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.io.BatchUpdate

Copyright © 2018 www.massapicom. 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.