This is the physical index data stored on disk, which may back one or more logical io. objects
(e.g. a unique index and a foreign-key reference can share the same underlying data pages).
ColumnDescriptor subclasses:
ColumnImpl.SortOrder ) to map characters to
locale-sensitive byte codes. Jackcess currently supports the following sort orders:
ColumnImpl#GENERAL_SORT_ORDER – "General" (Access 2010+, LCID 1033, version 1)ColumnImpl#GENERAL_LEGACY_SORT_ORDER – "General Legacy" (Access 2000–2007, LCID 1033, version 0)ColumnImpl#GENERAL_97_SORT_ORDER – "General" (Access 97, LCID 1033, version −1)ColumnImpl#RUSSIAN_SORT_ORDER – Russian/Cyrillic (LCID 1049, version 0)ColumnImpl#TURKISH_SORT_ORDER – Turkish (LCID 1055, version 0)ColumnImpl#UKRAINIAN_SORT_ORDER – Ukrainian/Cyrillic (LCID 1058, version 0)setUnsupportedReason; write operations
will throw UnsupportedOperationException. This is the root cause of
UCanAccess issue #35 for databases with unsupported collations
(e.g. Russian LCID 1049, Turkish LCID 1055, Ukrainian LCID 1058).
ColumnDescriptor are XOR-flipped (0xFF) after encoding,
so that a byte-wise ascending comparison of the raw entry bytes still yields the correct descending order.
IndexPageCache. Leaf pages hold the
actual encoded entries together with their RowIdImpl; intermediate pages hold separator entries pointing
to child pages. Pages are read lazily (on first access) and written back via update().
ColumnImpl.SortOrder , GeneralLegacyIndexCodes, GeneralIndexCodes, General97IndexCodes
| Modifier and Type | Class and Description |
|---|---|
| private class | IndexData.
PendingChange for a row addition. |
| private static class | IndexData.
ColumnDescriptor for BINARY columns. |
| private static class | IndexData.
ColumnDescriptor for boolean columns. |
| private static class | IndexData.
ColumnDescriptor for byte based columns. |
| public abstract static class | IndexData.
Encodes column values into the byte sequences that make up an index entry. |
| protected abstract static class | IndexData.
Object used to maintain state about an Index page. |
| public static class | IndexData.
A single leaf entry in an index (points to a single row) |
| public class | IndexData.
Utility class to traverse the entries in the Index. |
| public static enum | IndexData.
type attributes for Entries which simplify comparisons |
| private static class | IndexData.
ColumnDescriptor for extended date/time based columns. |
| private static class | IndexData.
ColumnDescriptor for new-style fixed point based columns. |
| private static class | IndexData.
ColumnDescriptor for floating point based columns. |
| private static class | IndexData.
|
| private static class | IndexData.
|
| private static class | IndexData.
|
| private static class | IndexData.
ColumnDescriptor for guid columns. |
| private static enum | IndexData.
support status for an index |
| private static class | IndexData.
ColumnDescriptor for integer based columns. |
| private static class | IndexData.
ColumnDescriptor for fixed point based columns (legacy sort order). |
| private static class | IndexData.
A single node entry in an index (points to a sub-page in the index) |
| public abstract static class | IndexData.
Utility class which maintains information about a pending index update. |
| private static class | IndexData.
Simple value object for maintaining some cursor state. |
| private class | IndexData.
Sentinel |
| private static class | IndexData.
Simple implementation of a DataPage |
| private static class | IndexData.
|
| private static class | IndexData.
|
| private static class | IndexData.
|
| private class | IndexData.
PendingChange for a row update (which is essentially a deletion followed by an addition). |
| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] | |
| public static final byte | |
| public static final Comparator | |
| pack-priv static final short | |
| private final List | columns
List of columns and flags |
| private static final byte | COMPLEX_INDEX_MARKER
the byte after the index flags, for an index over a complex column. |
| private static final byte[] | |
| pack-priv static final byte[] | |
| private static final ByteOrder | |
| private ByteUtil. | entryBuffer
temp buffer used to create index entries |
| public static final IndexData. | FIRST_ENTRY
special entry which is less than any other entry |
| public static final byte | |
| private final TempBufferHolder | indexBufferH
temp buffer used to read/write the index pages |
| private final List | indexes
the logical indexes which this index data backs |
| private byte | indexFlags
flags for this index |
| private boolean | initialized
|
| pack-priv static final int | |
| private static final int | KEPT_KEY_LENGTH
number of leading key bytes a truncated key keeps verbatim |
| private static final int | KEY_DIGEST_LENGTH
length of the digest which ends a truncated key |
| private static final int | KEY_DIGEST_POLY
polynomial behind KEY_DIGEST_TABLE, the CRC-16/ARC polynomial in its MSB-first form |
| private static final int[] | |
| public static final IndexData. | LAST_ENTRY
special entry which is greater than any other entry |
| pack-priv static final Logger | |
| private static final int | |
| public static final int | MAX_COLUMNS
Max number of columns in an index |
| private static final int | MAX_KEY_LENGTH
maximum length of the key portion of an index entry. |
| public static final Object | MAX_VALUE
special object which will always be greater than any other value, when searching for an index entry range in a multi-value index |
| private final int | maxPageEntrySize
max size for all the entries written to a given index data page |
| public static final Object | MIN_VALUE
special object which will always be greater than any other value, when searching for an index entry range in a multi-value index |
| private int | modCount
modification count for the table, keeps cursors up-to-date |
| private String | name
name, generated on demand |
| private static final IndexData. | |
| private final int | number
0-based index data number |
| private UsageMap | ownedPages
Usage map of pages that this index owns |
| private final IndexPageCache | pageCache
Cache which manages the index pages |
| private boolean | primaryKey
whether or not this index data is backing a primary key logical index |
| public static final byte | |
| private int | rootPageNumber
Page number of the root index data |
| private IndexData. | status
current support status of this index |
| private final TableImpl | table
owning table |
| public static final byte | |
| private int | uniqueEntryCount
The number of unique entries which have been added to this index. |
| private final int | uniqueEntryCountOffset
offset within the tableDefinition buffer of the uniqueEntryCount for this index |
| public static final byte | |
| private String | unsupportedReason
if non-null, the reason why this index has a non- |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv void | |
| private static int | calcMaxPageEntrySize(JetFormat format)
Returns the maximum amount of entry data which can be encoded on any index page. |
| pack-priv void | |
| public static void | |
| public Object[] | Returns: the appropriate sparse array of data ornull if not all columns for this index were providedConstructs an array of values appropriate for this index from the given column value. |
| public Object[] | Returns: the appropriate sparse array of data ornull if not all columns for this index were providedConstructs an array of values appropriate for this index from the given column values. |
| public Object[] | Returns: the appropriate sparse array of dataConstructs an array of values appropriate for this index from the given column values, expected to match the columns for this index. |
| public Object[] | Returns: the appropriate sparse array of data ornull if no prefix list of columns for this index were providedConstructs an array of values appropriate for this index from the given column value, which must be the first column of the index. |
| public Object[] | Returns: the appropriate sparse array of data ornull if no prefix list of columns for this index were providedConstructs an array of values appropriate for this index from the given column values, possibly only using a subset of the given values. |
| public Object[] | Returns: the appropriate sparse array of dataConstructs an array of values appropriate for this index from the given column values, possibly only providing a prefix subset of the index columns (at least one value must be provided). |
| private int | countNullValues(Object[] values)
Determines the number of |
| public static IndexData | create(TableImpl table, ByteBuffer tableBuffer, int number, JetFormat format)
Creates an IndexData appropriate for the given table, using information from the given table definition buffer. |
| private byte[] | |
| private static int[] | |
| private static ByteBuffer | |
| private static IndexData. | |
| public IndexData. | |
| public IndexData. | cursor(Object[]
the first row of data for the cursor, or startRow, boolean null for the first entrywhether or not startRow is inclusive or exclusive startInclusive, Object[] the last row of data for the cursor, or endRow, boolean null for the last entrywhether or not endRow is inclusive or exclusive endInclusive)Gets a new cursor for this index, narrowed to the range defined by the given startRow and endRow. |
| public void | |
| private IndexData. | |
| private static byte[] | encodeNumberColumnValue(Object value, ColumnImpl column)
Writes the value of the given column type to a byte array and returns it. |
| pack-priv IndexData. | |
| private IndexData. | |
| private static byte[] | |
| pack-priv static byte[] | flipBytes(byte[] value, int offset, int length)
Flips the bits in the specified bytes in the byte array. |
| private static byte[] | |
| public int | |
| public List | |
| pack-priv IndexData. | |
| public int | |
| public JetFormat | |
| public int | |
| public List | Returns: All of the Indexes backed by this data (unmodifiable List)Returns all of the Indexes backed by this data (unmodifiable List). |
| public byte | |
| pack-priv int | |
| public String | |
| private IndexData. | |
| public int | |
| public PageChannel | |
| private IndexData. | getPreviousPosition(IndexData.
Returns the Position before the given one, or |
| public Index | Returns: the "main" logical index which is backed by this data.Returns the "main" logical index which is backed by this data. |
| pack-priv int | |
| public TableImpl | |
| private ByteBuffer | getTempEntryBuffer(ByteBuffer indexPage, int entryLen, byte[] valuePrefix, TempBufferHolder tmpEntryBufferH)
Returns an entry buffer containing the relevant data for an entry given the valuePrefix. |
| public int | |
| public int | |
| pack-priv String | Returns: unsupported reason string, ornull if the index is fully validReturns the reason why this index is not fully valid, or |
| public void | |
| pack-priv boolean | |
| public boolean | |
| private boolean | |
| pack-priv boolean | |
| public boolean | |
| public boolean | |
| pack-priv boolean | |
| pack-priv static int | missingIndexToInsertionPoint(int idx)
Returns the valid insertion point for an index indicating a missing entry. |
| private IndexData. | Returns: aColumnDescriptor that can encode values of the given column for index entriesthe table column for which to create the descriptor col, byte raw index column flags (e.g. flags)ASCENDING_COLUMN_FLAG)Constructs the appropriate |
| private static IndexData. | newEntry(ByteBuffer buffer, int entryLength, boolean isLeaf)
Returns a new Entry of the correct type for the given data and page type. |
| private IndexData. | prepareAddEntry(IndexData.
Adds an entry to the correct index dataPage, maintaining the order. |
| public IndexData. | Returns: a PendingChange which can complete the addition or roll it backRow to add row, RowIdImpl rowId of the row to be added rowId, IndexData.Prepares to add a row to this index. |
| private IndexData. | |
| public IndexData. | Returns: a PendingChange which can complete the update or roll it backRow to be removed oldRow, RowIdImpl rowId of the row to be updated rowId, Object[] Row to be added newRow, IndexData.Prepares to update a row in this index. |
| public void | read(ByteBuffer
table definition buffer to read from initial info tableBuffer, List<ColumnImpl> Columns that this index may use availableColumns)Read the rest of the index info from a tableBuffer |
| pack-priv void | readDataPage(IndexData.
Reads an index page, populating the correct collection based on the page type (node or leaf). |
| private static int | Returns: the level of the page in the index treethe index page buffer, JetFormat format of the database format)Reads the level of an index page, 0 if the format does not record one. |
| private IndexData. | removeEntry(IndexData.
Removes an entry from the relevant index dataPage, maintaining the order. |
| public static void | |
| private void | setUnsupportedReason(String
human-readable description of why the index cannot be written; will be enriched with
database/table/index context via reason, IndexData.withErrorContext(String)the resulting support status; either newStatus,IndexStatus#BROKEN_WRITE (writes still allowed
but the index is unsuitable for lookups) or IndexStatus#READ_ONLY (writes disabled
entirely)the column whose descriptor triggered the unsupported condition col)Marks this index as unsupported for write operations due to a feature that Jackcess cannot (yet) encode. |
| public boolean | |
| public String | |
| pack-priv static byte[] | truncateEntryBytes(byte[] entryBytes)
Truncates the given entry bytes if they exceed the maximum key length, replacing the discarded bytes with a digest of them. |
| public void | |
| public void | validate(boolean
if forceLoad)false only validate currently loaded index data pages, otherwise, load and validate all index pagesUsed by unit tests to validate the internal status of the index. |
| pack-priv String | |
| private static String | |
| pack-priv void | |
| pack-priv static void | writeDataPage(ByteBuffer buffer, IndexData.
Writes the data page info to the given buffer. |
| pack-priv static void | writeDefinition(TableMutator
description of the indexes to write creator, ByteBuffer Buffer to write to buffer, TableMutator.Writes the index definitions into a table definition buffer. |
| pack-priv static void | writeDefinitions(TableCreator
description of the indexes to write creator, ByteBuffer Buffer to write to buffer)Writes the index definitions into a table definition buffer. |
| private static void | writeGeneralBinaryEntry(byte[] valueBytes, boolean isAsc, ByteUtil.
Writes a binary value using the general binary entry encoding rules. |
| pack-priv static void | writeRowCountDefinitions(TableCreator
description of the indexes to write creator, ByteBuffer Buffer to write to buffer)Writes the index row count definitions into a table definition buffer. |
| pack-priv static void | writeRowCountDefinitions(TableMutator
description of the indexes to write creator, ByteBuffer Buffer to write to buffer, int num indexes to write idxCount)Writes the index row count definitions into a table definition buffer. |