OPENDJ-1708 Persistit: no rebuild-index support
Fixed several problems linked to wrong data encoding / decoding.
This includes an issue where JEB code was conceptually incorrect, but worked in practice.
However, rebuild-index still does not work: data seem to be written and committed to the DB successfully, but when reading back, it looks like this data was not persisted at all.
More analysis is required before closing this issue.
pluggable.EntryIDSet.java:
In toString(), rewrote the implementation to make it easier to read.
pluggable.ImportIDSet.java:
ImplemenOverrode toString(), like EntryIDSet.toString().
Renamed limit and doCount fields to indexEntryLimit and maintainCount.
Removed unused ctor.
In addEntryID() and add() renamed parameter from "i" to "entryId".
pluggable.Importer.java:
Removed useless IndexDBWriteTask.indexMap field.
In addToDB() and addDN2ID(), changed parameter's order.
In insertOrDeleteKey() and insertOrDeleteKeyCheckEntryLimit(), changed parameter named "i" to "position".
In writeByteStreams(), used INT_SIZE constant + called DataOutputStream.writeInt() instead of DataOutputStream.write() which only writes a byte.
Various code cleanups.
pluggable.IndexInputBuffer.java:
Removed now incorrect use of JE's PackedInteger.
pluggable.IndexOutputBuffer.java:
Removed now incorrect use of JE's PackedInteger.
Renamed writeIntBytes() and getIntegerValue() to writeInt() and readInt() to match JE's PackedInteger method.
Renamed writeID(), compare() and compare() to writeEntryID(), byteArraysEqual() and recordsEqual().
In various method, fixed int / long mix up coming from copying JEB's code.
Added writeLong().
Various code cleanups.
jeb.ImportIDSet.java:
Removed unused ctor.
In addEntryID() and add() renamed parameter from "i" to "entryId".
jeb.IndexOutputBuffer.java:
In all methods getReadLongLength() should have been used instead of getReadIntLength() because this is encoding an entryID (long). Despite being conceptually broken, but it was working in pactice because getReadLongLength() delegates to getReadIntLength().
Renamed writeID() to writeEntryID().
jeb.Importer.java:
Removed useless IndexDBWriteTask.indexMap field.
In addToDB() and addDN2ID(), changed parameter's order.
In insertOrDeleteKey() and insertOrDeleteKeyCheckEntryLimit(), changed parameter named "i" to "position".