Package org.hbase.async

Examples of org.hbase.async.GetRequest


   
    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] = NOT_MATCHED_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[NOT_MATCHED_PREFIX.length +
                                          (tsuid.length() / 2)];
        System.arraycopy(NOT_MATCHED_PREFIX, 0, qualifier, 0,
            NOT_MATCHED_PREFIX.length);
        final byte[] tsuid_bytes = UniqueId.stringToUid(tsuid);
        System.arraycopy(tsuid_bytes, 0, qualifier, NOT_MATCHED_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


   * @return True if data was found, false if not
   * @throws HBaseException if there was an issue fetching
   */
  public static Deferred<Boolean> metaExistsInStorage(final TSDB tsdb,
      final String tsuid) {
    final GetRequest get = new GetRequest(tsdb.metaTable(),
        UniqueId.stringToUid(tsuid));
    get.family(FAMILY);
    get.qualifier(META_QUALIFIER);
   
    /**
     * Callback from the GetRequest that simply determines if the row is empty
     * or not
     */
 
View Full Code Here

   * @return True if data was found, false if not
   * @throws HBaseException if there was an issue fetching
   */
  public static Deferred<Boolean> counterExistsInStorage(final TSDB tsdb,
      final byte[] tsuid) {
    final GetRequest get = new GetRequest(tsdb.metaTable(), tsuid);
    get.family(FAMILY);
    get.qualifier(COUNTER_QUALIFIER);
   
    /**
     * Callback from the GetRequest that simply determines if the row is empty
     * or not
     */
 
View Full Code Here

        return Deferred.fromResult(meta);
      }
     
    }
   
    final GetRequest get = new GetRequest(tsdb.metaTable(), tsuid);
    get.family(FAMILY);
    get.qualifiers(new byte[][] { COUNTER_QUALIFIER, META_QUALIFIER });
    return tsdb.getClient().get(get).addCallbackDeferring(new GetCB());
  }
View Full Code Here

    if (order < 0) {
      throw new IllegalArgumentException("Invalid rule order");
    }
   
    // fetch the whole row
    final GetRequest get = new GetRequest(tsdb.treeTable(),
        Tree.idToBytes(tree_id));
    get.family(Tree.TREE_FAMILY());
    get.qualifier(getQualifier(level, order));
   
    /**
     * Called after fetching to parse the results
     */
    final class FetchCB implements Callback<Deferred<TreeRule>,
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(),
        Tree.idToBytes(tree_id));
    get.family(Tree.TREE_FAMILY());
   
    /**
     * Called after fetching the requested row. If the row is empty, we just
     * return, otherwise we compile a list of qualifiers to delete and submit
     * a single delete request to storage.
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.