Question

For any given Mutation is there an advantage to serializing an object to create a Value object to pass to said Mutation? Or is it better to just pass a CharSequence (Object.toString()) as the value?

Only issue I've found with using Values is that I have to de-serialize the Value byte array to get a workable Object. This leads to the loss of some type resolution but ultimately I still have an instance of whatever the object was when I converted it to a Value.

The problem I see with just storing a String is complete loss of type resolution, disregarding Strings of course, and the consequential need to have first hand knowledge of what the Object type was before hand, for the purposes of casting, if any form of analysis is to be performed.

Any Insight?

Was it helpful?

Solution

Use whatever serialization you like. Values in Accumulo hold arbitrary bytes. There's no reason to restrict yourself to bytes that represent a String. Keep in mind that the side effect is that you may not be able to read the content of the table without the appropriate de-serialization code. This may make certain provided tools, like the Accumulo shell, less useful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top