Madan Jampani
Committed by Pavlin Radoslavov

Printing a summary (total size) when generating toString representation of byte …

…arrays in WriteRequest and VersionedValue

Change-Id: If068a4e602fd5cc3932f09fc3ab54a7dea47f1f2
package org.onlab.onos.store.service;
import static org.onlab.util.HexString.toHexString;
import java.util.Arrays;
import com.google.common.base.MoreObjects;
......@@ -66,7 +64,7 @@ public class VersionedValue {
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("version", version)
.add("value", toHexString(value))
.add("value", value != null ? "[" + value.length + " bytes]" : value)
.toString();
}
}
......
......@@ -3,7 +3,6 @@ package org.onlab.onos.store.service;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.onlab.onos.store.service.WriteRequest.Type.*;
import static org.onlab.util.HexString.toHexString;
import java.util.Objects;
......@@ -190,9 +189,9 @@ public class WriteRequest {
.add("type", type)
.add("tableName", tableName)
.add("key", key)
.add("newValue", toHexString(newValue))
.add("newValue", newValue != null ? "[" + newValue.length + " bytes]" : newValue)
.add("previousVersion", previousVersion)
.add("oldValue", toHexString(oldValue))
.add("oldValue", oldValue != null ? "[" + oldValue.length + " bytes]" : oldValue)
.toString();
}
......