ctubbsii commented on a change in pull request #1553: Simplify some
VolumeManager tooling
URL: https://github.com/apache/accumulo/pull/1553#discussion_r389861011
##########
File path:
server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
##########
@@ -95,23 +94,18 @@ protected VolumeManagerImpl(Map<String,Volume> volumes,
Volume defaultVolume,
this.hadoopConf = hadoopConf;
}
- private void invertVolumesByFileSystem(Map<String,Volume> forward,
- Multimap<URI,Volume> inverted) {
- for (Volume volume : forward.values()) {
- inverted.put(volume.getFileSystem().getUri(), volume);
- }
+ private Multimap<URI,Volume> invertVolumesByFileSystem(Map<String,Volume>
forward) {
+ Multimap<URI,Volume> inverted = HashMultimap.create();
+ forward.values().forEach(volume ->
inverted.put(volume.getFileSystem().getUri(), volume));
+ return inverted;
}
- public static org.apache.accumulo.server.fs.VolumeManager getLocal(String
localBasePath)
- throws IOException {
+ // for testing only
+ public static VolumeManager getLocalForTesting(String localBasePath) throws
IOException {
Review comment:
I don't like that annotation, because:
1. it can create an unnecessary Guava dependency,
2. I don't like checking to see if we already have Guava on that module, and
3. the annotation provides no additional value over a comment since there
are no tools for which the annotation would matter
The method name makes it clear. The comment is bonus. An annotation wouldn't
do anything other than add an import and possibly a new direct dependency if
Guava wasn't already in the pom.
----------------------------------------------------------------
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