org.apache.hadoop.hbase.client.Result#value ( )源码实例Demo

下面列出了org.apache.hadoop.hbase.client.Result#value ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: splicer   文件: MetricsCache.java
@Override
public byte[] load(String metric) throws Exception {
	Configuration config = regionUtil.getConfig();
	try (HTable table = new HTable(config, "tsdb-uid")) {
		Get get = new Get(toBytes(metric));
		get.addColumn(toBytes("id"), toBytes("metrics"));
		Result result = table.get(get);
		LOG.info("Looking up key for metric={}. Found result={}",
				metric, Arrays.toString(result.value()));
		return result.value();
	}
}
 
源代码2 项目: hbase   文件: TestScanner.java
/** Use get to retrieve the HRegionInfo and validate it */
private void getRegionInfo(Table table) throws IOException {
  Get get = new Get(ROW_KEY);
  get.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER);
  Result result = table.get(get);
  byte [] bytes = result.value();
  validateRegionInfo(bytes);
}
 
源代码3 项目: pinpoint   文件: HostApplicationMapper.java
@Override
public Application mapRow(Result result, int rowNum) throws Exception {
    if (result.isEmpty()) {
        return null;
    }
    byte[] value = result.value();

    if (value.length != HbaseTableConstatns.APPLICATION_NAME_MAX_LEN + 2) {
        logger.warn("Invalid value. {}", Arrays.toString(value));
    }

    String applicationName = Bytes.toString(value, 0, HbaseTableConstatns.APPLICATION_NAME_MAX_LEN - 1).trim();
    short serviceTypeCode = Bytes.toShort(value, HbaseTableConstatns.APPLICATION_NAME_MAX_LEN);
    return this.applicationFactory.createApplication(applicationName, serviceTypeCode);
}
 
源代码4 项目: geowave   文件: HBaseMetadataReader.java
private byte[] getMergedStats(final Result result, final boolean clientsideStatsMerge) {
  if (!clientsideStatsMerge || (result.size() == 1)) {
    return result.value();
  }

  return URLClassloaderUtils.toBinary(HBaseUtils.getMergedStats(result.listCells()));
}