Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.Get.addColumn()


  long configUpdateInterval;
  long lastConfigUpdated = System.currentTimeMillis();

  void updateConfig() throws IOException {
    Get get = new Get(row);
    get.addColumn(USER, TOKENS_RATE);
    get.addColumn(USER, TOKENS_SIZE);
    Result result = table.get(get);
    byte[] value = result.getValue(USER, TOKENS_RATE);
    if (value != null) {
      this.rate = (int)Bytes.toDouble(value);
View Full Code Here


  long lastConfigUpdated = System.currentTimeMillis();

  void updateConfig() throws IOException {
    Get get = new Get(row);
    get.addColumn(USER, TOKENS_RATE);
    get.addColumn(USER, TOKENS_SIZE);
    Result result = table.get(get);
    byte[] value = result.getValue(USER, TOKENS_RATE);
    if (value != null) {
      this.rate = (int)Bytes.toDouble(value);
    }
View Full Code Here

    // Stargate instances are concurrently serving the same user, and three
    // more round trips than otherwise.
    RowLock rl = table.lockRow(row);
    try {
      Get get = new Get(row, rl);
      get.addColumn(USER, TOKENS);
      List<KeyValue> kvs = table.get(get).list();
      if (kvs != null && !kvs.isEmpty()) {
        KeyValue kv = kvs.get(0);
        tokens = (int)Bytes.toLong(kv.getValue());
        lastUpdated = kv.getTimestamp();
View Full Code Here

  public User getUserForToken(String token) throws IOException {
    if (table == null) {
      this.table = new HTable(conf, tableName);
    }
    Get get = new Get(Bytes.toBytes(token));
    get.addColumn(USER, NAME);
    get.addColumn(USER, ADMIN);
    get.addColumn(USER, DISABLED);
    Result result = table.get(get);
    byte[] value = result.getValue(USER, NAME);
    if (value == null) {
View Full Code Here

    if (table == null) {
      this.table = new HTable(conf, tableName);
    }
    Get get = new Get(Bytes.toBytes(token));
    get.addColumn(USER, NAME);
    get.addColumn(USER, ADMIN);
    get.addColumn(USER, DISABLED);
    Result result = table.get(get);
    byte[] value = result.getValue(USER, NAME);
    if (value == null) {
      return null;
View Full Code Here

      this.table = new HTable(conf, tableName);
    }
    Get get = new Get(Bytes.toBytes(token));
    get.addColumn(USER, NAME);
    get.addColumn(USER, ADMIN);
    get.addColumn(USER, DISABLED);
    Result result = table.get(get);
    byte[] value = result.getValue(USER, NAME);
    if (value == null) {
      return null;
    }
View Full Code Here

          new BinaryComparator(val1), put, lockId, true);
      assertEquals(true, res);
      store.memstore.kvset.size();

      Get get = new Get(row1);
      get.addColumn(fam2, qf1);
      KeyValue [] actual = region.get(get, null).raw();

      KeyValue [] expected = {kv};

      assertEquals(expected.length, actual.length);
View Full Code Here

      boolean res = region.checkAndMutate(row1, fam1, qf1, CompareOp.EQUAL,
          new BinaryComparator(val2), delete, lockId, true);
      assertEquals(true, res);

      Get get = new Get(row1);
      get.addColumn(fam1, qf1);
      get.addColumn(fam1, qf3);
      get.addColumn(fam2, qf2);
      Result r = region.get(get, null);
      assertEquals(2, r.size());
      assertEquals(val1, r.getValue(fam1, qf1));
View Full Code Here

          new BinaryComparator(val2), delete, lockId, true);
      assertEquals(true, res);

      Get get = new Get(row1);
      get.addColumn(fam1, qf1);
      get.addColumn(fam1, qf3);
      get.addColumn(fam2, qf2);
      Result r = region.get(get, null);
      assertEquals(2, r.size());
      assertEquals(val1, r.getValue(fam1, qf1));
      assertEquals(val2, r.getValue(fam2, qf2));
View Full Code Here

      assertEquals(true, res);

      Get get = new Get(row1);
      get.addColumn(fam1, qf1);
      get.addColumn(fam1, qf3);
      get.addColumn(fam2, qf2);
      Result r = region.get(get, null);
      assertEquals(2, r.size());
      assertEquals(val1, r.getValue(fam1, qf1));
      assertEquals(val2, r.getValue(fam2, qf2));
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.