jivesoftware/tasmo — pull request #7 by davidtyee (2014-06-18 17:50:23+00:00)
Title: Deprecation of default string constructor for Id

Moving away from the string constructor for Id, and moving back to using the constructor that takes a long. This should be adequate for current id space concerns.

Here's what this addresses:

1) Deprecate the String constructor
2) Change the implementation of this constructor so that it it now converts the string to a bit packed long, basically by doing what pete suggested:

ByteBuffer buffer = ByteBuffer.wrap(coder.decode(oldStringFormOfId));
Id id = new Id(buffer.getLong());

This will essentially switches us to long representation everywhere, without the massive code change fanout. We can slowly, convert the depreciated constructor calls at our leisure.

3) Change the implementation of idFromJsonObject, so that it is backwards compatible, i.e. if the passed in json string is a bit packed long, we return a new Id constructed with a long. If it's not a bit packed long, we know this is legacy (i.e. existing json on the hdfs WAL) and we make sure we're backwards compatible.

I think this is a reasonable first step, it has a lot of goodness:

Deprecates the existing constructor
Seamless converts all users of the string constructor, to long representation
Maintains backwards compatibility with existing json, created and serialized with the older string constructor