When I define one replicated cluster, and Setup the unit-calculator to binary. hopefully, from the Coherence Mbeans, I should be able to see the object size vs units. By default, size is the same with unit. When I put some data to the replicated cluster. From the cluster jvm console, I get the following Errors. the cache extend client didn’t get any error. But when you query the cluster, No objects founds. they are all gone.
2010-07-09 15:50:47.790/300.414 Oracle Coherence GE 3.5.3/465 <Error> (thread=ReplicatedCache, member=1):
What does this error means? it looks like there are something wrong with the BinaryMemoryCalculator.calculateUnits
what’s the logic in this method. we can turn to JD-GUI [ java decompilers, like the .net reflector. ] I get the code here
/* */ public int calculateUnits(Object oKey, Object oValue)
So the error means either Key or Object is not a Binary type. How comes it is not a Binary? the system controls the internal storage.
how about dumping out the class type of key and the value?
BTrace is my friend then , basically, I want to print out the class of okey/ovalue before the method get called.
here is the Btrace script
/* BTrace Script Template */
then your can trace the cacheserver either by startuping btrace.bat pidofthejvm pathoftrace.java, or using btrace plugin for jvisualvm
as the error implys, it do store the object as the native format instead of the binary format
if I change the cachem schema back to distributed. No error, and the object is stored as Binary format.
INamedCache cache = CacheFactory.GetCache("repl-customer");
- if you use the replicated cache. the unit-calculator has to be Fixed.
- Objects is stored in different format. Native vs Binary for replicated mode and distributed mode
- if Object is stored in native format, will there be more footprint?
- replicated mode doesn’t support Index, check the blog here.