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());
}
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());
}
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());
}
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();
}
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());
}
Aggregations