jihoonson commented on a change in pull request #8038: Making optimal usage of
multiple segment cache locations
URL: https://github.com/apache/incubator-druid/pull/8038#discussion_r327466018
##########
File path:
server/src/main/java/org/apache/druid/segment/loading/SegmentLoaderConfig.java
##########
@@ -88,19 +92,32 @@ public int getNumBootstrapThreads()
return numBootstrapThreads == null ? numLoadingThreads :
numBootstrapThreads;
}
+ public StorageLocationSelectorStrategy
getStorageLocationSelectorStrategy(List<StorageLocation> storageLocations)
+ {
+ if (locationSelectorStrategy == null) {
+ checkLocationConfigForNull();
+ // default strategy if no strategy is specified in the config
+ locationSelectorStrategy = new
LeastBytesUsedStorageLocationSelectorStrategy(storageLocations);
+ }
+ return locationSelectorStrategy;
+ }
+
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.");
- }
+ checkLocationConfigForNull();
infoDir = new File(locations.get(0).getPath(), "info_dir");
}
-
return infoDir;
}
+ private void checkLocationConfigForNull()
Review comment:
You mean the below throws an error with a better message? The current error
message is like this:
```
2019-09-24T07:31:02,670 ERROR [main] org.apache.druid.cli.CliHistorical -
Error when starting up. Failing.
com.google.inject.ProvisionException: Unable to provision, see the following
errors:
1) druid.segmentCache.locations - may not be empty
...
It seems almost same to me.
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]