Examples of PutRequest


Examples of org.hbase.async.PutRequest

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

Examples of org.hbase.async.PutRequest

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

Examples of org.hbase.async.PutRequest

  /** Write a few KVs and delete them in one batch */
  @Test
  public void multiDelete() throws Exception {
    client.setFlushInterval(FAST_FLUSH);
    final PutRequest put2 = new PutRequest(table, "mdk1", family, "q2", "val2");
    client.put(put2).join();
    final PutRequest put3 = new PutRequest(table, "mdk2", family, "q3", "val3");
    client.put(put3).join();
    final PutRequest put1 = new PutRequest(table, "mdk1", family, "q1", "val1");
    client.put(put1).join();
    final DeleteRequest del2 = new DeleteRequest(table, "mdk1", family, "q2");
    final DeleteRequest del3 = new DeleteRequest(table, "mdk2", family, "q3");
    final DeleteRequest del1 = new DeleteRequest(table, "mdk1", family, "q1");
    Deferred.group(client.delete(del2), client.delete(del3),
View Full Code Here

Examples of org.hbase.async.PutRequest

    client.setFlushInterval(FAST_FLUSH);
    final String table1 = args[0] + "1";
    final String table2 = args[0] + "2";
    createOrTruncateTable(client, table1, family);
    createOrTruncateTable(client, table2, family);
    final PutRequest put2 = new PutRequest(table1, "mdk1", family, "q2", "val2");
    client.put(put2).join();
    final PutRequest put3 = new PutRequest(table1, "mdk2", family, "q3", "val3");
    client.put(put3).join();
    final PutRequest put1 = new PutRequest(table2, "mdk1", family, "q1", "val1");
    client.put(put1).join();
    final DeleteRequest del2 = new DeleteRequest(table1, "mdk1", family, "q2");
    final DeleteRequest del3 = new DeleteRequest(table1, "mdk2", family, "q3");
    final DeleteRequest del1 = new DeleteRequest(table2, "mdk1", family, "q1");
    Deferred.group(client.delete(del2), client.delete(del3),
View Full Code Here

Examples of org.hbase.async.PutRequest

  /** Attempt to write a column family that doesn't exist. */
  @Test
  public void putNonexistentFamily() throws Exception {
    client.setFlushInterval(FAST_FLUSH);
    final PutRequest put = new PutRequest(table, "k", family + family,
                                          "q", "val");
    try {
      client.put(put).join();
    } catch (NoSuchColumnFamilyException e) {
      assertEquals(put, e.getFailedRpc());
View Full Code Here

Examples of org.hbase.async.PutRequest

  /** Send a bunch of edits with one that references a non-existent family. */
  @Test
  public void multiPutWithOneBadRpcInBatch() throws Exception {
    client.setFlushInterval(FAST_FLUSH);
    final PutRequest put1 = new PutRequest(table, "mk1", family, "m1", "mpb1");
    // The following edit is destined to a non-existent family.
    final PutRequest put2 = new PutRequest(table, "mk2", family + family,
                                           "m2", "mpb2");
    final PutRequest put3 = new PutRequest(table, "mk3", family, "m3", "mpb3");
    try {
      final ArrayList<Deferred<Object>> ds = new ArrayList<Deferred<Object>>(3);
      ds.add(client.put(put1));
      ds.add(client.put(put2));
      ds.add(client.put(put3));
View Full Code Here

Examples of org.hbase.async.PutRequest

  /** Test regexp-based row key filtering.  */
  @Test
  public void keyRegexpFilter() throws Exception {
    client.setFlushInterval(FAST_FLUSH);
    final PutRequest put1 = new PutRequest(table, "krf accept:by the filter",
                                           family, "q", "krfv1");
    final PutRequest put2 = new PutRequest(table, "krf filtered out",
                                           family, "q", "krfv2");
    final PutRequest put3 = new PutRequest(table, "krf this is Accepted too",
                                           family, "q", "krfv3");
    Deferred.group(client.put(put1), client.put(put2),
                   client.put(put3)).join();
    final Scanner scanner = client.newScanner(table);
    scanner.setFamily(family);
View Full Code Here

Examples of org.hbase.async.PutRequest

  /** Simple column prefix filter tests.  */
  @Test
  public void columnPrefixFilter() throws Exception {
    client.setFlushInterval(FAST_FLUSH);
    // Keep only rows with a column qualifier that starts with "qa".
    final PutRequest put1 = new PutRequest(table, "cpf1", family, "qa1", "v1");
    final PutRequest put2 = new PutRequest(table, "cpf1", family, "qa2", "v2");
    final PutRequest put3 = new PutRequest(table, "cpf2", family, "qa3", "v3");
    final PutRequest put4 = new PutRequest(table, "cpf2", family, "qb4", "v4");
    Deferred.group(Deferred.group(client.put(put1), client.put(put2)),
                   Deferred.group(client.put(put3), client.put(put4))).join();
    final Scanner scanner = client.newScanner(table);
    scanner.setFamily(family);
    scanner.setStartKey("cpf1");
View Full Code Here

Examples of org.hbase.async.PutRequest

  @Test
  public void columnRangeFilter() throws Exception {
    client.setFlushInterval(FAST_FLUSH);
    // Keep rows that have a qualifier in between "qb" (inclusive) and "qd4"
    // (exclusive).  So only v2 and v3 should be returned by the scanner.
    final PutRequest put1 = new PutRequest(table, "crf1", family, "qa1", "v1");
    final PutRequest put2 = new PutRequest(table, "crf1", family, "qb2", "v2");
    final PutRequest put3 = new PutRequest(table, "crf2", family, "qc3", "v3");
    final PutRequest put4 = new PutRequest(table, "crf2", family, "qd4", "v4");
    Deferred.group(Deferred.group(client.put(put1), client.put(put2)),
                   Deferred.group(client.put(put3), client.put(put4))).join();
    final Scanner scanner = client.newScanner(table);
    scanner.setFamily(family);
    scanner.setStartKey("crf1");
View Full Code Here

Examples of org.hbase.async.PutRequest

  }

  @Test
  public void filterComparators() throws Exception {
    client.setFlushInterval(FAST_FLUSH);
    final PutRequest put1 = new PutRequest(table, "fc1", family, "a", "v1");
    final PutRequest put2 = new PutRequest(table, "fc2", family, "a", "v2");
    final PutRequest put3 = new PutRequest(table, "fc3", family, "a", "v3");
    Deferred.group(client.put(put1), client.put(put2), client.put(put3)).join();

    final Scanner binary_scanner = client.newScanner(table);
    binary_scanner.setStartKey("fc1");
    binary_scanner.setStopKey("fc4");
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.