Skip to content

Commit

Permalink
Partial fix for DIRSERVER-1728: jdbm-partition
Browse files Browse the repository at this point in the history
  • Loading branch information
elecharny committed Aug 20, 2024
1 parent c906348 commit 2ecb188
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
15 changes: 8 additions & 7 deletions i18n/src/main/java/org/apache/directory/server/i18n/I18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ public enum I18n
// apacheds-jdbm-partition errors 31000 - 31999
ERR_31001_ODD_NUMBER_OF_BYTES_IN_SERIALIZED_STRING("ERR_31001_ODD_NUMBER_OF_BYTES_IN_SERIALIZED_STRING"),
ERR_31002_NEGATIOVE_NB_ATTRIBUTES_IN_ENTRY("ERR_31002_NEGATIOVE_NB_ATTRIBUTES_IN_ENTRY"),
ERR_31003_NOT_A_SERIALIZABLE_OBJECT("ERR_31003_NOT_A_SERIALIZABLE_OBJECT"),
ERR_31004_NOT_A_SERIALIZABLE_OBJECT_NULL_BYTE_ARRAY("ERR_31004_NOT_A_SERIALIZABLE_OBJECT_NULL_BYTE_ARRAY"),
ERR_31005_NOT_ARRAY_TREE_CONTAINER("ERR_31005_NOT_ARRAY_TREE_CONTAINER"),
ERR_31006_NOT_A_BTREE_CONTAINER("ERR_31006_NOT_A_BTREE_CONTAINER"),
ERR_31007_CURSOR_REQUIRES_DUPLICATE_KEY_ENABLED("ERR_31007_CURSOR_REQUIRES_DUPLICATE_KEY_ENABLED"),
ERR_31008_VALE_BASED_AVANCES_NOT_SUPPORTED("ERR_31008_VALE_BASED_AVANCES_NOT_SUPPORTED"),
ERR_31009_NULL_VALUE_COMPARATOR("ERR_31009_NULL_VALUE_COMPARATOR"),


// apacheds-kerberos-codec errors 32000 - 32999
// apacheds-ldif-partition errors 33000 - 33999
Expand Down Expand Up @@ -708,13 +716,6 @@ public enum I18n
ERR_565("ERR_565"),
ERR_566("ERR_566"),
ERR_567("ERR_567"),
ERR_568("ERR_568"),
ERR_569("ERR_569"),
ERR_570("ERR_570"),
ERR_571("ERR_571"),
ERR_572("ERR_572"),
ERR_573("ERR_573"),
ERR_592("ERR_592"),
ERR_597("ERR_597"),
// ERR_598( "ERR_598" ),
ERR_599("ERR_599"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,14 @@ ERR_28000_OBJECT_NOT_FOUND_IN_AT_REGISTRY={0} not found within the attributeType
# apacheds-jdbm-partition errors 31000 - 31999
ERR_31001_ODD_NUMBER_OF_BYTES_IN_SERIALIZED_STRING=The serialized String contains an odd number of bytes
ERR_31002_NEGATIOVE_NB_ATTRIBUTES_IN_ENTRY=The number of attributes is negative
ERR_31003_NOT_A_SERIALIZABLE_OBJECT=Not a serialized BTreeRedirect object: {0}
ERR_31004_NOT_A_SERIALIZABLE_OBJECT_NULL_BYTE_ARRAY=Not a serialized BTreeRedirect object: byte array is null.
ERR_31005_NOT_ARRAY_TREE_CONTAINER=this is not an arrayTree container
ERR_31006_NOT_A_BTREE_CONTAINER=this is not a btreeRedirect container
ERR_31007_CURSOR_REQUIRES_DUPLICATE_KEY_ENABLED=This cursor can only be used with tables that have duplicate keys enabled.
ERR_31008_VALE_BASED_AVANCES_NOT_SUPPORTED=Value based advances not supported.
ERR_31009_NULL_VALUE_COMPARATOR=Value comparator must not be null for tables with duplicate keys.



# apacheds-kerberos-codec errors 32000 - 32999
Expand Down Expand Up @@ -698,14 +706,6 @@ ERR_564=Cannot change setting while transactions are pending in the log
ERR_565=Bad magic on log file
ERR_566=Unexcepted exception: {0}
ERR_567=Invalid record manager provider\: {0}\n[{1}\: {2}]
ERR_568=Not a serialized BTreeRedirect object: {0}
ERR_569=Not a serialized BTreeRedirect object: byte array is null.
ERR_570=this is not an arrayTree container
ERR_571=this is not a btreeRedirect container
ERR_572=This cursor can only be used with tables that have duplicate keys enabled.
ERR_573=Value based advances not supported.

ERR_592=Value comparator must not be null for tables with duplicate keys.
ERR_597=Encoder unavailable for {0}
# ERR_598=
ERR_599=Error instantiating encoder for {0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ public final BTreeRedirect deserialize( byte[] bytes ) throws IOException
{
if ( bytes != null )
{
throw new IOException( I18n.err( I18n.ERR_568, Strings.dumpBytes( bytes ) ) );
throw new IOException( I18n.err( I18n.ERR_31003_NOT_A_SERIALIZABLE_OBJECT, Strings.dumpBytes( bytes ) ) );
}
else
{
throw new IOException( I18n.err( I18n.ERR_569 ) );
throw new IOException( I18n.err( I18n.ERR_31004_NOT_A_SERIALIZABLE_OBJECT_NULL_BYTE_ARRAY ) );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ final ArrayTree<V> getArrayTree()
{
if ( arrayTree == null )
{
throw new IllegalStateException( I18n.err( I18n.ERR_570 ) );
throw new IllegalStateException( I18n.err( I18n.ERR_31005_NOT_ARRAY_TREE_CONTAINER ) );
}

return arrayTree;
Expand All @@ -79,7 +79,7 @@ final BTreeRedirect getBTreeRedirect()
{
if ( btreeRedirect == null )
{
throw new IllegalStateException( I18n.err( I18n.ERR_571 ) );
throw new IllegalStateException( I18n.err( I18n.ERR_31006_NOT_A_BTREE_CONTAINER ) );
}

return btreeRedirect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public DupsContainerCursor( JdbmTable<K, V> table )

if ( !table.isDupsEnabled() )
{
throw new IllegalStateException( I18n.err( I18n.ERR_572 ) );
throw new IllegalStateException( I18n.err( I18n.ERR_31007_CURSOR_REQUIRES_DUPLICATE_KEY_ENABLED ) );
}

this.table = table;
Expand Down Expand Up @@ -189,7 +189,7 @@ public void afterKey( K key ) throws CursorException
*/
public void beforeValue( K key, DupsContainer<V> value ) throws Exception
{
throw new UnsupportedOperationException( I18n.err( I18n.ERR_573 ) );
throw new UnsupportedOperationException( I18n.err( I18n.ERR_31008_VALE_BASED_AVANCES_NOT_SUPPORTED ) );
}


Expand All @@ -198,7 +198,7 @@ public void beforeValue( K key, DupsContainer<V> value ) throws Exception
*/
public void afterValue( K key, DupsContainer<V> value ) throws Exception
{
throw new UnsupportedOperationException( I18n.err( I18n.ERR_573 ) );
throw new UnsupportedOperationException( I18n.err( I18n.ERR_31008_VALE_BASED_AVANCES_NOT_SUPPORTED ) );
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public JdbmTable( SchemaManager schemaManager, String name, int numDupLimit, Rec

if ( valueComparator == null )
{
throw new IllegalArgumentException( I18n.err( I18n.ERR_592 ) );
throw new IllegalArgumentException( I18n.err( I18n.ERR_31009_NULL_VALUE_COMPARATOR ) );
}

// TODO make the size of the duplicate btree cache configurable via constructor
Expand Down

0 comments on commit 2ecb188

Please sign in to comment.