本文整理了Java中org.infinispan.commons.util.Util.printArray()
方法的一些代码示例,展示了Util.printArray()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.printArray()
方法的具体详情如下:
包路径:org.infinispan.commons.util.Util
类名称:Util
方法名:printArray
暂无
代码示例来源:origin: org.infinispan/infinispan-commons
@Override
public String toString() {
return "WrappedByteArray{" +
"bytes=" + Util.printArray(bytes) +
", hashCode=" + hashCode +
'}';
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
@Override
public String toString() {
return "ClientCounterEvent{" +
"counterName='" + counterName + '\'' +
", event=" + event +
", version=" + version +
", listenerId=" + Util.printArray(listenerId) +
'}';
}
代码示例来源:origin: org.infinispan/infinispan-commons
public static String printArray(byte[] array) {
return printArray(array, false);
}
代码示例来源:origin: org.infinispan/infinispan-persistence-soft-index
@Override
public String toString() {
return "IndexRequest{" +
"key=" + key +
", serializedKey=" + Util.printArray(serializedKey) +
", file=" + file +
", offset=" + offset +
", prevFile=" + prevFile +
", prevOffset=" + prevOffset +
", size=" + size +
", type=" + type +
'}';
}
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
String checkForNull(Object obj) {
if (obj == null || obj instanceof String && ((String) obj).isEmpty()) {
return "-";
} else if (obj instanceof byte[]) {
return Util.printArray((byte[]) obj);
} else {
return obj.toString();
}
}
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
@Override
public String toString() {
return "TransactionWrite{" +
"key=" + Util.printArray(key, true) +
", versionRead=" + versionRead +
", control=" + ControlByte.prettyPrint(control) +
", metadata=" + metadata +
", value=" + Util.printArray(value, true) +
'}';
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
@Override
public String toString() {
return "KeyEvent{" +
"version=" + version +
", messageId=" + messageId +
", op=" + op +
", listenerId=" + Util.printArray(listenerId, false) +
", isRetried=" + isRetried +
", key=" + Util.toStr(key) +
'}';
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
@Override
public String toString() {
return "CustomRawEvent{" +
"version=" + version +
", messageId=" + messageId +
", op=" + op +
", listenerId=" + Util.printArray(listenerId, false) +
", isRetried=" + isRetried +
", event=" + Util.toStr(eventData) +
'}';
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
@Override
public String toString() {
return "KeyWithVersionEvent{" +
"version=" + version +
", messageId=" + messageId +
", op=" + op +
", listenerId=" + Util.printArray(listenerId, false) +
", isRetried=" + isRetried +
", key=" + Util.toStr(key) +
", dataVersion=" + dataVersion +
'}';
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
@Override
public String toString() {
return "CustomEvent{" +
"version=" + version +
", messageId=" + messageId +
", op=" + op +
", listenerId=" + Util.printArray(listenerId, false) +
", isRetried=" + isRetried +
", event=" + Util.toStr(eventData) +
'}';
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
public static void assertByteArrayEquals(byte[] expected, byte[] actual) {
boolean isArrayEquals = Arrays.equals(expected, actual);
assertTrue("Retrieved data should have contained " + Util.printArray(expected, true) + " (" + new String(expected)
+ "), but instead we received " + Util.printArray(actual, true) + " (" + new String(actual) +")", isArrayEquals);
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
@Override
public ByteBuf valueResponse(HotRodHeader header, HotRodServer server, ByteBufAllocator alloc, OperationStatus status, byte[] prev) {
ByteBuf buf = writeHeader(header, server, alloc, status);
if (prev == null) {
buf.writeByte(0);
} else {
ExtendedByteBuf.writeRangedBytes(prev, buf);
}
if (trace) {
log.tracef("Write response to %s messageId=%d status=%s prev=%s", header.op, header.messageId, status, Util.printArray(prev));
}
return buf;
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
public static boolean assertSuccess(TestGetResponse resp, byte[] expected) {
assertStatus(resp, Success);
boolean isArrayEquals = Arrays.equals(expected, resp.data.get());
assertTrue("Retrieved data should have contained " + Util.printArray(expected, true) + " (" + new String(expected)
+ "), but instead we received " + Util.printArray(resp.data.get(), true) + " (" + new String(resp.data.get()) +")", isArrayEquals);
return isArrayEquals;
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
private byte[] k(Method m, String prefix) {
byte[] bytes = (prefix + m.getName()).getBytes();
log.tracef("String %s is converted to %s bytes", prefix + m.getName(), Util.printArray(bytes, true));
return bytes;
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
public static byte[] k(Method m, String prefix) {
byte[] bytes = (prefix + m.getName()).getBytes();
log.tracef("String %s is converted to %s bytes", prefix + m.getName(), Util.printArray(bytes, true));
return bytes;
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("Op{");
sb.append("magic=").append(magic);
sb.append(", version=").append(version);
sb.append(", code=").append(code);
sb.append(", cacheName='").append(cacheName).append('\'');
sb.append(", key=");
sb.append(Util.printArray(key));
sb.append(", lifespan=").append(lifespan);
sb.append(", maxIdle=").append(maxIdle);
sb.append(", value=");
sb.append(Util.printArray(value));
sb.append(", flags=").append(flags);
sb.append(", dataVersion=").append(dataVersion);
sb.append(", clientIntel=").append(clientIntel);
sb.append(", topologyId=").append(topologyId);
sb.append(", id=").append(id);
sb.append('}');
return sb.toString();
}
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
public void set(byte[] key, byte[] value, int lifespan, int maxIdle) {
log.debugf("SET[%s] (%s, %s, %s, &s)", xid, printArray(key, true), printArray(value, true), lifespan, maxIdle);
ContextValue contextValue = txContext.computeIfAbsent(new WrappedByteArray(key), RemoteTransaction::notRead);
contextValue.set(value, lifespan, maxIdle);
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
@Override
public ByteBuf valueResponse(HotRodHeader header, HotRodServer server, ByteBufAllocator alloc, OperationStatus status, byte[] prev) {
ByteBuf buf = writeHeader(header, server, alloc, status);
if (prev == null) {
ExtendedByteBuf.writeUnsignedInt(0, buf);
} else {
ExtendedByteBuf.writeRangedBytes(prev, buf);
}
if (trace) {
log.tracef("Write response to %s messageId=%d status=%s prev=%s", header.op, header.messageId, status, Util.printArray(prev));
}
return buf;
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
private byte[] get(byte[] key) {
log.debugf("GET[%s] (%s)", xid, printArray(key, true));
ContextValue value = txContext.get(new WrappedByteArray(key));
if (value != null) {
return value.value;
}
return performGet(key).value;
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
public void getAndAssert(byte[] key, byte[] expectedValue) {
final String message = format("[XID=%s] Wrong value for key %s", xid, printArray(key, true));
if (expectedValue == null) {
assertEquals(message, null, get(key));
} else {
assertArrayEquals(message, expectedValue, get(key));
}
}
内容来源于网络,如有侵权,请联系作者删除!