public class RowBasedIndexedTable<RowType> extends Object implements IndexedTable
RowAdapter to work with any sort of object.IndexedTable.Index, IndexedTable.Reader| Constructor and Description |
|---|
RowBasedIndexedTable(List<RowType> table,
RowAdapter<RowType> rowAdapter,
RowSignature rowSignature,
Set<String> keyColumns,
String version) |
| Modifier and Type | Method and Description |
|---|---|
Optional<Closeable> |
acquireReferences()
This method is expected to increment a reference count and provide a
Closeable that decrements the
reference count when closed. |
void |
close() |
IndexedTable.Index |
columnIndex(int column)
Returns the index for a particular column.
|
IndexedTable.Reader |
columnReader(int column)
Returns a reader for a particular column.
|
Set<String> |
keyColumns()
Returns the columns of this table that have indexes.
|
int |
numRows()
Returns the number of rows in this table.
|
RowSignature |
rowSignature()
Returns the signature of this table, which includes all key columns (as well as other columns that can be
selected, but are not keys).
|
String |
version()
Returns the version of this table, used to compare against when loading a new version of the table
|
public RowBasedIndexedTable(List<RowType> table, RowAdapter<RowType> rowAdapter, RowSignature rowSignature, Set<String> keyColumns, String version)
public String version()
IndexedTableversion in interface IndexedTablepublic Set<String> keyColumns()
IndexedTablekeyColumns in interface IndexedTablepublic RowSignature rowSignature()
IndexedTablerowSignature in interface IndexedTablepublic IndexedTable.Index columnIndex(int column)
IndexedTableIndexedTable.rowSignature().columnIndex in interface IndexedTablepublic IndexedTable.Reader columnReader(int column)
IndexedTableIndexedTable.rowSignature().columnReader in interface IndexedTablepublic int numRows()
IndexedTablenumRows in interface IndexedTablepublic Optional<Closeable> acquireReferences()
ReferenceCountedObjectCloseable that decrements the
reference count when closed. This is likely just a wrapper around
ReferenceCountingCloseableObject.incrementReferenceAndDecrementOnceCloseable(), but may also include any
other associated references which should be incremented when this method is called, and decremented/released by the
closeable.
IMPORTANT NOTE: to fulfill the contract of this method, implementors must return a closeable to indicate that the
reference can be acquired, even if there is nothing to close. Implementors should avoid allowing this method or the
Closeable it creates to throw exceptions.
For callers: if this method returns non-empty, IT MUST BE CLOSED, else reference counts can potentially leak.acquireReferences in interface ReferenceCountedObjectpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.