Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.Result.list()


  public KeyValue next() throws IOException {
    Result result = clientScanner.next();
    if (null == result || result.isEmpty()) {
      return null;
    }
    return result.list().get(0);
  }

  public void close() {
    clientScanner.close();
  }
View Full Code Here


       byte[] randBytes = randomRowKey();
       newPut.add(cf, randBytes, randBytes);
       hTable.checkAndPut(row, cf, row, row, newPut);

       Result result = hTable.get(new Get(row));
       Assert.assertEquals(2, result.list().size());
      
       assertMetricsUpdated(OpType.PUT, OpType.CHECK_AND_PUT, OpType.GET);
   }

   @Test
View Full Code Here

         while (filteredResult.isEmpty()) {
            Result result = super.next();
            if (result == null) {
               return null;
            }
            filteredResult = filter(state, result.list(), maxVersions);
         }
         return new Result(filteredResult);
      }

      // In principle no need to override, copied from super.next(int) to make sure it works even if super.next(int)
View Full Code Here

      if (filter != null) {
        get.setFilter(filter);
      }
      Result result = table.get(get);
      if (result != null && !result.isEmpty()) {
        valuesI = result.list().iterator();
      }
    } finally {
      pool.putTable(table);
    }
  }
View Full Code Here

          throw new IllegalArgumentException(e);
        } catch (IOException e) {
          LOG.error(StringUtils.stringifyException(e));
        }
        if (result != null && !result.isEmpty()) {
          rowI = result.list().iterator();
          loop = true;
        }
      }
    } while (loop);
    return null;
View Full Code Here

          throw new IllegalArgumentException(e);
        } catch (IOException e) {
          LOG.error(StringUtils.stringifyException(e));
        }
        if (result != null && !result.isEmpty()) {
          rowI = result.list().iterator();
          loop = true;
        }
      }
    } while (loop);
    return null;
View Full Code Here

      Result results = scanner.next();
      if (results == null) {
        return false;
      }
      values.clear();
      values.addAll(results.list());
      return true;
    }

    public void close() throws IOException {
      scanner.close();
View Full Code Here

          }
        }
        byte[] firstValue = null;
        byte[] secondValue = null;
        int count = 0;
        for(KeyValue kv : r.list()) {
          if (count == 0) {
            firstValue = kv.getValue();
          }
          if (count == 1) {
            secondValue = kv.getValue();
View Full Code Here

    Get get = new Get(ROW);
    Result r = region.get(get);
    assertNull(
      "Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: "
          + r, r.list());
  }

  @Test
  public void testRegionObserverFlushTimeStacking() throws Exception {
    byte[] ROW = Bytes.toBytes("testRow");
View Full Code Here

    region.flushcache();
    Get get = new Get(ROW);
    Result r = region.get(get);
    assertNull(
      "Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: "
          + r, r.list());
  }

  /*
   * Custom HRegion which uses CountDownLatch to signal the completion of compaction
   */
 
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.