Package org.apache.hadoop.hbase.client

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


      TestCoprocessorForTags.tags = null;

      increment = new Increment(row1);
      increment.add(new KeyValue(row1, f, q, 1234L, v));
      increment.setAttribute("visibility", Bytes.toBytes("tag2"));
      table.increment(increment);
      TestCoprocessorForTags.checkTagPresence = true;
      scanner = table.getScanner(new Scan());
      result = scanner.next();
      kv = KeyValueUtil.ensureKeyValue(result.getColumnLatestCell(f, q));
      tags = TestCoprocessorForTags.tags;
View Full Code Here


      put.add(f, q, v);
      table.put(put);
      increment = new Increment(row2);
      increment.add(new KeyValue(row2, f, q, 1234L, v));
      increment.setAttribute("visibility", Bytes.toBytes("tag2"));
      table.increment(increment);
      Scan scan = new Scan();
      scan.setStartRow(row2);
      TestCoprocessorForTags.checkTagPresence = true;
      scanner = table.getScanner(scan);
      result = scanner.next();
View Full Code Here

          new String[] {"hadPreIncrement", "hadPostIncrement", "hadPreIncrementAfterRowLock"},
          tableName,
          new Boolean[] {false, false, false}
          );

      table.increment(inc);

      verifyMethodResult(SimpleRegionObserver.class,
          new String[] {"hadPreIncrement", "hadPostIncrement", "hadPreIncrementAfterRowLock"},
          tableName,
          new Boolean[] {true, true, true}
View Full Code Here

  @Override
  public TResult increment(ByteBuffer table, TIncrement increment) throws TIOError, TException {
    Table htable = getTable(table);
    try {
      return resultFromHBase(htable.increment(incrementFromThrift(increment)));
    } catch (IOException e) {
      throw getTIOError(e);
    } finally {
      closeTable(htable);
    }
View Full Code Here

      put.add(f, q, v);
      put.setAttribute("visibility", Bytes.toBytes("tag1"));
      table.put(put);
      Increment increment = new Increment(row1);
      increment.addColumn(f, q, 1L);
      table.increment(increment);
      TestCoprocessorForTags.checkTagPresence = true;
      ResultScanner scanner = table.getScanner(new Scan());
      Result result = scanner.next();
      KeyValue kv = KeyValueUtil.ensureKeyValue(result.getColumnLatestCell(f, q));
      List<Tag> tags = TestCoprocessorForTags.tags;
View Full Code Here

      TestCoprocessorForTags.tags = null;

      increment = new Increment(row1);
      increment.add(new KeyValue(row1, f, q, 1234L, v));
      increment.setAttribute("visibility", Bytes.toBytes("tag2"));
      table.increment(increment);
      TestCoprocessorForTags.checkTagPresence = true;
      scanner = table.getScanner(new Scan());
      result = scanner.next();
      kv = KeyValueUtil.ensureKeyValue(result.getColumnLatestCell(f, q));
      tags = TestCoprocessorForTags.tags;
View Full Code Here

      put.add(f, q, v);
      table.put(put);
      increment = new Increment(row2);
      increment.add(new KeyValue(row2, f, q, 1234L, v));
      increment.setAttribute("visibility", Bytes.toBytes("tag2"));
      table.increment(increment);
      Scan scan = new Scan();
      scan.setStartRow(row2);
      TestCoprocessorForTags.checkTagPresence = true;
      scanner = table.getScanner(scan);
      result = scanner.next();
View Full Code Here

        Table t = new HTable(conf, TEST_TABLE.getTableName());
        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

        Table t = new HTable(conf, TEST_TABLE.getTableName());
        try {
          Increment inc = new Increment(TEST_ROW1);
          inc.setTimeRange(0, 127);
          inc.addColumn(TEST_FAMILY1, TEST_Q2, 2L);
          t.increment(inc);
          fail();
        } catch (Exception e) {

        } finally {
          t.close();
View Full Code Here

      @Override
      public Object run() throws Exception {
        Increment i = new Increment(TEST_ROW).addColumn(TEST_FAMILY, TEST_Q1, 1L);
        Table t = new HTable(conf, TEST_TABLE.getTableName());
        try {
          t.increment(i);
        } 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.