OPENDJ-1591 (CR-5256) Switch to SDK matching rules
Only the byte array comparator needs to be serializable (because JE btree comparators must be serializable).
ByteSequence comparator has no such need, so the intermediate AtributeIndex.BSKeyComparator is not needed anymore.
AtributeIndex.java:
Removed BSKeyComparator inner class and directly used ByteSequence.COMPARATOR instead.
| | |
| | | } |
| | | |
| | | /** |
| | | * Delegator to {@link ByteSequence#COMPARATOR}. |
| | | * <p> |
| | | * This intermediate class is necessary to satisfy JE's requirements for a btree comparator. |
| | | * |
| | | * @see com.sleepycat.je.DatabaseConfig#setBtreeComparator(Comparator) |
| | | */ |
| | | public static class BSKeyComparator implements Comparator<ByteSequence> |
| | | { |
| | | /** The instance. */ |
| | | public static final BSKeyComparator INSTANCE = new BSKeyComparator(); |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(ByteSequence a, ByteSequence b) |
| | | { |
| | | return ByteSequence.COMPARATOR.compare(a, b); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Close cursors related to the attribute indexes. |
| | | * |
| | | * @throws DatabaseException If a database error occurs. |
| | |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.spi.IndexingOptions; |
| | | import org.opends.server.backends.jeb.AttributeIndex.BSKeyComparator; |
| | | import org.opends.server.backends.jeb.AttributeIndex.KeyComparator; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.Modification; |
| | |
| | | */ |
| | | public final Comparator<ByteSequence> getBSComparator() |
| | | { |
| | | return BSKeyComparator.INSTANCE; |
| | | return ByteSequence.COMPARATOR; |
| | | } |
| | | |
| | | /** |