Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.Result


    try {
      // Now the ct is up... set into the mocks some answers that make it look
      // like things have been getting assigned. Make it so we'll return a
      // location (no matter what the Get is). Same for getHRegionInfo -- always
      // just return the meta region.
      final Result result = getMetaTableRowResult();

      // TODO: Refactor.  This method has been moved out of HConnection.
      // It works for now but has been deprecated.
      Mockito.when(connection.getRegionServerWithRetries((ServerCallable<Result>)Mockito.any())).
        thenReturn(result);
View Full Code Here


      HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER,
      Bytes.toBytes(SN.getHostAndPort())));
    kvs.add(new KeyValue(HConstants.EMPTY_BYTE_ARRAY,
      HConstants.CATALOG_FAMILY, HConstants.STARTCODE_QUALIFIER,
      Bytes.toBytes(SN.getStartcode())));
    return new Result(kvs);
  }
View Full Code Here

        byte[] column = split[0];
        byte[] qualifier = split.length > 1 ? split[1] : null;
        kvs.add(new KeyValue(row.getKey(), column, qualifier,
          cell.getTimestamp(), cell.getValue()));
      }
      results.add(new Result(kvs));
    }
    return results.toArray(new Result[results.size()]);
  }
View Full Code Here

          }
          return results[0];
        }
        // fall through
      case 404:
        return new Result();
      case 509:
        try {
          Thread.sleep(sleepTime);
        } catch (InterruptedException e) { }
        break;
View Full Code Here

    throw new IOException("get request timed out");
  }

  public boolean exists(Get get) throws IOException {
    LOG.warn("exists() is really get(), just use get()");
    Result result = get(get);
    return (result != null && !(result.isEmpty()));
  }
View Full Code Here

        return cache != null;
      }

      @Override
      public Result next() {
        Result result = cache;
        try {
          cache = Scanner.this.next();
        } catch (IOException e) {
          LOG.warn(StringUtils.stringifyException(e));
          cache = null;
View Full Code Here

   * @throws IOException read exceptions
   */
  public Result getClosestRowBefore(final byte [] row, final byte [] family)
  throws IOException {
    if (coprocessorHost != null) {
      Result result = new Result();
      if (coprocessorHost.preGetClosestRowBefore(row, family, result)) {
        return result;
      }
    }
    // look across all the HStores for this region and determine what the
    // closest key is across all column families, since the data may be sparse
    checkRow(row, "getClosestRowBefore");
    startRegionOperation();
    this.readRequestsCount.increment();
    try {
      Store store = getStore(family);
      // get the closest key. (HStore.getRowKeyAtOrBefore can return null)
      KeyValue key = store.getRowKeyAtOrBefore(row);
      Result result = null;
      if (key != null) {
        Get get = new Get(key.getRow());
        get.addFamily(family);
        result = get(get, null);
      }
View Full Code Here

   * @throws IOException When reading the record failed.
   * @throws InterruptedException When the job was aborted.
   */
  public boolean nextKeyValue() throws IOException, InterruptedException {
    if (key == null) key = new ImmutableBytesWritable();
    if (value == null) value = new Result();
    try {
      try {
        value = this.scanner.next();
        if (logScannerActivity) {
          rowcount ++;
View Full Code Here

            replicatedScanner = replicatedTable.getScanner(scan);
            return null;
          }
        });
      }
      Result res = replicatedScanner.next();
      try {
        Result.compareResults(value, res);
        context.getCounter(Counters.GOODROWS).increment(1);
      } catch (Exception e) {
        LOG.warn("Bad row", e);
View Full Code Here

    Get g = new Get(hri.getRegionName());
    g.addFamily(HConstants.CATALOG_FAMILY);
    try {
      HRegionInterface server =
        master.connection.getHRegionConnection(mr.getServer());
      Result r = server.get(mr.getRegionName(), g);
      // If size > 3 -- presume regioninfo, startcode and server -- then presume
      // that this daughter already assigned and return.
      if (r.size() >= 3) return;
    } catch (IOException e) {
      LOG.warn("Failed get on " + HConstants.CATALOG_FAMILY_STR +
        "; possible double-assignment?", e);
    }
    this.master.regionManager.setUnassigned(hri, false);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.client.Result

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.