Search in sources :

Example 1 with BroadcastTableJoinableFactory

use of org.apache.druid.segment.join.BroadcastTableJoinableFactory in project druid by druid-io.

the class SegmentManagerBroadcastJoinIndexedTableTest method setup.

@Before
public void setup() throws IOException {
    segmentPuller = new LocalDataSegmentPuller();
    objectMapper = new DefaultObjectMapper().registerModule(new SegmentizerModule()).registerModule(new SimpleModule().registerSubtypes(new NamedType(LocalLoadSpec.class, "local")));
    indexIO = new IndexIO(objectMapper, () -> 0);
    objectMapper.setInjectableValues(new InjectableValues.Std().addValue(LocalDataSegmentPuller.class, segmentPuller).addValue(ExprMacroTable.class.getName(), TestExprMacroTable.INSTANCE).addValue(ObjectMapper.class.getName(), objectMapper).addValue(IndexIO.class, indexIO));
    segmentCacheDir = temporaryFolder.newFolder();
    segmentDeepStorageDir = temporaryFolder.newFolder();
    segmentCacheManager = new SegmentLocalCacheManager(new SegmentLoaderConfig() {

        @Override
        public List<StorageLocationConfig> getLocations() {
            return Collections.singletonList(new StorageLocationConfig(segmentCacheDir, null, null));
        }
    }, objectMapper);
    segmentManager = new SegmentManager(new SegmentLocalCacheLoader(segmentCacheManager, indexIO, objectMapper));
    joinableFactory = new BroadcastTableJoinableFactory(segmentManager);
    EmittingLogger.registerEmitter(new NoopServiceEmitter());
}
Also used : LocalLoadSpec(org.apache.druid.segment.loading.LocalLoadSpec) StorageLocationConfig(org.apache.druid.segment.loading.StorageLocationConfig) NamedType(com.fasterxml.jackson.databind.jsontype.NamedType) NoopServiceEmitter(org.apache.druid.server.metrics.NoopServiceEmitter) BroadcastTableJoinableFactory(org.apache.druid.segment.join.BroadcastTableJoinableFactory) InjectableValues(com.fasterxml.jackson.databind.InjectableValues) IndexIO(org.apache.druid.segment.IndexIO) LocalDataSegmentPuller(org.apache.druid.segment.loading.LocalDataSegmentPuller) SegmentLocalCacheManager(org.apache.druid.segment.loading.SegmentLocalCacheManager) SegmentizerModule(org.apache.druid.jackson.SegmentizerModule) SegmentLocalCacheLoader(org.apache.druid.segment.loading.SegmentLocalCacheLoader) DefaultObjectMapper(org.apache.druid.jackson.DefaultObjectMapper) SegmentLoaderConfig(org.apache.druid.segment.loading.SegmentLoaderConfig) SimpleModule(com.fasterxml.jackson.databind.module.SimpleModule) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) DefaultObjectMapper(org.apache.druid.jackson.DefaultObjectMapper) Before(org.junit.Before)

Aggregations

InjectableValues (com.fasterxml.jackson.databind.InjectableValues)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 NamedType (com.fasterxml.jackson.databind.jsontype.NamedType)1 SimpleModule (com.fasterxml.jackson.databind.module.SimpleModule)1 DefaultObjectMapper (org.apache.druid.jackson.DefaultObjectMapper)1 SegmentizerModule (org.apache.druid.jackson.SegmentizerModule)1 IndexIO (org.apache.druid.segment.IndexIO)1 BroadcastTableJoinableFactory (org.apache.druid.segment.join.BroadcastTableJoinableFactory)1 LocalDataSegmentPuller (org.apache.druid.segment.loading.LocalDataSegmentPuller)1 LocalLoadSpec (org.apache.druid.segment.loading.LocalLoadSpec)1 SegmentLoaderConfig (org.apache.druid.segment.loading.SegmentLoaderConfig)1 SegmentLocalCacheLoader (org.apache.druid.segment.loading.SegmentLocalCacheLoader)1 SegmentLocalCacheManager (org.apache.druid.segment.loading.SegmentLocalCacheManager)1 StorageLocationConfig (org.apache.druid.segment.loading.StorageLocationConfig)1 NoopServiceEmitter (org.apache.druid.server.metrics.NoopServiceEmitter)1 Before (org.junit.Before)1