public class BroadcastSegmentIndexedTable extends Object implements IndexedTable
IndexedTable.Index, IndexedTable.Reader| Constructor and Description |
|---|
BroadcastSegmentIndexedTable(QueryableIndexSegment theSegment,
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.
|
byte[] |
computeCacheKey()
Computes a
byte[] key for the table that can be used for computing cache keys for join operations. |
boolean |
isCacheable()
Returns whether this indexed table can be cached for the join operations
|
Set<String> |
keyColumns()
Returns the columns of this table that have indexes.
|
ColumnSelectorFactory |
makeColumnSelectorFactory(ReadableOffset offset,
boolean descending,
Closer closer)
This method allows a table to directly provide an optimized
ColumnSelectorFactory for
IndexedTableJoinMatcher to create selectors. |
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 BroadcastSegmentIndexedTable(QueryableIndexSegment theSegment, 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 int numRows()
IndexedTablenumRows in interface IndexedTablepublic IndexedTable.Index columnIndex(int column)
IndexedTableIndexedTable.rowSignature().columnIndex in interface IndexedTablepublic IndexedTable.Reader columnReader(int column)
IndexedTableIndexedTable.rowSignature(). Don't forget to close your IndexedTable.Reader when finished reading, to clean up any
resources.columnReader in interface IndexedTable@Nullable public ColumnSelectorFactory makeColumnSelectorFactory(ReadableOffset offset, boolean descending, Closer closer)
IndexedTableColumnSelectorFactory for
IndexedTableJoinMatcher to create selectors. If this method returns null, the default
IndexedTableColumnSelectorFactory, which creates IndexedTableDimensionSelector or
IndexedTableColumnValueSelector as appropriate, both backed with a IndexedTable.columnReader(int), will be used
instead.makeColumnSelectorFactory in interface IndexedTablepublic byte[] computeCacheKey()
IndexedTablebyte[] key for the table that can be used for computing cache keys for join operations.
see JoinableFactory.computeJoinCacheKey(org.apache.druid.query.DataSource, org.apache.druid.segment.join.JoinConditionAnalysis)computeCacheKey in interface IndexedTablepublic boolean isCacheable()
IndexedTableisCacheable in interface IndexedTablepublic void close()
close in interface Closeableclose in interface AutoCloseablepublic 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 ReferenceCountedObjectCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.