Examples of incrementColumnValue()


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

        try {
          Increment inc = new Increment(TEST_ROW1);
          inc.setTimeRange(0, 123);
          inc.addColumn(TEST_FAMILY1, TEST_Q1, 2L);
          t.increment(inc);
          t.incrementColumnValue(TEST_ROW1, TEST_FAMILY1, TEST_Q2, 1L);
        } finally {
          t.close();
        }
        return null;
      }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HTableInterface.incrementColumnValue()

       byte[] row = randomRowKey();
       Put put = new Put(row);
       put.add(cf, row, Bytes.toBytes(10L));
       hTable.put(put);

       hTable.incrementColumnValue(row, cf, row, 5);

       Result result = hTable.get(new Get(row));
       Assert.assertEquals(15L, Bytes.toLong(result.value()));
       assertMetricsUpdated(OpType.PUT, OpType.INCREMENT, OpType.GET);
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HTableInterface.incrementColumnValue()

       byte[] row = randomRowKey();
       Put put = new Put(row);
       put.add(cf, row, Bytes.toBytes(10L));
       hTable.put(put);

       hTable.incrementColumnValue(row, cf, row, 5, true);

       Result result = hTable.get(new Get(row));
       Assert.assertEquals(15L, Bytes.toLong(result.value()));
       assertMetricsUpdated(OpType.PUT, OpType.INCREMENT, OpType.GET);
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HTableInterface.incrementColumnValue()

    }

    public long incrementColumnValue(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, long amount, boolean writeToWAL) throws AIOError {
      HTableInterface htable = htablePool.getTable(Bytes.toBytes(table));
      try {
  return htable.incrementColumnValue(Bytes.toBytes(row), Bytes.toBytes(family), Bytes.toBytes(qualifier), amount, writeToWAL);
      } catch (IOException e) {
        AIOError ioe = new AIOError();
        ioe.message = new Utf8(e.getMessage());
        throw ioe;
      } finally {
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HTableInterface.incrementColumnValue()

    }

    public long incrementColumnValue(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, long amount, boolean writeToWAL) throws AIOError {
      HTableInterface htable = htablePool.getTable(Bytes.toBytes(table));
      try {
  return htable.incrementColumnValue(Bytes.toBytes(row), Bytes.toBytes(family), Bytes.toBytes(qualifier), amount, writeToWAL);
      } catch (IOException e) {
        AIOError ioe = new AIOError();
        ioe.message = new Utf8(e.getMessage());
        throw ioe;
      } finally {
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HTableInterface.incrementColumnValue()

    }

    public long incrementColumnValue(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, long amount, boolean writeToWAL) throws AIOError {
      HTableInterface htable = htablePool.getTable(Bytes.toBytes(table));
      try {
  return htable.incrementColumnValue(Bytes.toBytes(row), Bytes.toBytes(family), Bytes.toBytes(qualifier), amount, writeToWAL);
      } catch (IOException e) {
        AIOError ioe = new AIOError();
        ioe.message = new Utf8(e.getMessage());
        throw ioe;
      } finally {
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HTableInterface.incrementColumnValue()

        if(docId != null) {
          // we've indexed this doc previously
          docNumber = Bytes.toInt(docId);
          doc.addField("edit", true);
        } else {
          docNumber = new Long(seqTable.incrementColumnValue(Bytes.toBytes("sequence"), Bytes.toBytes("id"), Bytes.toBytes(""), 1, true)).intValue();
        }
       
        doc.addField("docId", docNumber);
        doc.addField("global_uniq_id", id);
        doc.addField("cat", cat);
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.incrementColumnValue()

          try {
            Table table = handler.getTable(row.getTable());
            if (failures > 2) {
              throw new IOException("Auto-Fail rest of ICVs");
            }
            table.incrementColumnValue(row.getRowKey(), row.getFamily(), row.getQualifier(),
              counter);
          } catch (IOException e) {
            // log failure of increment
            failures++;
            LOG.error("FAILED_ICV: " + Bytes.toString(row.getTable()) + ", "
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.incrementColumnValue()

      table.put(put);
      Get get = new Get(row1);
      get.setAuthorizations(new Authorizations(SECRET));
      Result result = table.get(get);
      assertTrue(result.isEmpty());
      table.incrementColumnValue(row1, fam, qual, 2L);
      result = table.get(get);
      assertTrue(result.isEmpty());
      Increment increment = new Increment(row1);
      increment.addColumn(fam, qual, 2L);
      increment.setCellVisibility(new CellVisibility(SECRET));
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.incrementColumnValue()

        try {
          Increment inc = new Increment(TEST_ROW1);
          inc.setTimeRange(0, 123);
          inc.addColumn(TEST_FAMILY1, TEST_Q1, 2L);
          t.increment(inc);
          t.incrementColumnValue(TEST_ROW1, TEST_FAMILY1, TEST_Q2, 1L);
        } finally {
          t.close();
        }
        return null;
      }
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.