-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit aa4b435
committed
The logic for generating machine identifier has changed. Since we are java 6 minimum now, using NetworkInterface.getHardwareAddress() for more uniqueness.
The logic for generating process identifier has changed. It attempts to get the actual numeric process id from JMX, falling back to a string hash only if if it can't. It looks for a pattern in the process name of <process_id>@<host_name>. No longer using the classloader hash either, since each class loader will have a separate instance of NEXT_COUNTER, which is seeded with a random number and so is very unlikely to clash.
Removed a bunch of stuff
Removed support for 'babble' format.
Removed constructors that didn't conform to the spec (machine identifier only, instead of machine identifer and process identifier)
Removed support for isNew/notNew. I don't see a need for this. It was only used in save method, and it seems the only purpose is to decide whether to do an insert of an upsert. I don't see any harm in always doing an upsert. This also has
the nice property of making ObjectId immutable.
Removed a bunch of poorly named methods: _flip(int), _inc(), _machine(), _time()
Removed massageToObjectId(java.lang.Object)' factory method
Other non-backwards compatible changes:
equals method will no longer compare equal to anything but an ObjectId
Additionally, added getters that conform to the spec: timestamp, machineIdentifier, processIdentifier, and counter. Deprecated the old ones.
1 parent fb90e92 commit aa4b435Copy full SHA for aa4b435
File tree
Expand file treeCollapse file tree
2 files changed
+539
-237
lines changedFilter options
- bson/src
- main/org/bson/types
- test/org/bson/types
Expand file treeCollapse file tree
2 files changed
+539
-237
lines changed
0 commit comments