WebSphere eXtreme Scale V8.6 IBM Extreme Scale



我正试图弄清楚在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);

最新更新