keith-turner commented on a change in pull request #2134:
URL: https://github.com/apache/accumulo/pull/2134#discussion_r644327655
##########
File path:
test/src/main/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java
##########
@@ -196,18 +196,18 @@ public void testActiveWalPrecludesClosing() throws
Exception {
log.info("Writing a few mutations to the table");
- BatchWriter bw = client.createBatchWriter(table);
+ try (BatchWriter bw = client.createBatchWriter(table)) {
+ byte[] empty = new byte[0];
+ for (int i = 0; i < 5; i++) {
+ Mutation m = new Mutation(Integer.toString(i));
+ m.put(empty, empty, empty);
+ bw.addMutation(m);
+ }
- byte[] empty = new byte[0];
- for (int i = 0; i < 5; i++) {
- Mutation m = new Mutation(Integer.toString(i));
- m.put(empty, empty, empty);
- bw.addMutation(m);
+ log.info("Flushing mutations to the server");
+ bw.flush();
Review comment:
I think flushing the batch writer could be dropped now that its closed.
I think closing the batch writer will flush it.
--
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]