Search in sources :

Example 1 with StorageLocationConfig

use of org.apache.druid.segment.loading.StorageLocationConfig in project druid by druid-io.

the class DruidServerConfigTest method testCombinedSize.

@Test
public void testCombinedSize() {
    final List<StorageLocationConfig> locations = new ArrayList<>();
    final StorageLocationConfig locationConfig1 = new StorageLocationConfig(testSegmentCacheDir1, 10000000000L, null);
    final StorageLocationConfig locationConfig2 = new StorageLocationConfig(testSegmentCacheDir2, 20000000000L, null);
    locations.add(locationConfig1);
    locations.add(locationConfig2);
    DruidServerConfig druidServerConfig = new DruidServerConfig(new SegmentLoaderConfig().withLocations(locations));
    Assert.assertEquals(30000000000L, druidServerConfig.getMaxSize());
}
Also used : StorageLocationConfig(org.apache.druid.segment.loading.StorageLocationConfig) ArrayList(java.util.ArrayList) SegmentLoaderConfig(org.apache.druid.segment.loading.SegmentLoaderConfig) Test(org.junit.Test)

Example 2 with StorageLocationConfig

use of org.apache.druid.segment.loading.StorageLocationConfig 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)

Example 3 with StorageLocationConfig

use of org.apache.druid.segment.loading.StorageLocationConfig in project druid by druid-io.

the class SegmentManagerThreadSafetyTest method setup.

@Before
public void setup() throws IOException {
    segmentPuller = new TestSegmentPuller();
    objectMapper = new DefaultObjectMapper().registerModule(new SimpleModule().registerSubtypes(new NamedType(LocalLoadSpec.class, "local"), new NamedType(TestSegmentizerFactory.class, "test"))).setInjectableValues(new Std().addValue(LocalDataSegmentPuller.class, segmentPuller));
    indexIO = new IndexIO(objectMapper, () -> 0);
    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));
    exec = Execs.multiThreaded(NUM_THREAD, "SegmentManagerThreadSafetyTest-%d");
    EmittingLogger.registerEmitter(new NoopServiceEmitter());
}
Also used : Std(com.fasterxml.jackson.databind.InjectableValues.Std) StorageLocationConfig(org.apache.druid.segment.loading.StorageLocationConfig) IndexIO(org.apache.druid.segment.IndexIO) NamedType(com.fasterxml.jackson.databind.jsontype.NamedType) SegmentLocalCacheManager(org.apache.druid.segment.loading.SegmentLocalCacheManager) SegmentLocalCacheLoader(org.apache.druid.segment.loading.SegmentLocalCacheLoader) NoopServiceEmitter(org.apache.druid.server.metrics.NoopServiceEmitter) DefaultObjectMapper(org.apache.druid.jackson.DefaultObjectMapper) SegmentLoaderConfig(org.apache.druid.segment.loading.SegmentLoaderConfig) SimpleModule(com.fasterxml.jackson.databind.module.SimpleModule) Before(org.junit.Before)

Example 4 with StorageLocationConfig

use of org.apache.druid.segment.loading.StorageLocationConfig in project druid by druid-io.

the class IndexTaskTest method setup.

@Before
public void setup() throws IOException {
    appenderatorsManager = new TestAppenderatorsManager();
    final File cacheDir = temporaryFolder.newFolder();
    segmentCacheManager = new SegmentLocalCacheManager(new SegmentLoaderConfig() {

        @Override
        public List<StorageLocationConfig> getLocations() {
            return Collections.singletonList(new StorageLocationConfig(cacheDir, null, null));
        }
    }, jsonMapper);
    taskRunner = new TestTaskRunner();
}
Also used : StorageLocationConfig(org.apache.druid.segment.loading.StorageLocationConfig) SegmentLocalCacheManager(org.apache.druid.segment.loading.SegmentLocalCacheManager) SegmentLoaderConfig(org.apache.druid.segment.loading.SegmentLoaderConfig) File(java.io.File) Before(org.junit.Before)

Example 5 with StorageLocationConfig

use of org.apache.druid.segment.loading.StorageLocationConfig in project druid by druid-io.

the class AbstractParallelIndexSupervisorTaskTest method setUpAbstractParallelIndexSupervisorTaskTest.

@Before
public void setUpAbstractParallelIndexSupervisorTaskTest() throws IOException {
    localDeepStorage = temporaryFolder.newFolder("localStorage");
    taskRunner = new SimpleThreadingTaskRunner();
    objectMapper = getObjectMapper();
    indexingServiceClient = new LocalIndexingServiceClient(objectMapper, taskRunner);
    intermediaryDataManager = new LocalIntermediaryDataManager(new WorkerConfig(), new TaskConfig(null, null, null, null, null, false, null, null, ImmutableList.of(new StorageLocationConfig(temporaryFolder.newFolder(), null, null)), false, false, TaskConfig.BATCH_PROCESSING_MODE_DEFAULT.name()), null);
    remoteApiExecutor = Execs.singleThreaded("coordinator-api-executor");
    coordinatorClient = new LocalCoordinatorClient(remoteApiExecutor);
    prepareObjectMapper(objectMapper, getIndexIO());
}
Also used : StorageLocationConfig(org.apache.druid.segment.loading.StorageLocationConfig) WorkerConfig(org.apache.druid.indexing.worker.config.WorkerConfig) TaskConfig(org.apache.druid.indexing.common.config.TaskConfig) LocalIntermediaryDataManager(org.apache.druid.indexing.worker.shuffle.LocalIntermediaryDataManager) Before(org.junit.Before)

Aggregations

StorageLocationConfig (org.apache.druid.segment.loading.StorageLocationConfig)10 Before (org.junit.Before)8 TaskConfig (org.apache.druid.indexing.common.config.TaskConfig)5 WorkerConfig (org.apache.druid.indexing.worker.config.WorkerConfig)5 IndexingServiceClient (org.apache.druid.client.indexing.IndexingServiceClient)4 NoopIndexingServiceClient (org.apache.druid.client.indexing.NoopIndexingServiceClient)4 DefaultObjectMapper (org.apache.druid.jackson.DefaultObjectMapper)4 SegmentLoaderConfig (org.apache.druid.segment.loading.SegmentLoaderConfig)4 SimpleModule (com.fasterxml.jackson.databind.module.SimpleModule)3 SegmentLocalCacheManager (org.apache.druid.segment.loading.SegmentLocalCacheManager)3 Test (org.junit.Test)3 InjectableValues (com.fasterxml.jackson.databind.InjectableValues)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 NamedType (com.fasterxml.jackson.databind.jsontype.NamedType)2 File (java.io.File)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Set (java.util.Set)2 TaskStatus (org.apache.druid.client.indexing.TaskStatus)2 IndexIO (org.apache.druid.segment.IndexIO)2