Package org.hbase.async

Examples of org.hbase.async.PutRequest


            break;
          default:
            rowKey = SimpleRowKeyGenerator.getUUIDKey(rowPrefix);
            break;
        }
        PutRequest putRequest =  new PutRequest(table, rowKey, cf,
            payloadColumn, payload);
        actions.add(putRequest);
      } catch (Exception e){
        throw new FlumeException("Could not get row key!", e);
      }
View Full Code Here


      super(conf, options, status);
    }

    @Override
    void testRow(final int i) {
      final PutRequest put = new PutRequest(tableName, getRandomRow(this.rand, this.totalRows),
                                            FAMILY_NAME, QUALIFIER_NAME, generateValue(this.rand));
      put.setDurable(writeToWAL);
      put.setBufferable(flushCommits);
      client().put(put).addCallbacks(callback, errback);
    }
View Full Code Here

      super(conf, options, status);
    }

    @Override
    void testRow(final int i) {
      final PutRequest put = new PutRequest(tableName, format(i),
                                            FAMILY_NAME, QUALIFIER_NAME, generateValue(this.rand));
      put.setDurable(writeToWAL);
      put.setBufferable(flushCommits);
      client().put(put).addCallbacks(callback, errback);
    }
View Full Code Here

            break;
          default:
            rowKey = SimpleRowKeyGenerator.getUUIDKey(rowPrefix);
            break;
        }
        PutRequest putRequest =  new PutRequest(table, rowKey, cf,
            payloadColumn, payload);
        actions.add(putRequest);
      } catch (Exception e){
        throw new FlumeException("Could not get row key!", e);
      }
View Full Code Here

      if (args[1].charAt(0) == 'l') {  // locked version of the command
        final RowLockRequest rlr = new RowLockRequest(args[2], args[3]);
        lock = client.lockRow(rlr).joinUninterruptibly();
        LOG.info("Acquired explicit row lock: " + lock);
      }
      final PutRequest put = lock == null
        ? new PutRequest(args[2], args[3], args[4], args[5], args[7])
        : new PutRequest(args[2], args[3], args[4], args[5], args[7], lock);
      final String expected = args[6];
      args = null;
      try {
        final boolean ok = client.compareAndSet(put, expected).joinUninterruptibly();
        LOG.info("CAS "
View Full Code Here

  /** Write a single thing to HBase and read it back. */
  @Test
  public void putRead() throws Exception {
    client.setFlushInterval(FAST_FLUSH);
    final double write_time = System.currentTimeMillis();
    final PutRequest put = new PutRequest(table, "k", family, "q", "val");
    final GetRequest get = new GetRequest(table, "k", family, "q");
    client.put(put).join();
    final ArrayList<KeyValue> kvs = client.get(get).join();
    assertSizeIs(1, kvs);
    final KeyValue kv = kvs.get(0);
View Full Code Here

  /** Write a single thing to HBase and read it back, delete it, read it. */
  @Test
  public void putReadDeleteRead() throws Exception {
    client.setFlushInterval(FAST_FLUSH);
    final PutRequest put = new PutRequest(table, "k", family, "q", "val");
    final GetRequest get = new GetRequest(table, "k", family, "q");
    client.put(put).join();
    final ArrayList<KeyValue> kvs = client.get(get).join();
    assertSizeIs(1, kvs);
    assertEq("val", kvs.get(0).value());
View Full Code Here

    // Make the qualifier unique to avoid running into HBASE-9879.
    byte[] q = ("q" + System.currentTimeMillis()
                + "-" + System.nanoTime()).getBytes();
    byte[] v1 = "val1".getBytes();
    byte[] v2 = "val2".getBytes();
    final PutRequest put1 = new PutRequest(t, k, f, q, v1, 100L);
    final PutRequest put2 = new PutRequest(t, k, f, q, v2, 200L);
    client.put(put1).join();
    client.put(put2).join();
    final GetRequest get = new GetRequest(t, k, f, q).maxVersions(2);
    final ArrayList<KeyValue> kvs = client.get(get).join();
    assertSizeIs(2, kvs);
View Full Code Here

  /** Basic scan test. */
  @Test
  public void basicScan() throws Exception {
    client.setFlushInterval(FAST_FLUSH);
    final PutRequest put1 = new PutRequest(table, "s1", family, "q", "v1");
    final PutRequest put2 = new PutRequest(table, "s2", family, "q", "v2");
    final PutRequest put3 = new PutRequest(table, "s3", family, "q", "v3");
    Deferred.group(client.put(put1), client.put(put2),
                   client.put(put3)).join();
    // Scan the same 3 rows created above twice.
    for (int i = 0; i < 2; i++) {
      LOG.info("------------ iteration #" + i);
View Full Code Here

  /** Scan with multiple qualifiers. */
  @Test
  public void scanWithQualifiers() throws Exception {
    client.setFlushInterval(FAST_FLUSH);
    final PutRequest put1 = new PutRequest(table, "k", family, "a", "val1");
    final PutRequest put2 = new PutRequest(table, "k", family, "b", "val2");
    final PutRequest put3 = new PutRequest(table, "k", family, "c", "val3");
    Deferred.group(client.put(put1), client.put(put2),
                   client.put(put3)).join();
    final Scanner scanner = client.newScanner(table);
    scanner.setFamily(family);
    scanner.setQualifiers(new byte[][] { { 'a' }, { 'c' } });
View Full Code Here

TOP

Related Classes of org.hbase.async.PutRequest

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.