net.openhft.chronicle.bytes.Bytes.toDebugString()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(98)

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

Bytes.toDebugString介绍

暂无

代码示例

代码示例来源:origin: net.openhft/chronicle-engine

void logYaml() {
  if (YamlLogging.showServerWrites())
    try {
      assert outWire.startUse();
      LOG.info("\nServer Sends:\n" +
          Wires.fromSizePrefixedBlobs((Wire) outWire));
    } catch (Exception e) {
      Jvm.warn().on(getClass(), "\nServer Sends ( corrupted ) :\n" +
          outWire.bytes().toDebugString());
    } finally {
      assert outWire.endUse();
    }
}

代码示例来源:origin: net.openhft/chronicle-engine

/**
 * write and exceptions and rolls back if no data was written
 */
void writeData(boolean isNotComplete, @NotNull Bytes inBytes, @NotNull WriteMarshallable c) {
  @NotNull final WriteMarshallable marshallable = out -> {
    final long readPosition = inBytes.readPosition();
    final long position = outWire.bytes().writePosition();
    try {
      c.writeMarshallable(outWire);
    } catch (Throwable t) {
      inBytes.readPosition(readPosition);
      if (LOG.isInfoEnabled())
        LOG.info("While reading " + inBytes.toDebugString(),
            " processing wire " + c, t);
      outWire.bytes().writePosition(position);
      outWire.writeEventName(() -> "exception").throwable(t);
    }
    // write 'reply : {} ' if no data was sent
    if (position == outWire.bytes().writePosition()) {
      outWire.writeEventName(reply).marshallable(EMPTY);
    }
  };
  if (isNotComplete)
    outWire.writeNotCompleteDocument(false, marshallable);
  else
    outWire.writeDocument(false, marshallable);
  logYaml();
}

代码示例来源:origin: net.openhft/chronicle-engine

/**
 * write and exceptions and rolls back if no data was written
 */
void writeData(@NotNull WireIn wireIn, @NotNull WriteMarshallable c) {
  @NotNull Bytes inBytes = wireIn.bytes();
  outWire.writeDocument(false, out -> {
    final long readPosition = inBytes.readPosition();
    final long position = outWire.bytes().writePosition();
    try {
      c.writeMarshallable(outWire);
    } catch (Throwable t) {
      final String readingYaml = wireIn.readingPeekYaml();
      inBytes.readPosition(readPosition);
      if (LOG.isInfoEnabled())
        LOG.info("While readingBytes=" + inBytes.toDebugString() + "\nreadingYaml=" +
                readingYaml,
            "\nprocessing wire " + c, t);
      outWire.bytes().writePosition(position);
      outWire.writeEventName(() -> "readingYaml").text(readingYaml);
      outWire.writeEventName(() -> "exception").throwable(t);
    }
    // write 'reply : {} ' if no data was sent
    if (position == outWire.bytes().writePosition()) {
      outWire.writeEventName(reply).marshallable(EMPTY);
    }
  });
  logYaml();
}

代码示例来源:origin: net.openhft/chronicle-engine

Jvm.warn().on(getClass(), in.readingPeekYaml() + "/n" + in.bytes().toDebugString(),
    e);

代码示例来源:origin: net.openhft/saxophone

LOG.debug("lexed %s: '" + tok + outBuf.toDebugString() + "'");

相关文章

微信公众号

最新文章

更多