本文整理了Java中org.apache.hadoop.hbase.client.Put.has()
方法的一些代码示例,展示了Put.has()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Put.has()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Put
类名称:Put
方法名:has
[英]A convenience method to determine if this object's familyMap contains a value assigned to the given family & qualifier. Both given arguments must match the KeyValue object to return true.
[中]一种方便的方法,用于确定此对象的familyMap是否包含指定给给定族和限定符的值。两个给定参数必须与KeyValue对象匹配才能返回true。
代码示例来源:origin: apache/hbase
@Test
public void testHas() {
Assert.assertTrue(put.has(FAMILY_01, QUALIFIER_01, TS, VALUE_01));
// Bad TS
Assert.assertFalse(put.has(FAMILY_01, QUALIFIER_01, TS + 1, VALUE_01));
// Bad Value
Assert.assertFalse(put.has(FAMILY_01, QUALIFIER_01, TS, QUALIFIER_01));
// Bad Family
Assert.assertFalse(put.has(QUALIFIER_01, QUALIFIER_01, TS, VALUE_01));
// Bad Qual
Assert.assertFalse(put.has(FAMILY_01, FAMILY_01, TS, VALUE_01));
}
}
代码示例来源:origin: apache/hbase
@Test
public void testHasIgnoreTS() {
Assert.assertTrue(put.has(FAMILY_01, QUALIFIER_01, VALUE_01));
Assert.assertFalse(put.has(FAMILY_01, VALUE_01, QUALIFIER_01));
}
代码示例来源:origin: apache/hbase
@Test
public void testHasIgnoreValueIgnoreTS() {
Assert.assertTrue(put.has(FAMILY_01, QUALIFIER_01));
Assert.assertFalse(put.has(QUALIFIER_01, FAMILY_01));
}
代码示例来源:origin: apache/hbase
@Test
public void testHasIgnoreValue() {
Assert.assertTrue(put.has(FAMILY_01, QUALIFIER_01, TS));
Assert.assertFalse(put.has(FAMILY_01, QUALIFIER_01, TS + 1));
}
代码示例来源:origin: org.apache.hbase/hbase-client
@Test
public void testHas() {
Assert.assertTrue(put.has(FAMILY_01, QUALIFIER_01, TS, VALUE_01));
// Bad TS
Assert.assertFalse(put.has(FAMILY_01, QUALIFIER_01, TS + 1, VALUE_01));
// Bad Value
Assert.assertFalse(put.has(FAMILY_01, QUALIFIER_01, TS, QUALIFIER_01));
// Bad Family
Assert.assertFalse(put.has(QUALIFIER_01, QUALIFIER_01, TS, VALUE_01));
// Bad Qual
Assert.assertFalse(put.has(FAMILY_01, FAMILY_01, TS, VALUE_01));
}
}
代码示例来源:origin: org.apache.hbase/hbase-client
@Test
public void testHasIgnoreTS() {
Assert.assertTrue(put.has(FAMILY_01, QUALIFIER_01, VALUE_01));
Assert.assertFalse(put.has(FAMILY_01, VALUE_01, QUALIFIER_01));
}
代码示例来源:origin: org.apache.hbase/hbase-client
@Test
public void testHasIgnoreValue() {
Assert.assertTrue(put.has(FAMILY_01, QUALIFIER_01, TS));
Assert.assertFalse(put.has(FAMILY_01, QUALIFIER_01, TS + 1));
}
代码示例来源:origin: org.apache.hbase/hbase-client
@Test
public void testHasIgnoreValueIgnoreTS() {
Assert.assertTrue(put.has(FAMILY_01, QUALIFIER_01));
Assert.assertFalse(put.has(QUALIFIER_01, FAMILY_01));
}
代码示例来源:origin: harbby/presto-connectors
/**
* A convenience method to determine if this object's familyMap contains
* a value assigned to the given family & qualifier.
* Both given arguments must match the KeyValue object to return true.
*
* @param family column family
* @param qualifier column qualifier
* @return returns true if the given family and qualifier already has an
* existing KeyValue object in the family map.
*/
public boolean has(byte [] family, byte [] qualifier) {
return has(family, qualifier, this.ts, new byte[0], true, true);
}
代码示例来源:origin: co.cask.hbase/hbase
/**
* A convenience method to determine if this object's familyMap contains
* a value assigned to the given family & qualifier.
* Both given arguments must match the KeyValue object to return true.
*
* @param family column family
* @param qualifier column qualifier
* @return returns true if the given family and qualifier already has an
* existing KeyValue object in the family map.
*/
public boolean has(byte [] family, byte [] qualifier) {
return has(family, qualifier, this.ts, new byte[0], true, true);
}
代码示例来源:origin: co.cask.hbase/hbase
/**
* A convenience method to determine if this object's familyMap contains
* a value assigned to the given family, qualifier and timestamp.
* All 3 given arguments must match the KeyValue object to return true.
*
* @param family column family
* @param qualifier column qualifier
* @param value value to check
* @return returns true if the given family, qualifier and value already has an
* existing KeyValue object in the family map.
*/
public boolean has(byte [] family, byte [] qualifier, byte [] value) {
return has(family, qualifier, this.ts, value, true, false);
}
代码示例来源:origin: harbby/presto-connectors
/**
* A convenience method to determine if this object's familyMap contains
* a value assigned to the given family, qualifier and timestamp.
* All 3 given arguments must match the KeyValue object to return true.
*
* @param family column family
* @param qualifier column qualifier
* @param ts timestamp
* @return returns true if the given family, qualifier and timestamp already has an
* existing KeyValue object in the family map.
*/
public boolean has(byte [] family, byte [] qualifier, long ts) {
return has(family, qualifier, ts, new byte[0], false, true);
}
代码示例来源:origin: harbby/presto-connectors
/**
* A convenience method to determine if this object's familyMap contains
* a value assigned to the given family, qualifier and timestamp.
* All 3 given arguments must match the KeyValue object to return true.
*
* @param family column family
* @param qualifier column qualifier
* @param value value to check
* @return returns true if the given family, qualifier and value already has an
* existing KeyValue object in the family map.
*/
public boolean has(byte [] family, byte [] qualifier, byte [] value) {
return has(family, qualifier, this.ts, value, true, false);
}
代码示例来源:origin: co.cask.hbase/hbase
/**
* A convenience method to determine if this object's familyMap contains
* a value assigned to the given family, qualifier and timestamp.
* All 3 given arguments must match the KeyValue object to return true.
*
* @param family column family
* @param qualifier column qualifier
* @param ts timestamp
* @return returns true if the given family, qualifier and timestamp already has an
* existing KeyValue object in the family map.
*/
public boolean has(byte [] family, byte [] qualifier, long ts) {
return has(family, qualifier, ts, new byte[0], false, true);
}
代码示例来源:origin: harbby/presto-connectors
/**
* A convenience method to determine if this object's familyMap contains
* the given value assigned to the given family, qualifier and timestamp.
* All 4 given arguments must match the KeyValue object to return true.
*
* @param family column family
* @param qualifier column qualifier
* @param ts timestamp
* @param value value to check
* @return returns true if the given family, qualifier timestamp and value
* already has an existing KeyValue object in the family map.
*/
public boolean has(byte [] family, byte [] qualifier, long ts, byte [] value) {
return has(family, qualifier, ts, value, false, false);
}
代码示例来源:origin: co.cask.hbase/hbase
/**
* A convenience method to determine if this object's familyMap contains
* the given value assigned to the given family, qualifier and timestamp.
* All 4 given arguments must match the KeyValue object to return true.
*
* @param family column family
* @param qualifier column qualifier
* @param ts timestamp
* @param value value to check
* @return returns true if the given family, qualifier timestamp and value
* already has an existing KeyValue object in the family map.
*/
public boolean has(byte [] family, byte [] qualifier, long ts, byte [] value) {
return has(family, qualifier, ts, value, false, false);
}
代码示例来源:origin: org.cloudgraph/cloudgraph-hbase
protected byte[] findValue(byte[] family, byte[] qualifier, Put row) {
if (!row.has(family, qualifier)) {
return null;
}
List<Cell> cells = row.get(family, qualifier);
Cell last = cells.get(cells.size() - 1);
return CellUtil.cloneValue(last);
}
代码示例来源:origin: org.cloudgraph/cloudgraph-hbase
protected byte[] fetchValue(byte[] family, byte[] qualifier, Put row) {
if (!row.has(family, qualifier)) {
throw new RequiredKeyFieldException("expected column qualifier '" + new String(qualifier)
+ "' for reference property, " + sourceProp);
}
List<Cell> cells = row.get(family, qualifier);
Cell last = cells.get(cells.size() - 1);
return CellUtil.cloneValue(last);
}
内容来源于网络,如有侵权,请联系作者删除!