adamjshook commented on issue #369: [ACCUMULO-4787] Close input stream in 
AccumuloReplicaSystem
URL: https://github.com/apache/accumulo/pull/369#issuecomment-362417875
 
 
   @ctubbsii The `try-with-resources` caused an indentation change that makes 
it look larger and I moved a large block of code into a new method to make it 
more readable.  The summary of the changes are:
   
   1. Added a `try-with-resources` in the 
[`replicateRFiles`](https://github.com/apache/accumulo/pull/369/files#diff-48d2b9734f0e624e93e136f24f35e0bbR324)
 and 
[`replicateLogs`](https://github.com/apache/accumulo/pull/369/files#diff-48d2b9734f0e624e93e136f24f35e0bbR369)
   2. Moved [processing of the WAL 
header](https://github.com/apache/accumulo/pull/369/files#diff-48d2b9734f0e624e93e136f24f35e0bbL374)
 into 
[`getWalStream`](https://github.com/apache/accumulo/pull/369/files#diff-48d2b9734f0e624e93e136f24f35e0bbR685).
   3. Moving the exceptions that would be thrown from `getInputStream` 
[here](https://github.com/apache/accumulo/pull/369/files#diff-48d2b9734f0e624e93e136f24f35e0bbL327)
 and 
[here](https://github.com/apache/accumulo/pull/369/files#diff-48d2b9734f0e624e93e136f24f35e0bbL378)
 down to the bottom of the `try-with-resources`.
   4. Refactoring 
[this](https://github.com/apache/accumulo/blob/53c0e4ffd9083a7dc13c0d93c65b6a081da0cf56/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java#L332)
 block of code into a 
[`processBatches`](https://github.com/apache/accumulo/pull/369/files#diff-48d2b9734f0e624e93e136f24f35e0bbR384)
 method.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to