Package org.hbase.async

Examples of org.hbase.async.PutRequest


      values[index] = entry.getValue().getBytes(CHARSET);
      index++;
    }

    final PutRequest put = new PutRequest(tsdb.treeTable(), row_key,
        TREE_FAMILY, qualifiers, values);
    collisions.clear();
   
    /**
     * Super simple callback used to convert the Deferred<Object> to a
View Full Code Here


     
      values[index] = entry.getValue().getBytes(CHARSET);
      index++;
    }
   
    final PutRequest put = new PutRequest(tsdb.treeTable(), row_key,
        TREE_FAMILY, qualifiers, values);
    not_matched.clear();
   
    /**
     * Super simple callback used to convert the Deferred<Object> to a
View Full Code Here

          }
         
          final byte[] original_meta = stored_meta.getStorageJSON();
          local_meta.syncMeta(stored_meta, overwrite);

          final PutRequest put = new PutRequest(tsdb.metaTable(),
              UniqueId.stringToUid(local_meta.tsuid), FAMILY, META_QUALIFIER,
              local_meta.getStorageJSON());

          return tsdb.getClient().compareAndSet(put, original_meta);
        }
View Full Code Here

  public Deferred<Boolean> storeNew(final TSDB tsdb) {
    if (tsuid == null || tsuid.isEmpty()) {
      throw new IllegalArgumentException("Missing TSUID");
    }

    final PutRequest put = new PutRequest(tsdb.metaTable(),
        UniqueId.stringToUid(tsuid), FAMILY, META_QUALIFIER, getStorageJSON());
   
    final class PutCB implements Callback<Deferred<Boolean>, Object> {
      @Override
      public Deferred<Boolean> call(Object arg0) throws Exception {
View Full Code Here

          }
         
          final byte[] original_meta = stored_meta.getStorageJSON();
          local_meta.syncMeta(stored_meta, overwrite);

          final PutRequest put = new PutRequest(tsdb.metaTable(),
              UniqueId.stringToUid(local_meta.tsuid), FAMILY, META_QUALIFIER,
              local_meta.getStorageJSON());

          return tsdb.getClient().compareAndSet(put, original_meta);
        }
View Full Code Here

    }

    // Java is so stupid with its auto-promotion of int to float.
    final byte[] qualifier = Internal.buildQualifier(timestamp, flags);

    final PutRequest point = new PutRequest(tsdb.table, row, TSDB.FAMILY,
                                            qualifier, value);
    // TODO(tsuna): The following timing is rather useless.  First of all,
    // the histogram never resets, so it tends to converge to a certain
    // distribution and never changes.  What we really want is a moving
    // histogram so we can see how the latency distribution varies over time.
    // The other problem is that the Histogram class isn't thread-safe and
    // here we access it from a callback that runs in an unknown thread, so
    // we might miss some increments.  So let's comment this out until we
    // have a proper thread-safe moving histogram.
    //final long start_put = System.nanoTime();
    //final Callback<Object, Object> cb = new Callback<Object, Object>() {
    //  public Object call(final Object arg) {
    //    putlatency.add((int) ((System.nanoTime() - start_put) / 1000000));
    //    return arg;
    //  }
    //  public String toString() {
    //    return "time put request";
    //  }
    //};

    // TODO(tsuna): Add an errback to handle some error cases here.
    point.setDurable(!batch_import);
    return tsdb.client.put(point)/*.addBoth(cb)*/;
  }
View Full Code Here

        initializeChangedMap();
       
        // validate before storing
        stored_rule.validateRule();
       
        final PutRequest put = new PutRequest(tsdb.treeTable(),
            Tree.idToBytes(tree_id), Tree.TREE_FAMILY(),
            getQualifier(level, order), JSON.serializeToBytes(stored_rule));
        return tsdb.getClient().compareAndSet(put, original_rule);
      }
     
View Full Code Here

        initializeChangedMap();
       
        // validate before storing
        stored_rule.validateRule();
       
        final PutRequest put = new PutRequest(tsdb.treeTable(),
            Tree.idToBytes(tree_id), Tree.TREE_FAMILY(),
            getQualifier(level, order), JSON.serializeToBytes(stored_rule));
        return tsdb.getClient().compareAndSet(put, original_rule);
      }
View Full Code Here

      LOG.info("received a page of users.");
      for (ArrayList<KeyValue> row : rows) {
        KeyValue kv = row.get(0);
        byte[] expected = kv.value();
        String userId = new String(kv.key());
        PutRequest put = new PutRequest(
            TABLE_NAME, kv.key(), kv.family(),
            kv.qualifier(), mkNewPassword(expected));
        Deferred<Boolean> d = client.compareAndSet(put, expected)
          .addCallback(new InterpretResponse(userId))
          .addCallbacks(new ResultToMessage(), new FailureToMessage())
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.