Conversation
ctubbsii
left a comment
There was a problem hiding this comment.
👍 Array literals are my favorite new thing I've learned about Java 8 in the last week, and diamond operator is always good to make lines shorter and more readable.
There may be room for further improvements with some of the singletons which are unnecessarily put into an array, but this change works on its own, too.
| public void testSimpleWritable() throws IOException { | ||
| Range[] ranges = new Range[] {new Range(new Key("a"), new Key("b"))}; | ||
| Range[] ranges = {new Range(new Key("a"), new Key("b"))}; | ||
| BatchInputSplit split = new BatchInputSplit("table", Table.ID.of("1"), Arrays.asList(ranges), |
There was a problem hiding this comment.
This could be further simplified with Collections.singletonList() instead of allocating an intermediate array. I saw a few cases of this "array of singleton" case.
| zoo.putPersistentData(instanceNamePath, uuid.getBytes(UTF_8), NodeExistsPolicy.FAIL); | ||
|
|
||
| final byte[] EMPTY_BYTE_ARRAY = new byte[0], ZERO_CHAR_ARRAY = new byte[] {'0'}; | ||
| final byte[] EMPTY_BYTE_ARRAY = new byte[0], ZERO_CHAR_ARRAY = {'0'}; |
There was a problem hiding this comment.
Variables should really have their own declarations with their own modifiers. I wonder if we can enforce this with checkstyle.
| @Test | ||
| public void testFilteredMountEntries() throws Exception { | ||
| String[] mountEntries = new String[] {"rootfs / rootfs rw 0 0", | ||
| String[] mountEntries = {"rootfs / rootfs rw 0 0", |
There was a problem hiding this comment.
Thoughts: I really wonder about the portability of this FileSystemMonitor. It seems dubious. I'm not even sure if it works properly with systemd or recognizes m.2 and nvme drives. The FileSystemMonitor seems more like a monitoring utility which should exist separate from Accumulo.
| new String[] {"a", "b", "c"}, new String[] {"a", "b", "c", "d", "e"}, | ||
| new String[] {"a", "b", "c", "d", "e", "f", "g"}, | ||
| String tests[][] = {new String[] {"a", "b", "c", "d"}, new String[] {"a", "b", "c"}, | ||
| new String[] {"a", "b", "c", "d", "e"}, new String[] {"a", "b", "c", "d", "e", "f", "g"}, |
There was a problem hiding this comment.
If you run it again does it pick up on the inner arrays?
There was a problem hiding this comment.
It tried to run it again and it doesn't pickup the inner arrays :-(
No description provided.