Class LookupJoinable

    • Method Detail

      • getColumnCapabilities

        @Nullable
        public ColumnCapabilities getColumnCapabilities​(String columnName)
        Description copied from interface: Joinable
        Returns capabilities for one of this Joinable's columns.
        Specified by:
        getColumnCapabilities in interface Joinable
        Parameters:
        columnName - column name
        Returns:
        capabilities, or null if the columnName is not one of this Joinable's columns
      • makeJoinMatcher

        public JoinMatcher makeJoinMatcher​(ColumnSelectorFactory leftSelectorFactory,
                                           JoinConditionAnalysis condition,
                                           boolean remainderNeeded,
                                           boolean descending,
                                           Closer closer)
        Description copied from interface: Joinable
        Creates a JoinMatcher that can be used to implement a join onto this Joinable.
        Specified by:
        makeJoinMatcher in interface Joinable
        Parameters:
        leftSelectorFactory - column selector factory that allows access to the left-hand side of the join
        condition - join condition for the matcher
        remainderNeeded - whether or not JoinMatcher.matchRemainder() will ever be called on the matcher. If we know it will not, additional optimizations are often possible.
        descending - true if join cursor is iterated in descending order
        closer - closer that will run after join cursor has completed to clean up any per query resources the joinable uses
        Returns:
        the matcher
      • getMatchableColumnValues

        public Joinable.ColumnValuesWithUniqueFlag getMatchableColumnValues​(String columnName,
                                                                            boolean includeNull,
                                                                            int maxNumValues)
        Description copied from interface: Joinable
        Returns all matchable values from a particular column along with a flag to tell if they are all unique in the column. If the matchable values are greater than "maxNumValues" or if the column doesn't exists or doesn't supports this operation, returns an object with empty set for column values and false for uniqueness flag. The uniqueness flag will only be true if we've collected all matchable values in the column and found that they're all unique. In all other cases it will be false. The returned set may be passed to InDimFilter. For efficiency, implementations should prefer creating the returned set with new TreeSet<String>(Comparators.naturalNullsFirst()}. This avoids a copy in the filter's constructor.
        Specified by:
        getMatchableColumnValues in interface Joinable
        Parameters:
        columnName - name of the column
        includeNull - whether null should be considered a matchable value. If true, this method returns all values that are present in the column. If false, this method returns all non-null values.
        maxNumValues - maximum number of values to return. If exceeded, returns an empty set with the "allUnique" flag set to false.
      • getCorrelatedColumnValues

        public Optional<InDimFilter.ValuesSet> getCorrelatedColumnValues​(String searchColumnName,
                                                                         String searchColumnValue,
                                                                         String retrievalColumnName,
                                                                         long maxCorrelationSetSize,
                                                                         boolean allowNonKeyColumnSearch)
        Description copied from interface: Joinable
        Searches a column from this Joinable for a particular value, finds rows that match, and returns values of a second column for those rows. The returned set may be passed to InDimFilter. For efficiency, implementations should prefer creating the returned set with new TreeSet<String>(Comparators.naturalNullsFirst()}. This avoids a copy in the filter's constructor.
        Specified by:
        getCorrelatedColumnValues in interface Joinable
        Parameters:
        searchColumnName - Name of the search column. This is the column that is being used in the filter
        searchColumnValue - Target value of the search column. This is the value that is being filtered on.
        retrievalColumnName - The column to retrieve values from. This is the column that is being joined against.
        maxCorrelationSetSize - Maximum number of values to retrieve. If we detect that more values would be returned than this limit, return absent.
        allowNonKeyColumnSearch - If true, allow searchs on non-key columns. If this is false, a search on a non-key column returns absent.
        Returns:
        The set of correlated column values. If we cannot determine correlated values, return absent. In case either the search or retrieval column names are not found, this will return absent.
      • acquireReferences

        public Optional<Closeable> acquireReferences()
        Description copied from interface: ReferenceCountedObject
        This method is expected to increment a reference count and provide a Closeable 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.
        Specified by:
        acquireReferences in interface ReferenceCountedObject