org.apache.hadoop.hbase.client.Get.setCheckExistenceOnly()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.apache.hadoop.hbase.client.Get.setCheckExistenceOnly()方法的一些代码示例,展示了Get.setCheckExistenceOnly()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Get.setCheckExistenceOnly()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Get
类名称:Get
方法名:setCheckExistenceOnly

Get.setCheckExistenceOnly介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

static Get toCheckExistenceOnly(Get get) {
 if (get.isCheckExistenceOnly()) {
  return get;
 }
 return ReflectionUtils.newInstance(get.getClass(), get).setCheckExistenceOnly(true);
}

代码示例来源:origin: apache/hbase

@Override
public boolean[] exists(List<Get> gets) throws IOException {
 if (gets.isEmpty()) return new boolean[]{};
 if (gets.size() == 1) return new boolean[]{exists(gets.get(0))};
 ArrayList<Get> exists = new ArrayList<>(gets.size());
 for (Get g: gets){
  Get ge = new Get(g);
  ge.setCheckExistenceOnly(true);
  exists.add(ge);
 }
 Object[] r1= new Object[exists.size()];
 try {
  batch(exists, r1, readRpcTimeoutMs);
 } catch (InterruptedException e) {
  throw (InterruptedIOException)new InterruptedIOException().initCause(e);
 }
 // translate.
 boolean[] results = new boolean[r1.length];
 int i = 0;
 for (Object o : r1) {
  // batch ensures if there is a failure we get an exception instead
  results[i++] = ((Result)o).getExists();
 }
 return results;
}

代码示例来源:origin: apache/kylin

private Result internalGetFromHTable(Table table, String path, boolean fetchContent, boolean fetchTimestamp)
    throws IOException {
  byte[] rowkey = Bytes.toBytes(path);
  Get get = new Get(rowkey);
  if (!fetchContent && !fetchTimestamp) {
    get.setCheckExistenceOnly(true);
  } else {
    if (fetchContent)
      get.addColumn(B_FAMILY, B_COLUMN);
    if (fetchTimestamp)
      get.addColumn(B_FAMILY, B_COLUMN_TS);
  }
  Result result = table.get(get);
  boolean exists = result != null && (!result.isEmpty() || (result.getExists() != null && result.getExists()));
  return exists ? result : null;
}

代码示例来源:origin: apache/hbase

g.setCheckExistenceOnly(true);
r = table.get(g);
Assert.assertFalse(r.isStale());
g.setCheckExistenceOnly(true);
g.setConsistency(Consistency.TIMELINE);
r = table.get(g);
g.setCheckExistenceOnly(true);
g.setConsistency(Consistency.TIMELINE);
r = table.get(g);

代码示例来源:origin: apache/hbase

g.setCheckExistenceOnly(true);
g.setConsistency(Consistency.TIMELINE);
gets.add(g);
g = new Get(b2);
g.setCheckExistenceOnly(true);
g.setConsistency(Consistency.TIMELINE);
gets.add(g);

代码示例来源:origin: apache/hbase

get.setCheckExistenceOnly(checkExistenceOnly);
if (get.getConsistency() == null){
 get.setConsistency(DEFAULT_CONSISTENCY);

代码示例来源:origin: apache/hbase

get.setCheckExistenceOnly(true);

代码示例来源:origin: org.apache.hbase/hbase-client

static Get toCheckExistenceOnly(Get get) {
 if (get.isCheckExistenceOnly()) {
  return get;
 }
 return ReflectionUtils.newInstance(get.getClass(), get).setCheckExistenceOnly(true);
}

代码示例来源:origin: org.apache.hbase/hbase-client

@Override
public boolean[] exists(List<Get> gets) throws IOException {
 if (gets.isEmpty()) return new boolean[]{};
 if (gets.size() == 1) return new boolean[]{exists(gets.get(0))};
 ArrayList<Get> exists = new ArrayList<>(gets.size());
 for (Get g: gets){
  Get ge = new Get(g);
  ge.setCheckExistenceOnly(true);
  exists.add(ge);
 }
 Object[] r1= new Object[exists.size()];
 try {
  batch(exists, r1, readRpcTimeoutMs);
 } catch (InterruptedException e) {
  throw (InterruptedIOException)new InterruptedIOException().initCause(e);
 }
 // translate.
 boolean[] results = new boolean[r1.length];
 int i = 0;
 for (Object o : r1) {
  // batch ensures if there is a failure we get an exception instead
  results[i++] = ((Result)o).getExists();
 }
 return results;
}

代码示例来源:origin: apache/hbase

out.setCheckExistenceOnly(in.isExistence_only());

代码示例来源:origin: larsgeorge/hbase-book

get1.setCheckExistenceOnly(true);
get2.setCheckExistenceOnly(true);
Result result2 = table.get(get2);
get3.setCheckExistenceOnly(true);
Result result3 = table.get(get3);
get4.addColumn(Bytes.toBytes("colfam1"), Bytes.toBytes("qual9999")); // co GetCheckExistenceExample-6-Get4 Check for an existent, and non-existent column.
get4.addColumn(Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"));
get4.setCheckExistenceOnly(true);
Result result4 = table.get(get4);

代码示例来源:origin: apache/hbase

get.setReplicaId(2);
get.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);
get.setCheckExistenceOnly(true);
get.setTimeRange(3, 4);
get.setMaxVersions(11);

代码示例来源:origin: apache/hbase

get.setCheckExistenceOnly(true);

代码示例来源:origin: cdapio/cdap

@Override
public GetBuilder setCheckExistenceOnly(boolean checkExistenceOnly) {
 get.setCheckExistenceOnly(checkExistenceOnly);
 return this;
}

代码示例来源:origin: cdapio/cdap

@Override
public GetBuilder setCheckExistenceOnly(boolean checkExistenceOnly) {
 get.setCheckExistenceOnly(checkExistenceOnly);
 return this;
}

代码示例来源:origin: cdapio/cdap

@Override
public GetBuilder setCheckExistenceOnly(boolean checkExistenceOnly) {
 get.setCheckExistenceOnly(checkExistenceOnly);
 return this;
}

代码示例来源:origin: org.apache.hbase/hbase-client

get.setCheckExistenceOnly(checkExistenceOnly);
if (get.getConsistency() == null){
 get.setConsistency(DEFAULT_CONSISTENCY);

代码示例来源:origin: org.apache.hbase/hbase-client

get.setCheckExistenceOnly(true);

代码示例来源:origin: org.apache.hbase/hbase-client

get.setReplicaId(2);
get.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);
get.setCheckExistenceOnly(true);
get.setTimeRange(3, 4);
get.setMaxVersions(11);

代码示例来源:origin: org.apache.hbase/hbase-client

get.setCheckExistenceOnly(true);

相关文章