本文整理了Java中org.apache.hadoop.hbase.client.Put.getCellList()
方法的一些代码示例,展示了Put.getCellList()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Put.getCellList()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Put
类名称:Put
方法名:getCellList
暂无
代码示例来源:origin: apache/hbase
/**
* Add the specified column and value, with the specified timestamp as
* its version to this Put operation.
* @param family family name
* @param qualifier column qualifier
* @param ts version timestamp
* @param value column value
* @return this
*/
public Put addColumn(byte [] family, byte [] qualifier, long ts, byte [] value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value);
list.add(kv);
return this;
}
代码示例来源:origin: apache/hbase
/**
* Add the specified column and value, with the specified timestamp as
* its version to this Put operation.
* @param family family name
* @param qualifier column qualifier
* @param ts version timestamp
* @param value column value
* @return this
*/
public Put addColumn(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value, null);
list.add(kv);
return this;
}
代码示例来源:origin: apache/hbase
/**
* See {@link #addColumn(byte[], ByteBuffer, long, ByteBuffer)}. This version expects
* that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
* Use {@link #add(Cell)} and {@link org.apache.hadoop.hbase.CellBuilder} instead
*/
@Deprecated
public Put addImmutable(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value, null);
list.add(kv);
return this;
}
代码示例来源:origin: apache/hbase
/**
* See {@link #addColumn(byte[], byte[], long, byte[])}. This version expects
* that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
* Use {@link #add(Cell)} and {@link org.apache.hadoop.hbase.CellBuilder} instead
*/
@Deprecated
public Put addImmutable(byte [] family, byte [] qualifier, long ts, byte [] value) {
// Family can not be null, otherwise NullPointerException is thrown when putting the cell into familyMap
if (family == null) {
throw new IllegalArgumentException("Family cannot be null");
}
// Check timestamp
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
list.add(new IndividualBytesFieldCell(this.row, family, qualifier, ts, KeyValue.Type.Put, value));
return this;
}
代码示例来源:origin: apache/hbase
@Test
public void testPutCopyConstructor() throws IOException {
Put origin = new Put(Bytes.toBytes("ROW-01"));
origin.setPriority(100);
byte[] family = Bytes.toBytes("CF-01");
origin.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
.setRow(origin.getRow())
.setFamily(family)
.setQualifier(Bytes.toBytes("q"))
.setType(Cell.Type.Put)
.setValue(Bytes.toBytes("value"))
.build());
origin.addColumn(family, Bytes.toBytes("q0"), Bytes.toBytes("V-01"));
origin.addColumn(family, Bytes.toBytes("q1"), 100, Bytes.toBytes("V-01"));
Put clone = new Put(origin);
assertEquals(origin, clone);
origin.addColumn(family, Bytes.toBytes("q2"), Bytes.toBytes("V-02"));
//They should have different cell lists
assertNotEquals(origin.getCellList(family), clone.getCellList(family));
}
代码示例来源:origin: apache/hbase
cells.addAll(m.getCellList(FAMILY));
cells.addAll(put.getCellList(FAMILY));
assertEquals(3, cells.size());
HBaseRpcController controller = Mockito.mock(HBaseRpcController.class);
代码示例来源:origin: org.apache.hbase/hbase-client
/**
* See {@link #addColumn(byte[], ByteBuffer, long, ByteBuffer)}. This version expects
* that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
* Use {@link #add(Cell)} and {@link org.apache.hadoop.hbase.CellBuilder} instead
*/
@Deprecated
public Put addImmutable(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value, null);
list.add(kv);
return this;
}
代码示例来源:origin: org.apache.hbase/hbase-client
/**
* Add the specified column and value, with the specified timestamp as
* its version to this Put operation.
* @param family family name
* @param qualifier column qualifier
* @param ts version timestamp
* @param value column value
* @return this
*/
public Put addColumn(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value, null);
list.add(kv);
return this;
}
代码示例来源:origin: org.apache.hbase/hbase-client
/**
* Add the specified column and value, with the specified timestamp as
* its version to this Put operation.
* @param family family name
* @param qualifier column qualifier
* @param ts version timestamp
* @param value column value
* @return this
*/
public Put addColumn(byte [] family, byte [] qualifier, long ts, byte [] value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value);
list.add(kv);
return this;
}
代码示例来源:origin: org.apache.hbase/hbase-client
/**
* See {@link #addColumn(byte[], byte[], long, byte[])}. This version expects
* that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
* Use {@link #add(Cell)} and {@link org.apache.hadoop.hbase.CellBuilder} instead
*/
@Deprecated
public Put addImmutable(byte [] family, byte [] qualifier, long ts, byte [] value) {
// Family can not be null, otherwise NullPointerException is thrown when putting the cell into familyMap
if (family == null) {
throw new IllegalArgumentException("Family cannot be null");
}
// Check timestamp
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
list.add(new IndividualBytesFieldCell(this.row, family, qualifier, ts, KeyValue.Type.Put, value));
return this;
}
代码示例来源:origin: org.apache.hbase/hbase-client
@Test
public void testPutCopyConstructor() throws IOException {
Put origin = new Put(Bytes.toBytes("ROW-01"));
origin.setPriority(100);
byte[] family = Bytes.toBytes("CF-01");
origin.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY)
.setRow(origin.getRow())
.setFamily(family)
.setQualifier(Bytes.toBytes("q"))
.setType(Cell.Type.Put)
.setValue(Bytes.toBytes("value"))
.build());
origin.addColumn(family, Bytes.toBytes("q0"), Bytes.toBytes("V-01"));
origin.addColumn(family, Bytes.toBytes("q1"), 100, Bytes.toBytes("V-01"));
Put clone = new Put(origin);
assertEquals(origin, clone);
origin.addColumn(family, Bytes.toBytes("q2"), Bytes.toBytes("V-02"));
//They should have different cell lists
assertNotEquals(origin.getCellList(family), clone.getCellList(family));
}
代码示例来源:origin: harbby/presto-connectors
/**
* See {@link #add(byte[], ByteBuffer, long, ByteBuffer)}. This version expects
* that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
*/
public Put addImmutable(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value, null);
list.add(kv);
familyMap.put(family, list);
return this;
}
代码示例来源:origin: harbby/presto-connectors
/**
* See {@link #add(byte[], byte[], long, byte[])}. This version expects
* that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
*/
public Put addImmutable(byte [] family, byte [] qualifier, long ts, byte [] value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value);
list.add(kv);
familyMap.put(family, list);
return this;
}
代码示例来源:origin: harbby/presto-connectors
/**
* Returns a list of all KeyValue objects with matching column family and qualifier.
*
* @param family column family
* @param qualifier column qualifier
* @return a list of KeyValue objects with the matching family and qualifier,
* returns an empty list if one doesn't exist for the given family.
*/
public List<Cell> get(byte[] family, byte[] qualifier) {
List<Cell> filteredList = new ArrayList<Cell>();
for (Cell cell: getCellList(family)) {
if (CellUtil.matchingQualifier(cell, qualifier)) {
filteredList.add(cell);
}
}
return filteredList;
}
代码示例来源:origin: com.aliyun.hbase/alihbase-client
/**
* Add the specified column and value, with the specified timestamp as
* its version to this Put operation.
* @param family family name
* @param qualifier column qualifier
* @param ts version timestamp
* @param value column value
* @return this
*/
public Put addColumn(byte [] family, byte [] qualifier, long ts, byte [] value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value);
list.add(kv);
return this;
}
代码示例来源:origin: com.aliyun.hbase/alihbase-client
/**
* Add the specified column and value, with the specified timestamp as
* its version to this Put operation.
* @param family family name
* @param qualifier column qualifier
* @param ts version timestamp
* @param value column value
* @return this
*/
public Put addColumn(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value, null);
list.add(kv);
return this;
}
代码示例来源:origin: com.aliyun.hbase/alihbase-client
/**
* See {@link #addColumn(byte[], ByteBuffer, long, ByteBuffer)}. This version expects
* that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
* Use {@link #add(Cell)} and {@link org.apache.hadoop.hbase.CellBuilder} instead
*/
@Deprecated
public Put addImmutable(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value, null);
list.add(kv);
return this;
}
代码示例来源:origin: harbby/presto-connectors
/**
* This expects that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
* <p>Marked as audience Private as of 1.2.0. {@link Tag} is an internal implementation detail
* that should not be exposed publicly.
*/
@InterfaceAudience.Private
public Put addImmutable(byte[] family, byte[] qualifier, long ts, byte[] value, Tag[] tag) {
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value, tag);
list.add(kv);
familyMap.put(family, list);
return this;
}
代码示例来源:origin: harbby/presto-connectors
/**
* Add the specified column and value, with the specified timestamp as
* its version to this Put operation.
* @param family family name
* @param qualifier column qualifier
* @param ts version timestamp
* @param value column value
* @return this
*/
public Put addColumn(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value, null);
list.add(kv);
familyMap.put(CellUtil.cloneFamily(kv), list);
return this;
}
代码示例来源:origin: harbby/presto-connectors
/**
* This expects that the underlying arrays won't change. It's intended
* for usage internal HBase to and for advanced client applications.
* <p>Marked as audience Private as of 1.2.0. {@link Tag} is an internal implementation detail
* that should not be exposed publicly.
*/
@InterfaceAudience.Private
public Put addImmutable(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value,
Tag[] tag) {
if (ts < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
}
List<Cell> list = getCellList(family);
KeyValue kv = createPutKeyValue(family, qualifier, ts, value, tag);
list.add(kv);
familyMap.put(family, list);
return this;
}
内容来源于网络,如有侵权,请联系作者删除!