* A reasonable method for generating unique version ids: combining a timestamp (in seconds) with a distributed unique
* Id from Hazelcast. In this way if the Hazelcast counter is restarted (for example after a cluster shutdown or
* restart) then the Ids will still be unique afterwards.
*/
public long uniqueVersionId() {
IdGenerator idGenerator = hz.getIdGenerator(CoordinationStructures.VERSION_GENERATOR);
long id = idGenerator.newId();
int timeSeconds = (int) (System.currentTimeMillis() / 1000);
long paddedId = id << 32;
return paddedId + timeSeconds;
}