aerospike / aerospike-client-java

Aerospike Java Client Library
Other
236 stars 212 forks source link

HasMap is replaced by LinkedHashMap #169

Closed alexradzin closed 4 years ago

alexradzin commented 4 years ago

This is done in order to preserve bins order on read, so client returns bins in the same order as they have been written.

The problem is that bins read from the database are stored in HashMap that is in turn passed to constructor of Record. HashMap does not preserve order of keys, so the bins retrieved from the record in "random" order. This does not happen in case of clients written in other languages (e.g. python) where map stores keys in order the same order they have been passed. LinkedHashMap behaves like HashMap when retrieving values by key, but returns keys in the same order as they were inserted.

BrianNichols commented 4 years ago

If the performance impact is minimal, we will include this pull request in the next release.

alexradzin commented 4 years ago

If the performance impact is minimal, we will include this pull request in the next release.

IMHO the performance will be even better because now the null check is done only once.

BrianNichols commented 4 years ago

This pull request missed today's 4.4.16 release. We will include it in the upcoming 4.4.17 release next week.

BrianNichols commented 4 years ago

Version 4.4.17 is released with this pull request.