Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/22399#discussion_r216881904
--- Diff:
common/network-common/src/test/java/org/apache/spark/network/ChunkFetchIntegrationSuite.java
---
@@ -143,61 +143,62 @@ public void releaseBuffers() {
}
private FetchResult fetchChunks(List<Integer> chunkIndices) throws
Exception {
- TransportClient client =
clientFactory.createClient(TestUtils.getLocalHost(), server.getPort());
- final Semaphore sem = new Semaphore(0);
-
final FetchResult res = new FetchResult();
- res.successChunks = Collections.synchronizedSet(new
HashSet<Integer>());
- res.failedChunks = Collections.synchronizedSet(new HashSet<Integer>());
- res.buffers = Collections.synchronizedList(new
LinkedList<ManagedBuffer>());
- ChunkReceivedCallback callback = new ChunkReceivedCallback() {
- @Override
- public void onSuccess(int chunkIndex, ManagedBuffer buffer) {
- buffer.retain();
- res.successChunks.add(chunkIndex);
- res.buffers.add(buffer);
- sem.release();
- }
+ try(TransportClient client =
clientFactory.createClient(TestUtils.getLocalHost(), server.getPort())) {
--- End diff --
Nit: space after try
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]