Skip to content

Commit

Permalink
GenericKeyState cleanup: Read return boolean, copy also copies arrays…
Browse files Browse the repository at this point in the history
…, more

1. GenericKeyState return boolean on read instead of initializing dummy value
and let CompositeGenericKey do that instead.
2. copyFrom also copies array state if needed.
3. InitializeToDummy value also clear previous state.
4. initAsPrefix* does not clear because should have same behaviour as
initValueAs*.
5. bytesDereferenced flag is not relevant for String array because byte arrays
get deserialized into real String objects.
  • Loading branch information
burqen committed Jul 27, 2018
1 parent c5735c3 commit 95c9a04
Show file tree
Hide file tree
Showing 2 changed files with 219 additions and 120 deletions.
Expand Up @@ -158,7 +158,11 @@ void read( PageCursor cursor, int keySize )
int offset = cursor.getOffset();
for ( GenericKeyState state : states )
{
state.read( cursor, keySize );
if ( !state.read( cursor, keySize ) )
{
initializeToDummyValue();
return;
}
int offsetAfterRead = cursor.getOffset();
keySize -= offsetAfterRead - offset;
offset = offsetAfterRead;
Expand Down

0 comments on commit 95c9a04

Please sign in to comment.