KEY - type of keyVALUE - type of valuepublic interface Layout<KEY,VALUE> extends Comparator<KEY>
GBPTree, how its keys and values are represented
as bytes and what keys and values contains.
Additionally custom meta data can be supplied, which will be persisted in GBPTree.
Rather extend Layout.Adapter as to get standard implementation of e.g. Layout.Adapter.toString().
| Modifier and Type | Interface and Description |
|---|---|
static class |
Layout.Adapter<KEY,VALUE>
Adapter for
Layout, which contains convenient standard implementations of some methods. |
| Modifier and Type | Method and Description |
|---|---|
KEY |
copyKey(KEY key,
KEY into)
Copies contents of
key to into. |
long |
identifier()
Used as a checksum for when loading an index after creation, to verify that the same layout is used,
as the one it was initially created with.
|
int |
keySize() |
int |
majorVersion() |
int |
minorVersion() |
static long |
namedIdentifier(String name,
int checksum)
Utility method for generating an
identifier(). |
KEY |
newKey() |
VALUE |
newValue() |
void |
readKey(org.neo4j.io.pagecache.PageCursor cursor,
KEY into)
Reads key contents at
cursor at its current offset into key. |
default void |
readMetaData(org.neo4j.io.pagecache.PageCursor cursor)
Reads meta data specific to this layout instance from
cursor at its current offset. |
void |
readValue(org.neo4j.io.pagecache.PageCursor cursor,
VALUE into)
Reads value contents at
cursor at its current offset into value. |
int |
valueSize() |
void |
writeKey(org.neo4j.io.pagecache.PageCursor cursor,
KEY key)
Writes contents of
key into cursor at its current offset. |
default void |
writeMetaData(org.neo4j.io.pagecache.PageCursor cursor)
Writes meta data specific to this layout instance to
cursor at its current offset. |
void |
writeValue(org.neo4j.io.pagecache.PageCursor cursor,
VALUE value)
Writes contents of
value into cursor at its current offset. |
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongKEY newKey()
KEY copyKey(KEY key, KEY into)
key to into.key - key (left unchanged as part of this call) to copy contents from.into - key (changed as part of this call) to copy contents into.into instance for convenience.VALUE newValue()
int keySize()
int valueSize()
void writeKey(org.neo4j.io.pagecache.PageCursor cursor,
KEY key)
key into cursor at its current offset.cursor - PageCursor to write into, at current offset.key - key containing data to write.void writeValue(org.neo4j.io.pagecache.PageCursor cursor,
VALUE value)
value into cursor at its current offset.cursor - PageCursor to write into, at current offset.value - value containing data to write.void readKey(org.neo4j.io.pagecache.PageCursor cursor,
KEY into)
cursor at its current offset into key.cursor - PageCursor to read from, at current offset.into - key instances to read into.void readValue(org.neo4j.io.pagecache.PageCursor cursor,
VALUE into)
cursor at its current offset into value.cursor - PageCursor to read from, at current offset.into - value instances to read into.long identifier()
int majorVersion()
int minorVersion()
default void writeMetaData(org.neo4j.io.pagecache.PageCursor cursor)
cursor at its current offset.cursor - PageCursor to write into, at its current offset.default void readMetaData(org.neo4j.io.pagecache.PageCursor cursor)
cursor at its current offset.
The read meta data must also be verified against meta data provided in constructor of this Layout.
Constructor-provided meta data can be null to skip this verification.
if read meta data doesn't match with the meta data provided in constructor
PageCursor.setCursorException(String) should be called with appropriate error message.cursor - PageCursor to read from, at its current offset.static long namedIdentifier(String name, int checksum)
identifier().name - name to be part of this identifier, must at most be 4 characters.checksum - checksum to include into the identifier.name and checksum.Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.