sashidhar 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_r327738058
##########
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:
Removed checkLocationConfigForNull() method as `@NotEmpty` annotation for
`locations` is serving the purpose.
----------------------------------------------------------------
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]