Package org.apache.druid.segment.join
Class HashJoinSegment
- java.lang.Object
-
- org.apache.druid.segment.join.HashJoinSegment
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ReferenceCountedObject
,Segment
,SegmentReference
public class HashJoinSegment extends Object implements SegmentReference
Represents a deep, left-heavy join of a left-hand side baseSegment onto a series of right-hand side clauses.In other words, logically the operation is: join(join(join(baseSegment, clauses[0]), clauses[1]), clauses[2]) etc.
-
-
Constructor Summary
Constructors Constructor Description HashJoinSegment(SegmentReference baseSegment, Filter baseFilter, List<JoinableClause> clauses, JoinFilterPreAnalysis joinFilterPreAnalysis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Closeable>
acquireReferences()
This method is expected to increment a reference count and provide aCloseable
that decrements the reference count when closed.QueryableIndex
asQueryableIndex()
StorageAdapter
asStorageAdapter()
void
close()
org.joda.time.Interval
getDataInterval()
SegmentId
getId()
-
-
-
Constructor Detail
-
HashJoinSegment
public HashJoinSegment(SegmentReference baseSegment, @Nullable Filter baseFilter, List<JoinableClause> clauses, JoinFilterPreAnalysis joinFilterPreAnalysis)
- Parameters:
baseSegment
- The left-hand side base segmentclauses
- The right-hand side clauses. The caller is responsible for ensuring that there are no duplicate prefixes or prefixes that shadow each other across the clausesjoinFilterPreAnalysis
- Pre-analysis for the query we expect to run on this segment
-
-
Method Detail
-
getDataInterval
public org.joda.time.Interval getDataInterval()
- Specified by:
getDataInterval
in interfaceSegment
-
asQueryableIndex
@Nullable public QueryableIndex asQueryableIndex()
- Specified by:
asQueryableIndex
in interfaceSegment
-
asStorageAdapter
public StorageAdapter asStorageAdapter()
- Specified by:
asStorageAdapter
in interfaceSegment
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
acquireReferences
public Optional<Closeable> acquireReferences()
Description copied from interface:ReferenceCountedObject
This method is expected to increment a reference count and provide aCloseable
that decrements the reference count when closed. This is likely just a wrapper aroundReferenceCountingCloseableObject.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 theCloseable
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 interfaceReferenceCountedObject
-
-