Package org.hbase.async

Examples of org.hbase.async.GetRequest


       * @return The results of the {@link #StoreUIDMeta} callback
       */
      @Override
      public Deferred<Boolean> call(final String name) throws Exception {

        final GetRequest get = new GetRequest(tsdb.uidTable(),
            UniqueId.stringToUid(uid));
        get.family(FAMILY);
        get.qualifier((type.toString().toLowerCase() + "_meta").getBytes(CHARSET));
       
        // #2 deferred
        return tsdb.getClient().get(get)
          .addCallbackDeferring(new StoreUIDMeta());
      }
View Full Code Here


            return Deferred.fromResult(meta);
          }
         
        }
       
        final GetRequest get = new GetRequest(tsdb.uidTable(), uid);
        get.family(FAMILY);
        get.qualifier((type.toString().toLowerCase() + "_meta").getBytes(CHARSET));
        return tsdb.getClient().get(get).addCallbackDeferring(new FetchMetaCB());
      }
    }
   
    // verify that the UID is still in the map before fetching from storage
View Full Code Here

       * @return The results of the {@link #StoreUIDMeta} callback
       */
      @Override
      public Deferred<Boolean> call(final String name) throws Exception {

        final GetRequest get = new GetRequest(tsdb.uidTable(),
            UniqueId.stringToUid(uid));
        get.family(FAMILY);
        get.qualifier((type.toString().toLowerCase() + "_meta").getBytes(CHARSET));
       
        // #2 deferred
        return tsdb.getClient().get(get)
          .addCallbackDeferring(new StoreUIDMeta());
      }
View Full Code Here

    return scanner;
  }

  /** Returns the cell of the specified row key, using family:kind. */
  private Deferred<byte[]> hbaseGet(final byte[] key, final byte[] family) {
    final GetRequest get = new GetRequest(table, key);
    get.family(family).qualifier(kind);
    class GetCB implements Callback<byte[], ArrayList<KeyValue>> {
      public byte[] call(final ArrayList<KeyValue> row) {
        if (row == null || row.isEmpty()) {
          return null;
        }
View Full Code Here

        return results;
      }
     
    }
   
    final GetRequest get = new GetRequest(tsdb.uidTable(), MAXID_ROW);
    get.family(ID_FAMILY);
    get.qualifiers(kinds);
    return tsdb.getClient().get(get).addCallback(new GetCB());
  }
View Full Code Here

            return Deferred.fromResult(meta);
          }
         
        }
       
        final GetRequest get = new GetRequest(tsdb.uidTable(), uid);
        get.family(FAMILY);
        get.qualifier((type.toString().toLowerCase() + "_meta").getBytes(CHARSET));
        return tsdb.getClient().get(get).addCallbackDeferring(new FetchMetaCB());
      }
View Full Code Here

      final byte[] branch_id, final String display_name) {

    final Leaf leaf = new Leaf();
    leaf.setDisplayName(display_name);
   
    final GetRequest get = new GetRequest(tsdb.treeTable(), branch_id);
    get.family(Tree.TREE_FAMILY());
    get.qualifier(leaf.columnQualifier());
   
    /**
     * Called with the results of the fetch from storage
     */
    final class GetCB implements Callback<Deferred<Leaf>, ArrayList<KeyValue>> {
View Full Code Here

  // HBase operations helpers //
  // ------------------------ //

  /** Gets the entire given row from the data table. */
  final Deferred<ArrayList<KeyValue>> get(final byte[] key) {
    return client.get(new GetRequest(table, key));
  }
View Full Code Here

    if (tree_id < 1 || tree_id > 65535) {
      throw new IllegalArgumentException("Invalid Tree ID");
    }

    // fetch the whole row
    final GetRequest get = new GetRequest(tsdb.treeTable(), idToBytes(tree_id));
    get.family(TREE_FAMILY);
   
    /**
     * Called from the GetRequest with results from storage. Loops through the
     * columns and loads the tree definition and rules
     */
 
View Full Code Here

   
    final byte[] row_key = new byte[TREE_ID_WIDTH + 1];
    System.arraycopy(idToBytes(tree_id), 0, row_key, 0, TREE_ID_WIDTH);
    row_key[TREE_ID_WIDTH] = COLLISION_ROW_SUFFIX;
   
    final GetRequest get = new GetRequest(tsdb.treeTable(), row_key);
    get.family(TREE_FAMILY);
   
    // if the caller provided a list of TSUIDs, then we need to compile a list
    // of qualifiers so we only fetch those columns.
    if (tsuids != null && !tsuids.isEmpty()) {
      final byte[][] qualifiers = new byte[tsuids.size()][];
      int index = 0;
      for (String tsuid : tsuids) {
        final byte[] qualifier = new byte[COLLISION_PREFIX.length +
                                          (tsuid.length() / 2)];
        System.arraycopy(COLLISION_PREFIX, 0, qualifier, 0,
            COLLISION_PREFIX.length);
        final byte[] tsuid_bytes = UniqueId.stringToUid(tsuid);
        System.arraycopy(tsuid_bytes, 0, qualifier, COLLISION_PREFIX.length,
            tsuid_bytes.length);
        qualifiers[index] = qualifier;
        index++;
      }
      get.qualifiers(qualifiers);
    }
   
    /**
     * Called after issuing the row get request to parse out the results and
     * compile the list of collisions.
View Full Code Here

TOP

Related Classes of org.hbase.async.GetRequest

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.