我正在尝试弄清楚我的对象在ObjectGrid (IBM Extreme Scale)中序列化时有多大。我想要向对象添加更多的数据,但又想看看它将占用多少空间。有没有办法可以确定这一点?例如,我可以在任何对象网格类上调用一个方法来获取字节吗?
谢谢
发布于 2020-05-02 00:13:52
为了查看插入到网格中的条目的序列化值的大小,您需要执行如下代码:
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);https://stackoverflow.com/questions/61274178
复制相似问题