简体   繁体   English

hazelcast的putTransient问题

[英]issue with putTransient for hazelcast

I will try posting on their google forums as well. 我也会尝试在他们的Google论坛上发帖。 I have used putTransient on map before without any issues - however, in all those cases, putTransient was being called on a map where the value was a single user defined object. 我之前在地图上使用过putTransient都没有任何问题-但是,在所有这些情况下,在值是单个用户定义对象的地图上调用putTransient。 I am now trying putTransient on a map where the value is a LinkedHashSet of user defined objects (serializable). 我现在尝试在地图上的putTransient上,该地图的值是用户定义的对象(可序列化)的LinkedHashSet。 The regular put works fine for this LinkedHashSet - the putTransient complains the this method is undefined for the map. 常规的put对此LinkedHashSet可以正常工作-putTransient抱怨该方法在地图上未定义。 I have copied the relevant line of code below: 我复制了下面的相关代码行:

//testSet is LinkedHashSet of user defined object (fields are String, Boolean and Integer)
Long ttl = new Long(0);
testMap.putTransient(test.TypeUUID, testSet, ttl, TimeUnit.SECONDS); 

Any suggestions to further troubleshoot/fix this would be welcome. 任何进一步解决问题/修复问题的建议都将受到欢迎。
I have tried both 2.4 and 2.5 versions. 我已经尝试了2.4和2.5版本。 Thanks 谢谢

pilot error - I should have declared the map as IMap and not Map. 试验错误-我应该将地图声明为IMap而不是Map。 Thanks to Brian for commenting. 感谢Brian的评论。

//should be
IMap<String, LinkedHashSet<UserDefinedObject>>

//and not 
Map<String, LinkedHashSet<UserDefinedObject>>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM