co.cask.cdap.api.common.Bytes.toStringBinary()方法的使用及代码示例

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

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

Bytes.toStringBinary介绍

[英]Converts the given byte buffer, from its array offset to its limit, to a string. The position and the mark are ignored.
[中]将给定字节缓冲区从其数组偏移量转换为字符串。位置和标记将被忽略。

代码示例

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

@Override
public String toString() {
 return "TableSplit{" +
  "start=" + Bytes.toStringBinary(start) +
  ", stop=" + Bytes.toStringBinary(stop) +
  '}';
}

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

@Override
 public String toString() {
  return "(" + (start == null ? "null" : "'" + Bytes.toStringBinary(start)) + "'"
   + ".." + (stop == null ? "null" : "'" + Bytes.toStringBinary(stop) + "'") + ")";
 }
}

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

@Override
 public String toString() {
  return "Scan{" +
   "startRow=" + Bytes.toStringBinary(startRow) +
   ", stopRow=" + Bytes.toStringBinary(stopRow) +
   ", filter=" + filter +
   ", properties=" + properties +
   '}';
 }
}

代码示例来源:origin: co.cask.cdap/cdap-common

@Override
 public void onFailure(Throwable t) {
  LOG.error("Failed to save assignment {}", Bytes.toStringBinary(data), t);
  doNotifyFailed(t);
 }
}, executor

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

@Override
 public void onFailure(Throwable t) {
  LOG.error("Failed to save assignment {}", Bytes.toStringBinary(data), t);
  doNotifyFailed(t);
 }
}, executor

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

private void assertIndexedColumn(byte[] column) {
 if (!indexedColumns.contains(column)) {
  throw new IllegalArgumentException("Column " + Bytes.toStringBinary(column) + " is not configured for indexing");
 }
}

代码示例来源:origin: co.cask.cdap/cdap-data-fabric

@Override
public String toString() {
 return Objects.toStringHelper(this)
  .add("data", Bytes.toStringBinary(this.data))
  .add("hashKeys", this.hashKeys)
  .toString();
}

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

@Override
 public String toString() {
  return Objects.toStringHelper(this)
   .add("identifier", identifier)
   .add("keyId", keyId)
   .add("digest", Bytes.toStringBinary(digest))
   .toString();
 }
}

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

public static <T> void set(Configuration conf, String key, Codec<T> codec, T obj) throws IOException {
 byte[] encoded = codec.encode(obj);
 LOG.trace("Serializing {} {}", key, Bytes.toStringBinary(encoded));
 conf.set(key, Base64.encodeBase64String(encoded));
}

代码示例来源:origin: co.cask.cdap/cdap-data-fabric

@Override
public String toString() {
 final StringBuilder sb = new StringBuilder();
 sb.append("FuzzyRowFilter");
 sb.append("{fuzzyKeysData=");
 for (ImmutablePair<byte[], byte[]> fuzzyData : fuzzyKeysData) {
  sb.append('{').append(Bytes.toStringBinary(fuzzyData.getFirst())).append(":");
  sb.append(Bytes.toStringBinary(fuzzyData.getSecond())).append('}');
 }
 sb.append("}, ");
 return sb.toString();
}

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

@Override
public String toString() {
 final StringBuilder sb = new StringBuilder();
 sb.append("FuzzyRowFilter");
 sb.append("{fuzzyKeysData=");
 for (ImmutablePair<byte[], byte[]> fuzzyData : fuzzyKeysData) {
  sb.append('{').append(Bytes.toStringBinary(fuzzyData.getFirst())).append(":");
  sb.append(Bytes.toStringBinary(fuzzyData.getSecond())).append('}');
 }
 sb.append("}, ");
 return sb.toString();
}

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

public static <T> void set(Map<String, String> conf, String key, Codec<T> codec, T obj) throws IOException {
 byte[] encoded = codec.encode(obj);
 LOG.trace("Serializing {} {}", key, Bytes.toStringBinary(encoded));
 conf.put(key, Base64.encodeBase64String(encoded));
}

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

public static <T> T get(Configuration conf, String key, Codec<T> codec) throws IOException {
 String value = conf.get(key);
 if (value == null) {
  LOG.trace("De-serializing {} with null value", key);
  return codec.decode(null);
 }
 byte[] encoded = Base64.decodeBase64(value);
 LOG.trace("De-serializing {} {}", key, Bytes.toStringBinary(encoded));
 return codec.decode(encoded);
}

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

public static <T> T get(Map<String, String> conf, String key, Codec<T> codec) throws IOException {
 String value = conf.get(key);
 if (value == null) {
  LOG.trace("De-serializing {} with null value", key);
  return codec.decode(null);
 }
 byte[] encoded = Base64.decodeBase64(value);
 LOG.trace("De-serializing {} {}", key, Bytes.toStringBinary(encoded));
 return codec.decode(encoded);
}

代码示例来源:origin: co.cask.cdap/cdap-common

public static <T> T get(Configuration conf, String key, Codec<T> codec) throws IOException {
 String value = conf.get(key);
 if (value == null) {
  LOG.trace("De-serializing {} with null value", key);
  return codec.decode(null);
 }
 byte[] encoded = Base64.decodeBase64(value);
 LOG.trace("De-serializing {} {}", key, Bytes.toStringBinary(encoded));
 return codec.decode(encoded);
}

代码示例来源:origin: co.cask.cdap/cdap-common

@Override
public void onSuccess(NodeData result) {
 try {
  ResourceAssignment assignment = CoordinationConstants.RESOURCE_ASSIGNMENT_CODEC.decode(result.getData());
  LOG.debug("Received resource assignment for {}. {}", serviceName, assignment.getAssignments());
  handleAssignmentChange(serviceName, assignment);
 } catch (Exception e) {
  LOG.error("Failed to decode ResourceAssignment {}", Bytes.toStringBinary(result.getData()), e);
 }
}

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

@Override
public void onSuccess(NodeData result) {
 try {
  ResourceAssignment assignment = CoordinationConstants.RESOURCE_ASSIGNMENT_CODEC.decode(result.getData());
  LOG.debug("Received resource assignment for {}. {}", serviceName, assignment.getAssignments());
  handleAssignmentChange(serviceName, assignment);
 } catch (Exception e) {
  LOG.error("Failed to decode ResourceAssignment {}", Bytes.toStringBinary(result.getData()), e);
 }
}

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

@Override
 public String toString() {
  return "Field{" +
   "name='" + fieldType.getName() + '\'' +
   ", type='" + fieldType.getType() + '\'' +
   ", value='" +
   (fieldType.getType() == FieldType.Type.BYTES ? Bytes.toStringBinary((byte[]) value) : value) + '\'' +
   '}';
 }
}

代码示例来源:origin: co.cask.cdap/cdap-data-fabric

@ReadOnly
@Override
public Row get(byte[] row, byte[][] columns) {
 ensureTransactionIsStarted();
 reportRead(1);
 try {
  return new Result(row, getRowMap(row, columns));
 } catch (Exception e) {
  LOG.debug("get failed for table: " + getTransactionAwareName() + ", row: " + Bytes.toStringBinary(row), e);
  throw new DataSetException("get failed", e);
 }
}

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

@ReadOnly
@Override
public Row get(byte[] row, byte[][] columns) {
 ensureTransactionIsStarted();
 reportRead(1);
 try {
  return new Result(row, getRowMap(row, columns));
 } catch (Exception e) {
  LOG.debug("get failed for table: " + getTransactionAwareName() + ", row: " + Bytes.toStringBinary(row), e);
  throw new DataSetException("get failed", e);
 }
}

相关文章