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

x33g5p2x  于2022-01-26 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(226)

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

Put.addImmutable介绍

[英]See #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.
[中]请参阅#addColumn(字节[],字节缓冲,长,字节缓冲)。此版本预期基础阵列不会更改。它旨在用于高级客户端应用程序的内部HBase。

代码示例

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

/**
 * See {@link #addColumn(byte[], byte[], 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, byte [] value) {
 return addImmutable(family, qualifier, this.ts, value);
}

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

@Override
public void write(GTRecord rec) throws IOException {
  assert info.getColumnBlockCount() == 2;
  rowkey.clear();
  for (int i = 0; i < ID_LEN; i++) {
    rowkey.put((byte) 0);
  }
  rec.exportColumnBlock(0, rowkey);
  rowkey.flip();
  value.clear();
  rec.exportColumnBlock(1, value);
  value.flip();
  Put put = new Put(rowkey);
  put.addImmutable(CF_B, ByteBuffer.wrap(COL_B), HConstants.LATEST_TIMESTAMP, value);
  table.mutate(put);
}

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

/**
 * See {@link #addColumn(byte[], byte[], 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, byte [] value) {
 return addImmutable(family, qualifier, this.ts, value);
}

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

private MultiMutation getMultipleVersionMutation(int versions) {
    MultiMutation mutation = new MultiMutation(new ImmutableBytesPtr(ROW));
    for (int i = versions - 1; i >= 0; i--) {
      Put put = new Put(ROW);
      put.addImmutable(FAM, INDEXED_QUALIFIER, i, Bytes.toBytes(i));
      mutation.addAll(put);
    }
    return mutation;
  }
}

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

@Override
public PutBuilder addImmutable(byte[] family, byte[] qualifier, long ts, byte[] value) {
 put.addImmutable(family, qualifier, ts, value);
 return this;
}

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

@Override
public PutBuilder addImmutable(byte[] family, byte[] qualifier, byte[] value) {
 put.addImmutable(family, qualifier, value);
 return this;
}

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

@Override
public PutBuilder addImmutable(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
 put.addImmutable(family, qualifier, ts, value);
 return this;
}

代码示例来源:origin: co.cask.cdap/cdap-hbase-compat-base

@Override
public PutBuilder addImmutable(byte[] family, byte[] qualifier, byte[] value) {
 put.addImmutable(family, qualifier, value);
 return this;
}

代码示例来源:origin: co.cask.cdap/cdap-hbase-compat-base

@Override
public PutBuilder addImmutable(byte[] family, byte[] qualifier, long ts, byte[] value) {
 put.addImmutable(family, qualifier, ts, value);
 return this;
}

代码示例来源:origin: co.cask.cdap/cdap-hbase-compat-base

@Override
public PutBuilder addImmutable(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value) {
 put.addImmutable(family, qualifier, ts, value);
 return this;
}

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

/**
 * See {@link #addColumn(byte[], byte[], 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, byte [] value) {
 return addImmutable(family, qualifier, this.ts, value);
}

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

put.addImmutable(FAM, INDEXED_QUALIFIER, 4, VALUE_4);
mutation.addAll(put);
put = new Put(ROW);
put.addImmutable(FAM, INDEXED_QUALIFIER, 3, VALUE_3);
mutation.addAll(put);
put = new Put(ROW);
put.addImmutable(FAM, INDEXED_QUALIFIER, 2, VALUE_2);
mutation.addAll(put);

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

/**
 * Tests that updating an indexed column results in a DeleteFamily (prior index cell) and a Put
 * (new index cell)
 */
@Test
public void testGetMutableIndexUpdate() throws IOException {
  setCurrentRowState(FAM, INDEXED_QUALIFIER, 1, VALUE_1);
  // update ts and value
  Put put = new Put(ROW);
  put.addImmutable(FAM, INDEXED_QUALIFIER, 2, VALUE_2);
  MultiMutation mutation = new MultiMutation(new ImmutableBytesPtr(ROW));
  mutation.addAll(put);
  Collection<Pair<Mutation, byte[]>> indexUpdates =
      indexBuilder.getIndexUpdate(mutation, mockIndexMetaData);
  assertEquals(2, indexUpdates.size());
  assertContains(indexUpdates, 2, ROW, KeyValue.Type.DeleteFamily, FAM,
    new byte[0] /* qual not needed */, 2);
  assertContains(indexUpdates, ColumnTracker.NO_NEWER_PRIMARY_TABLE_ENTRY_TIMESTAMP, ROW,
    KeyValue.Type.Put, FAM, QueryConstants.EMPTY_COLUMN_BYTES, 2);
}

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

protected void addSystemLabel(Region region, Map<String, Integer> labels,
  Map<String, List<Integer>> userAuths) throws IOException {
 if (!labels.containsKey(SYSTEM_LABEL)) {
  Put p = new Put(Bytes.toBytes(SYSTEM_LABEL_ORDINAL));
  p.addImmutable(LABELS_TABLE_FAMILY, LABEL_QUALIFIER, Bytes.toBytes(SYSTEM_LABEL));
  region.put(p);
  labels.put(SYSTEM_LABEL, SYSTEM_LABEL_ORDINAL);
 }
}

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

private static Put addEmptyLocation(final Put p, int replicaId){
 p.addImmutable(HConstants.CATALOG_FAMILY, MetaTableAccessor.getServerColumn(replicaId), null);
 p.addImmutable(HConstants.CATALOG_FAMILY, MetaTableAccessor.getStartCodeColumn(replicaId),
  null);
 p.addImmutable(HConstants.CATALOG_FAMILY, MetaTableAccessor.getSeqNumColumn(replicaId), null);
 return p;
}

代码示例来源: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, byte [] value, Tag[] tag) {
 return addImmutable(family, qualifier, this.ts, value, tag);
}

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

private static Put addEmptyLocation(final Put p, int replicaId) {
 p.addImmutable(HConstants.CATALOG_FAMILY, MetaTableAccessor.getServerColumn(replicaId), null);
 p.addImmutable(HConstants.CATALOG_FAMILY, MetaTableAccessor.getStartCodeColumn(replicaId),
  null);
 p.addImmutable(HConstants.CATALOG_FAMILY, MetaTableAccessor.getSeqNumColumn(replicaId), null);
 return p;
}

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

public static Put addEmptyLocation(final Put p, int replicaId) {
  long now = EnvironmentEdgeManager.currentTime();
  p.addImmutable(HConstants.CATALOG_FAMILY, getServerColumn(replicaId), now, null);
  p.addImmutable(HConstants.CATALOG_FAMILY, getStartCodeColumn(replicaId), now, null);
  p.addImmutable(HConstants.CATALOG_FAMILY, getSeqNumColumn(replicaId), now, null);
  return p;
 }
}

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

public static Put addLocation(final Put p, final ServerName sn, long openSeqNum,
  long time, int replicaId){
 if (time <= 0) {
  time = EnvironmentEdgeManager.currentTime();
 }
 p.addImmutable(HConstants.CATALOG_FAMILY, getServerColumn(replicaId), time,
  Bytes.toBytes(sn.getHostAndPort()));
 p.addImmutable(HConstants.CATALOG_FAMILY, getStartCodeColumn(replicaId), time,
  Bytes.toBytes(sn.getStartcode()));
 p.addImmutable(HConstants.CATALOG_FAMILY, getSeqNumColumn(replicaId), time,
  Bytes.toBytes(openSeqNum));
 return p;
}

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

static void migrateSplitIfNecessary(final Result r, final Put p, final byte [] which)
  throws IOException {
 byte [] hriSplitBytes = getBytes(r, which);
 if (!isMigrated(hriSplitBytes)) {
  //This will 'migrate' the HRI from 092.x and 0.94.x to 0.96+ by reading the
  //writable serialization
  HRegionInfo hri = parseFrom(hriSplitBytes);
  p.addImmutable(HConstants.CATALOG_FAMILY, which, hri.toByteArray());
 }
}

相关文章