Class BroadcastSegmentIndexedTable
java.lang.Object
org.apache.druid.segment.join.table.BroadcastSegmentIndexedTable
- All Implemented Interfaces:
Closeable,AutoCloseable,IndexedTable,ReferenceCountedObjectProvider<Closeable>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.druid.segment.join.table.IndexedTable
IndexedTable.Index, IndexedTable.Reader -
Constructor Summary
ConstructorsConstructorDescriptionBroadcastSegmentIndexedTable(QueryableIndexSegment theSegment, Set<String> keyColumns, String version) -
Method Summary
Modifier and TypeMethodDescriptionThis method increments a reference count and provides aCloseablethat decrements the reference count when closed.voidclose()columnIndex(int column) Returns the index for a particular column.columnReader(int column) Returns a reader for a particular column.byte[]Computes abyte[]key for the table that can be used for computing cache keys for join operations.booleanReturns whether this indexed table can be cached for the join operationsReturns the columns of this table that have indexes.makeColumnSelectorFactory(ReadableOffset offset, Closer closer) This method allows a table to directly provide an optimizedColumnSelectorFactoryforIndexedTableJoinMatcherto create selectors.intnumRows()Returns the number of rows in this table.Returns the signature of this table, which includes all key columns (as well as other columns that can be selected, but are not keys).version()Returns the version of this table, used to compare against when loading a new version of the table
-
Constructor Details
-
BroadcastSegmentIndexedTable
public BroadcastSegmentIndexedTable(QueryableIndexSegment theSegment, Set<String> keyColumns, String version)
-
-
Method Details
-
version
Description copied from interface:IndexedTableReturns the version of this table, used to compare against when loading a new version of the table- Specified by:
versionin interfaceIndexedTable
-
keyColumns
Description copied from interface:IndexedTableReturns the columns of this table that have indexes.- Specified by:
keyColumnsin interfaceIndexedTable
-
rowSignature
Description copied from interface:IndexedTableReturns the signature of this table, which includes all key columns (as well as other columns that can be selected, but are not keys).- Specified by:
rowSignaturein interfaceIndexedTable
-
numRows
public int numRows()Description copied from interface:IndexedTableReturns the number of rows in this table. It must not change over time, since it is used for things like algorithm selection and reporting of cardinality metadata.- Specified by:
numRowsin interfaceIndexedTable
-
columnIndex
Description copied from interface:IndexedTableReturns the index for a particular column. The provided column number must be that column's position inIndexedTable.rowSignature().- Specified by:
columnIndexin interfaceIndexedTable
-
columnReader
Description copied from interface:IndexedTableReturns a reader for a particular column. The provided column number must be that column's position inIndexedTable.rowSignature(). Don't forget to close yourIndexedTable.Readerwhen finished reading, to clean up any resources.- Specified by:
columnReaderin interfaceIndexedTable
-
makeColumnSelectorFactory
@Nullable public ColumnSelectorFactory makeColumnSelectorFactory(ReadableOffset offset, Closer closer) Description copied from interface:IndexedTableThis method allows a table to directly provide an optimizedColumnSelectorFactoryforIndexedTableJoinMatcherto create selectors. If this method returns null, the defaultIndexedTableColumnSelectorFactory, which createsIndexedTableDimensionSelectororIndexedTableColumnValueSelectoras appropriate, both backed with aIndexedTable.columnReader(int), will be used instead.- Specified by:
makeColumnSelectorFactoryin interfaceIndexedTable
-
computeCacheKey
public byte[] computeCacheKey()Description copied from interface:IndexedTableComputes abyte[]key for the table that can be used for computing cache keys for join operations. seeJoinableFactory.computeJoinCacheKey(org.apache.druid.query.DataSource, org.apache.druid.segment.join.JoinConditionAnalysis)- Specified by:
computeCacheKeyin interfaceIndexedTable- Returns:
- the byte array for cache key
-
isCacheable
public boolean isCacheable()Description copied from interface:IndexedTableReturns whether this indexed table can be cached for the join operations- Specified by:
isCacheablein interfaceIndexedTable
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
acquireReference
Description copied from interface:ReferenceCountedObjectProviderThis method increments a reference count and provides aCloseablethat decrements the reference count when closed. The object returned by this method may or may not be thread-safe, it is best to check with the implementation.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 ideally avoid allowing this method to throw exceptions, but callers are responsible for closing the returned object should any operations on it throw exceptions.
For callers: if this method returns non-empty, IT MUST BE CLOSED, else reference counts can potentially leak.
- Specified by:
acquireReferencein interfaceReferenceCountedObjectProvider<Closeable>
-