@Override public List<StorageLocationConfig> getLocations() { return Collections.singletonList( new StorageLocationConfig().setPath(cacheDir) ); } },
@Inject public SegmentLoaderLocalCacheManager( IndexIO indexIO, SegmentLoaderConfig config, @Json ObjectMapper mapper ) { this.indexIO = indexIO; this.config = config; this.jsonMapper = mapper; this.locations = new ArrayList<>(); for (StorageLocationConfig locationConfig : config.getLocations()) { locations.add(new StorageLocation( locationConfig.getPath(), locationConfig.getMaxSize(), locationConfig.getFreeSpacePercent() )); } }
@Before public void setUp() throws Exception { EmittingLogger.registerEmitter(new NoopServiceEmitter()); localSegmentCacheFolder = tmpFolder.newFolder("segment_cache_folder"); final List<StorageLocationConfig> locations = new ArrayList<>(); final StorageLocationConfig locationConfig = new StorageLocationConfig(); locationConfig.setPath(localSegmentCacheFolder); locationConfig.setMaxSize(10000000000L); locations.add(locationConfig); manager = new SegmentLoaderLocalCacheManager( TestHelper.getTestIndexIO(), new SegmentLoaderConfig().withLocations(locations), jsonMapper ); }
public File getInfoDir() { if (infoDir == null) { if (locations == null || locations.size() == 0) { throw new ISE("You have no segment cache locations defined. Please configure druid.segmentCache.locations to use one or more locations."); } infoDir = new File(locations.get(0).getPath(), "info_dir"); } return infoDir; }
final StorageLocationConfig locationConfig = new StorageLocationConfig(); final File localStorageFolder = tmpFolder.newFolder("local_storage_folder"); locationConfig.setPath(localStorageFolder); locationConfig.setMaxSize(1000000000L); locations.add(locationConfig); final StorageLocationConfig locationConfig2 = new StorageLocationConfig(); final File localStorageFolder2 = tmpFolder.newFolder("local_storage_folder2"); locationConfig2.setPath(localStorageFolder2); locationConfig2.setMaxSize(10000000L); locations.add(locationConfig2);
@Inject public DruidSysMonitor( SegmentLoaderConfig config ) { final List<StorageLocationConfig> locs = config.getLocations(); List<String> dirs = Lists.newArrayListWithExpectedSize(locs.size()); for (StorageLocationConfig loc : locs) { dirs.add(loc.getPath().toString()); } addDirectoriesToMonitor(dirs.toArray(new String[0])); } }
final StorageLocationConfig locationConfig = new StorageLocationConfig(); locationConfig.setPath(localStorageFolder); locationConfig.setMaxSize(10000000000L); locations.add(locationConfig); final StorageLocationConfig locationConfig2 = new StorageLocationConfig(); final File localStorageFolder2 = tmpFolder.newFolder("local_storage_folder2"); locationConfig2.setPath(localStorageFolder2); locationConfig2.setMaxSize(1000000000L); locations.add(locationConfig2);
public SegmentLoader manufacturate(File storageDir) { return loader.withConfig( new SegmentLoaderConfig().withLocations(Collections.singletonList(new StorageLocationConfig().setPath(storageDir))) ); } }
@Inject public SegmentLoaderLocalCacheManager( IndexIO indexIO, SegmentLoaderConfig config, @Json ObjectMapper mapper ) { this.indexIO = indexIO; this.config = config; this.jsonMapper = mapper; this.locations = Lists.newArrayList(); for (StorageLocationConfig locationConfig : config.getLocations()) { locations.add(new StorageLocation( locationConfig.getPath(), locationConfig.getMaxSize(), locationConfig.getFreeSpacePercent() )); } }
public File getInfoDir() { if (infoDir == null) { if (locations == null || locations.size() == 0) { throw new ISE("You have no segment cache locations defined. Please configure druid.segmentCache.locations to use one or more locations."); } infoDir = new File(locations.get(0).getPath(), "info_dir"); } return infoDir; }
final StorageLocationConfig locationConfig = new StorageLocationConfig(); final File localStorageFolder = tmpFolder.newFolder("local_storage_folder"); locationConfig.setPath(localStorageFolder); locationConfig.setMaxSize(1000000000L); locations.add(locationConfig); final StorageLocationConfig locationConfig2 = new StorageLocationConfig(); final File localStorageFolder2 = tmpFolder.newFolder("local_storage_folder2"); locationConfig2.setPath(localStorageFolder2); locationConfig2.setMaxSize(10000000L); locations.add(locationConfig2);
public SegmentLoader manufacturate(File storageDir) { return loader.withConfig( new SegmentLoaderConfig().withLocations(Collections.singletonList(new StorageLocationConfig().setPath(storageDir))) ); } }
@Inject public DruidSysMonitor( SegmentLoaderConfig config ) { final List<StorageLocationConfig> locs = config.getLocations(); List<String> dirs = Lists.newArrayListWithExpectedSize(locs.size()); for (StorageLocationConfig loc : locs) { dirs.add(loc.getPath().toString()); } addDirectoriesToMonitor(dirs.toArray(new String[0])); } }
final StorageLocationConfig locationConfig = new StorageLocationConfig(); final File localStorageFolder = tmpFolder.newFolder("local_storage_folder"); localStorageFolder.setWritable(true); locationConfig.setPath(localStorageFolder); locationConfig.setMaxSize(10L); locations.add(locationConfig); final StorageLocationConfig locationConfig2 = new StorageLocationConfig(); final File localStorageFolder2 = tmpFolder.newFolder("local_storage_folder2"); localStorageFolder2.setWritable(true); locationConfig2.setPath(localStorageFolder2); locationConfig2.setMaxSize(10L); locations.add(locationConfig2);