Package org.apache.druid.segment.join
Class MapJoinableFactory
java.lang.Object
org.apache.druid.segment.join.MapJoinableFactory
- All Implemented Interfaces:
JoinableFactory
A
JoinableFactory that delegates to the appropriate factory based on the datasource.
Any number of JoinableFactory may be associated to the same class of DataSource, but for a specific
datasource only a single JoinableFactory should be able to create a Joinable in the build(org.apache.druid.query.DataSource, org.apache.druid.segment.join.JoinConditionAnalysis)
method.-
Constructor Summary
ConstructorsConstructorDescriptionMapJoinableFactory(Set<JoinableFactory> factories, Map<Class<? extends JoinableFactory>, Class<? extends DataSource>> factoryToDataSource) -
Method Summary
Modifier and TypeMethodDescriptionbuild(DataSource dataSource, JoinConditionAnalysis condition) Create a Joinable object.Optional<byte[]> computeJoinCacheKey(DataSource dataSource, JoinConditionAnalysis condition) Compute the cache key for a data source participating in join operation.booleanisDirectlyJoinable(DataSource dataSource) Returns true if aJoinable**may** be created for a givenDataSource, but is not a guarantee thatJoinableFactory.build(org.apache.druid.query.DataSource, org.apache.druid.segment.join.JoinConditionAnalysis)will return a non-empty result.
-
Constructor Details
-
MapJoinableFactory
@Inject public MapJoinableFactory(Set<JoinableFactory> factories, Map<Class<? extends JoinableFactory>, Class<? extends DataSource>> factoryToDataSource)
-
-
Method Details
-
isDirectlyJoinable
Description copied from interface:JoinableFactoryReturns true if aJoinable**may** be created for a givenDataSource, but is not a guarantee thatJoinableFactory.build(org.apache.druid.query.DataSource, org.apache.druid.segment.join.JoinConditionAnalysis)will return a non-empty result. Successfully building aJoinablemight require specific criteria of theJoinConditionAnalysis.- Specified by:
isDirectlyJoinablein interfaceJoinableFactory
-
build
Description copied from interface:JoinableFactoryCreate a Joinable object. This may be an expensive operation involving loading data, creating a hash table, etc.- Specified by:
buildin interfaceJoinableFactory- Parameters:
dataSource- the datasource to join oncondition- the condition to join on- Returns:
- a Joinable if this datasource + condition combo is joinable; empty if not
-
computeJoinCacheKey
Description copied from interface:JoinableFactoryCompute the cache key for a data source participating in join operation. This is done separately from {JoinableFactory.build(DataSource, JoinConditionAnalysis)} which can be an expensive operation and can potentially be avoided if cached results can be used.- Specified by:
computeJoinCacheKeyin interfaceJoinableFactory- Parameters:
dataSource- the datasource to join oncondition- the condition to join on
-