kazukidb / kazuki

Kazuki: a harmonious data store
Other
5 stars 4 forks source link

Howto needed: how to store and re-synthesize keys #14

Closed mrprescott closed 10 years ago

mrprescott commented 10 years ago

Kazuki keys are defined by the interface Key. Since the keys are being persisted elsewhere as handles (i.e. in another registry, or in another kz store!), I need a way to compress them into something like a String, and then re-create a valid KZ Key from that representation.

Right now I'm using KeyImpl.valueOf(Key.toString()) as the round trip, but that's not legal.

jdillon commented 10 years ago

Any reason why Key isn't a simple pojo? Interface here means you have to have impls, helpers and factories. For something so simple a plain class would probably be simpler.

sunnygleason commented 10 years ago

Implemented in KZ 0.5.9 and master (0.6.x series) -- KeyValueStore and SequenceService both have parseKey and parseVersion methods. KeyValueStore delegates to its internal SequenceService.