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

x33g5p2x  于2022-01-21 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(145)

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

Increment.getCellList介绍

暂无

代码示例

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

/**
 * Increment the column from the specific family with the specified qualifier
 * by the specified amount.
 * <p>
 * Overrides previous calls to addColumn for this family and qualifier.
 * @param family family name
 * @param qualifier column qualifier
 * @param amount amount to increment by
 * @return the Increment object
 */
public Increment addColumn(byte [] family, byte [] qualifier, long amount) {
 if (family == null) {
  throw new IllegalArgumentException("family cannot be null");
 }
 List<Cell> list = getCellList(family);
 KeyValue kv = createPutKeyValue(family, qualifier, ts, Bytes.toBytes(amount));
 list.add(kv);
 return this;
}

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

@Test
public void testIncrementCopyConstructor() throws IOException {
 Increment origin = new Increment(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(100))
  .build());
 origin.addColumn(family, Bytes.toBytes("q0"), 4);
 origin.setTimeRange(100, 1000);
 Increment clone = new Increment(origin);
 assertEquals(origin, clone);
 origin.addColumn(family, Bytes.toBytes("q1"), 3);
 //They should have different cell lists
 assertNotEquals(origin.getCellList(family), clone.getCellList(family));
}

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

/**
 * Increment the column from the specific family with the specified qualifier
 * by the specified amount.
 * <p>
 * Overrides previous calls to addColumn for this family and qualifier.
 * @param family family name
 * @param qualifier column qualifier
 * @param amount amount to increment by
 * @return the Increment object
 */
public Increment addColumn(byte [] family, byte [] qualifier, long amount) {
 if (family == null) {
  throw new IllegalArgumentException("family cannot be null");
 }
 List<Cell> list = getCellList(family);
 KeyValue kv = createPutKeyValue(family, qualifier, ts, Bytes.toBytes(amount));
 list.add(kv);
 return this;
}

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

@Test
public void testIncrementCopyConstructor() throws IOException {
 Increment origin = new Increment(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(100))
  .build());
 origin.addColumn(family, Bytes.toBytes("q0"), 4);
 origin.setTimeRange(100, 1000);
 Increment clone = new Increment(origin);
 assertEquals(origin, clone);
 origin.addColumn(family, Bytes.toBytes("q1"), 3);
 //They should have different cell lists
 assertNotEquals(origin.getCellList(family), clone.getCellList(family));
}

代码示例来源:origin: com.aliyun.hbase/alihbase-client

/**
 * Increment the column from the specific family with the specified qualifier
 * by the specified amount.
 * <p>
 * Overrides previous calls to addColumn for this family and qualifier.
 * @param family family name
 * @param qualifier column qualifier
 * @param amount amount to increment by
 * @return the Increment object
 */
public Increment addColumn(byte [] family, byte [] qualifier, long amount) {
 if (family == null) {
  throw new IllegalArgumentException("family cannot be null");
 }
 List<Cell> list = getCellList(family);
 KeyValue kv = createPutKeyValue(family, qualifier, ts, Bytes.toBytes(amount));
 list.add(kv);
 return this;
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Increment the column from the specific family with the specified qualifier
 * by the specified amount.
 * <p>
 * Overrides previous calls to addColumn for this family and qualifier.
 * @param family family name
 * @param qualifier column qualifier
 * @param amount amount to increment by
 * @return the Increment object
 */
public Increment addColumn(byte [] family, byte [] qualifier, long amount) {
 if (family == null) {
  throw new IllegalArgumentException("family cannot be null");
 }
 if (qualifier == null) {
  throw new IllegalArgumentException("qualifier cannot be null");
 }
 List<Cell> list = getCellList(family);
 KeyValue kv = createPutKeyValue(family, qualifier, ts, Bytes.toBytes(amount));
 list.add(kv);
 familyMap.put(CellUtil.cloneFamily(kv), list);
 return this;
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Add the specified KeyValue to this operation.
 * @param cell individual Cell
 * @return this
 * @throws java.io.IOException e
 */
public Increment add(Cell cell) throws IOException{
 byte [] family = CellUtil.cloneFamily(cell);
 List<Cell> list = getCellList(family);
 //Checking that the row of the kv is the same as the put
 int res = Bytes.compareTo(this.row, 0, row.length,
   cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
 if (res != 0) {
  throw new WrongRowIOException("The row in " + cell +
   " doesn't match the original one " +  Bytes.toStringBinary(this.row));
 }
 list.add(cell);
 familyMap.put(family, list);
 return this;
}

相关文章