我试图弄清楚在ObjectGrid(IBM Extreme Scale)中序列化时我的对象有多大。我想向对象添加更多数据,但想了解它将占用多少空间。有办法确定吗?例如,是否可以在任何对象网格类上调用方法以获取字节?
谢谢
ObjectMap map = session.getMap("map");
map.setValueOutputFormat(OutputFormat.RAW);
SerializedValue sv = (SerializedValue) map.get(key);
int size = sv.getInputStream().size();
System.out.println("The serialized size of the value for key " + key + " is " + size);