本文整理了Java中org.apache.hadoop.hbase.util.Bytes.getLength()
方法的一些代码示例,展示了Bytes.getLength()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytes.getLength()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.util.Bytes
类名称:Bytes
方法名:getLength
暂无
代码示例来源:origin: apache/hbase
/**
* Getter for fetching an unmodifiable map.
*/
public Map<String, String> getConfiguration() {
return delegatee.getValues().entrySet().stream()
.collect(Collectors.toMap(
e -> Bytes.toString(e.getKey().get(), e.getKey().getOffset(), e.getKey().getLength()),
e -> Bytes.toString(e.getValue().get(), e.getValue().getOffset(), e.getValue().getLength())
));
}
代码示例来源:origin: apache/hbase
private <T> T getOrDefault(Bytes key, Function<String, T> function, T defaultValue) {
Bytes value = values.get(key);
if (value == null) {
return defaultValue;
} else {
return function.apply(Bytes.toString(value.get(), value.getOffset(), value.getLength()));
}
}
代码示例来源: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
/**
* Set the new Bytes to the contents of the passed
* <code>ibw</code>.
* @param ibw the value to set this Bytes to.
*/
public Bytes(final Bytes ibw) {
this(ibw.get(), ibw.getOffset(), ibw.getLength());
}
代码示例来源:origin: apache/hbase
desc.getValues().forEach((k, v) -> {
LOG.info(k.toString() + "=>" + v.toString());
String str = Bytes.toString(v.get(), v.getOffset(), v.getLength());
if (contains(getMethod2Value.values(), str)) {
LOG.info("Set to lower case " + str.toLowerCase());
代码示例来源:origin: apache/hbase
/**
* Convert a protocol buffer Mutate to an Append
* @param cellScanner
* @param proto the protocol buffer Mutate to convert
* @return the converted client Append
* @throws IOException
*/
public static Append toAppend(final MutationProto proto, final CellScanner cellScanner)
throws IOException {
MutationType type = proto.getMutateType();
assert type == MutationType.APPEND : type.name();
Append append = toDelta((Bytes row) -> new Append(row.get(), row.getOffset(), row.getLength()),
Append::add, proto, cellScanner);
if (proto.hasTimeRange()) {
TimeRange timeRange = toTimeRange(proto.getTimeRange());
append.setTimeRange(timeRange.getMin(), timeRange.getMax());
}
return append;
}
代码示例来源:origin: apache/hbase
/**
* Convert a protocol buffer Mutate to an Append
* @param cellScanner
* @param proto the protocol buffer Mutate to convert
* @return the converted client Append
* @throws IOException
*/
public static Append toAppend(final MutationProto proto, final CellScanner cellScanner)
throws IOException {
MutationType type = proto.getMutateType();
assert type == MutationType.APPEND : type.name();
Append append = toDelta((Bytes row) -> new Append(row.get(), row.getOffset(), row.getLength()),
Append::add, proto, cellScanner);
if (proto.hasTimeRange()) {
TimeRange timeRange = protoToTimeRange(proto.getTimeRange());
append.setTimeRange(timeRange.getMin(), timeRange.getMax());
}
return append;
}
代码示例来源:origin: apache/hbase
/**
* Convert a protocol buffer Mutate to an Increment
*
* @param proto the protocol buffer Mutate to convert
* @return the converted client Increment
* @throws IOException
*/
public static Increment toIncrement(final MutationProto proto, final CellScanner cellScanner)
throws IOException {
MutationType type = proto.getMutateType();
assert type == MutationType.INCREMENT : type.name();
Increment increment = toDelta((Bytes row) -> new Increment(row.get(), row.getOffset(), row.getLength()),
Increment::add, proto, cellScanner);
if (proto.hasTimeRange()) {
TimeRange timeRange = protoToTimeRange(proto.getTimeRange());
increment.setTimeRange(timeRange.getMin(), timeRange.getMax());
}
return increment;
}
代码示例来源:origin: apache/hbase
/**
* Convert a protocol buffer Mutate to an Increment
*
* @param proto the protocol buffer Mutate to convert
* @return the converted client Increment
* @throws IOException
*/
public static Increment toIncrement(final MutationProto proto, final CellScanner cellScanner)
throws IOException {
MutationType type = proto.getMutateType();
assert type == MutationType.INCREMENT : type.name();
Increment increment = toDelta((Bytes row) -> new Increment(row.get(), row.getOffset(), row.getLength()),
Increment::add, proto, cellScanner);
if (proto.hasTimeRange()) {
TimeRange timeRange = toTimeRange(proto.getTimeRange());
increment.setTimeRange(timeRange.getMin(), timeRange.getMax());
}
return increment;
}
代码示例来源:origin: apache/hbase
onDiskBlockBytesWithHeader = new ByteArrayOutputStream(compressAndEncryptDat.getLength());
compressAndEncryptDat.getOffset(), compressAndEncryptDat.getLength());
代码示例来源:origin: apache/phoenix
private static Map<String,Object> createPropertiesMap(Map<Bytes,Bytes> htableProps) {
Map<String,Object> props = Maps.newHashMapWithExpectedSize(htableProps.size());
for (Map.Entry<Bytes,Bytes> entry : htableProps.entrySet()) {
Bytes key = entry.getKey();
Bytes value = entry.getValue();
props.put(Bytes.toString(key.get(), key.getOffset(), key.getLength()),
Bytes.toString(value.get(), value.getOffset(), value.getLength()));
}
return props;
}
代码示例来源:origin: org.apache.hbase/hbase-client
/**
* Getter for fetching an unmodifiable map.
*/
public Map<String, String> getConfiguration() {
return delegatee.getValues().entrySet().stream()
.collect(Collectors.toMap(
e -> Bytes.toString(e.getKey().get(), e.getKey().getOffset(), e.getKey().getLength()),
e -> Bytes.toString(e.getValue().get(), e.getValue().getOffset(), e.getValue().getLength())
));
}
代码示例来源:origin: org.apache.hbase/hbase-client
private <T> T getOrDefault(Bytes key, Function<String, T> function, T defaultValue) {
Bytes value = values.get(key);
if (value == null) {
return defaultValue;
} else {
return function.apply(Bytes.toString(value.get(), value.getOffset(), value.getLength()));
}
}
代码示例来源: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: org.apache.hbase/hbase-client
/**
* Convert a protocol buffer Mutate to an Append
* @param cellScanner
* @param proto the protocol buffer Mutate to convert
* @return the converted client Append
* @throws IOException
*/
public static Append toAppend(final MutationProto proto, final CellScanner cellScanner)
throws IOException {
MutationType type = proto.getMutateType();
assert type == MutationType.APPEND : type.name();
Append append = toDelta((Bytes row) -> new Append(row.get(), row.getOffset(), row.getLength()),
Append::add, proto, cellScanner);
if (proto.hasTimeRange()) {
TimeRange timeRange = toTimeRange(proto.getTimeRange());
append.setTimeRange(timeRange.getMin(), timeRange.getMax());
}
return append;
}
代码示例来源:origin: org.apache.hbase/hbase-client
/**
* Convert a protocol buffer Mutate to an Append
* @param cellScanner
* @param proto the protocol buffer Mutate to convert
* @return the converted client Append
* @throws IOException
*/
public static Append toAppend(final MutationProto proto, final CellScanner cellScanner)
throws IOException {
MutationType type = proto.getMutateType();
assert type == MutationType.APPEND : type.name();
Append append = toDelta((Bytes row) -> new Append(row.get(), row.getOffset(), row.getLength()),
Append::add, proto, cellScanner);
if (proto.hasTimeRange()) {
TimeRange timeRange = protoToTimeRange(proto.getTimeRange());
append.setTimeRange(timeRange.getMin(), timeRange.getMax());
}
return append;
}
代码示例来源:origin: org.apache.hbase/hbase-client
/**
* Convert a protocol buffer Mutate to an Increment
*
* @param proto the protocol buffer Mutate to convert
* @return the converted client Increment
* @throws IOException
*/
public static Increment toIncrement(final MutationProto proto, final CellScanner cellScanner)
throws IOException {
MutationType type = proto.getMutateType();
assert type == MutationType.INCREMENT : type.name();
Increment increment = toDelta((Bytes row) -> new Increment(row.get(), row.getOffset(), row.getLength()),
Increment::add, proto, cellScanner);
if (proto.hasTimeRange()) {
TimeRange timeRange = toTimeRange(proto.getTimeRange());
increment.setTimeRange(timeRange.getMin(), timeRange.getMax());
}
return increment;
}
代码示例来源:origin: org.apache.hbase/hbase-client
/**
* Convert a protocol buffer Mutate to an Increment
*
* @param proto the protocol buffer Mutate to convert
* @return the converted client Increment
* @throws IOException
*/
public static Increment toIncrement(final MutationProto proto, final CellScanner cellScanner)
throws IOException {
MutationType type = proto.getMutateType();
assert type == MutationType.INCREMENT : type.name();
Increment increment = toDelta((Bytes row) -> new Increment(row.get(), row.getOffset(), row.getLength()),
Increment::add, proto, cellScanner);
if (proto.hasTimeRange()) {
TimeRange timeRange = protoToTimeRange(proto.getTimeRange());
increment.setTimeRange(timeRange.getMin(), timeRange.getMax());
}
return increment;
}
代码示例来源:origin: com.aliyun.hbase/alihbase-client
private <T> T getOrDefault(Bytes key, Function<String, T> function, T defaultValue) {
Bytes value = values.get(key);
if (value == null) {
return defaultValue;
} else {
return function.apply(Bytes.toString(value.get(), value.getOffset(), value.getLength()));
}
}
代码示例来源:origin: org.apache.hbase/hbase-common
/**
* Set the new Bytes to the contents of the passed
* <code>ibw</code>.
* @param ibw the value to set this Bytes to.
*/
public Bytes(final Bytes ibw) {
this(ibw.get(), ibw.getOffset(), ibw.getLength());
}
内容来源于网络,如有侵权,请联系作者删除!