org.apache.hadoop.hbase.util.Bytes.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(118)

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

Bytes.<init>介绍

[英]Create a zero-size sequence.
[中]创建一个零大小序列。

代码示例

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

private static <T> Bytes toBytesOrNull(T t, Function<T, byte[]> f) {
 if (t == null) {
  return null;
 } else {
  return new Bytes(f.apply(t));
 }
}

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

private static <T> Bytes toBytesOrNull(T t, Function<T, byte[]> f) {
 if (t == null) {
  return null;
 } else {
  return new Bytes(f.apply(t));
 }
}

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

private static Map<Bytes, Bytes> getDefaultValuesBytes() {
 Map<Bytes, Bytes> values = new HashMap<>();
 DEFAULT_VALUES.forEach((k, v) -> values.put(new Bytes(Bytes.toBytes(k)), new Bytes(Bytes.toBytes(v))));
 return values;
}

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

@Override
public Bytes getValue(Bytes key) {
 Bytes rval = values.get(key);
 return rval == null ? null : new Bytes(rval.copyBytes());
}

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

@Override
public byte[] getValue(byte[] key) {
 Bytes value = values.get(new Bytes(key));
 return value == null ? null : value.get();
}

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

/**
 * Set the raw crypto key attribute for the family
 *
 * @param keyBytes
 * @return this (for chained invocation)
 */
public ModifyableColumnFamilyDescriptor setEncryptionKey(byte[] keyBytes) {
 return setValue(ENCRYPTION_KEY_BYTES, new Bytes(keyBytes));
}

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

@Override
public byte[] getValue(byte[] key) {
 Bytes value = values.get(new Bytes(key));
 return value == null ? null : value.copyBytes();
}

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

/**
 * Remove metadata represented by the key from the {@link #values} map
 *
 * @param key Key whose key and value we're to remove from TableDescriptor
 * parameters.
 * @return the modifyable TD
 */
public ModifyableTableDescriptor removeValue(final byte[] key) {
 return removeValue(new Bytes(key));
}

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

@Override
public String get(String key) {
 Bytes ibw = new Bytes(Bytes
   .toBytes(key));
 if (!m.containsKey(ibw))
  return null;
 Bytes value = m.get(ibw);
 if (value == null || value.get() == null)
  return null;
 return Bytes.toString(value.get());
}

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

private ModifyableTableDescriptor(final TableName name, final Collection<ColumnFamilyDescriptor> families,
    Map<Bytes, Bytes> values) {
 this.name = name;
 families.forEach(c -> this.families.put(c.getName(), ColumnFamilyDescriptorBuilder.copy(c)));
 this.values.putAll(values);
 this.values.put(IS_META_KEY,
  new Bytes(Bytes.toBytes(Boolean.toString(name.equals(TableName.META_TABLE_NAME)))));
}

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

/**
 * Add coprocessor to values Map
 * @param specStr The Coprocessor specification all in in one String
 * @return Returns <code>this</code>
 */
private ModifyableTableDescriptor setCoprocessorToMap(final String specStr) {
 if (specStr == null) {
  return this;
 }
 // generate a coprocessor key
 int maxCoprocessorNumber = 0;
 Matcher keyMatcher;
 for (Map.Entry<Bytes, Bytes> e : this.values.entrySet()) {
  keyMatcher = CP_HTD_ATTR_KEY_PATTERN.matcher(Bytes.toString(e.getKey().get()));
  if (!keyMatcher.matches()) {
   continue;
  }
  maxCoprocessorNumber = Math.max(Integer.parseInt(keyMatcher.group(1)), maxCoprocessorNumber);
 }
 maxCoprocessorNumber++;
 String key = "coprocessor$" + Integer.toString(maxCoprocessorNumber);
 return setValue(new Bytes(Bytes.toBytes(key)), new Bytes(Bytes.toBytes(specStr)));
}

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

private Bytes strToIb(String s) {
 return new Bytes(Bytes.toBytes(s));
}

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

@Override
public String getValue(String key) {
 Bytes rval = values.get(new Bytes(Bytes.toBytes(key)));
 return rval == null ? null : Bytes.toString(rval.get(), rval.getOffset(), rval.getLength());
}

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

/**
 * @param key Key whose key and value we're to remove from HCD parameters.
 */
public void remove(final byte [] key) {
 getDelegateeForModification().removeValue(new Bytes(key));
}

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

if (contains(getMethod2Value.values(), str)) {
 LOG.info("Set to lower case " + str.toLowerCase());
 builder2.setValue(k, new Bytes(Bytes.toBytes(str.toLowerCase())));

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

private static <T extends Mutation> T toDelta(Function<Bytes, T> supplier, ConsumerWithException<T, Cell> consumer,
  final MutationProto proto, final CellScanner cellScanner) throws IOException {
 byte[] row = proto.hasRow() ? proto.getRow().toByteArray() : null;
 T mutation = row == null ? null : supplier.apply(new Bytes(row));
 int cellCount = proto.hasAssociatedCellCount() ? proto.getAssociatedCellCount() : 0;
 if (cellCount > 0) {
    mutation = supplier.apply(new Bytes(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()));

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

return new Bytes(cryptoByteStream.getBuffer(), 0, cryptoByteStream.size());
} else {
 return new Bytes(cryptoByteStream.getBuffer(), 0, cryptoByteStream.size());
 compressionStream.flush();
 compressionStream.finish();
 return new Bytes(compressedByteStream.getBuffer(), 0, compressedByteStream.size());
} else {
 return null;

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

private static <T extends Mutation> T toDelta(Function<Bytes, T> supplier, ConsumerWithException<T, Cell> consumer,
 final MutationProto proto, final CellScanner cellScanner) throws IOException {
 byte[] row = proto.hasRow() ? proto.getRow().toByteArray() : null;
 T mutation = row == null ? null : supplier.apply(new Bytes(row));
 int cellCount = proto.hasAssociatedCellCount() ? proto.getAssociatedCellCount() : 0;
 if (cellCount > 0) {
    mutation = supplier.apply(new Bytes(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()));

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

@Override
public String getValue(String key) {
 Bytes rval = values.get(new Bytes(Bytes.toBytes(key)));
 return rval == null ? null : Bytes.toString(rval.get(), rval.getOffset(), rval.getLength());
}

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

compressAndEncryptDat = new Bytes(baosInMemory.getBuffer(), 0, baosInMemory.size());

相关文章

微信公众号

最新文章

更多