def new_id(self):
with self._lock:<EOL><INDENT>curr = self._residue<EOL>self._residue += <NUM_LIT:1><EOL>if self._residue >= BLOCK_SIZE:<EOL><INDENT>increment = self._atomic_long.get_and_increment().result()<EOL>self._local = increment<EOL>self._residue = <NUM_LIT:0><EOL>return self.new_id()<EOL><DEDENT>return self._local * BLOCK_SIZE + curr<EOL><DEDENT>
Generates and returns a cluster-wide unique id. Generated ids are guaranteed to be unique for the entire cluster
as long as the cluster is live. If the cluster restarts, then id generation will start from 0.

:return: (long), cluster-wide new unique id.