Skip to content

Commit b4c374c

Browse files
committed
fix indentation
1 parent 18e63f6 commit b4c374c

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestReadBufferManager.java

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -91,31 +91,31 @@ public void testPurgeBufferManagerForParallelStreams() throws Exception {
9191
executorService.shutdown();
9292
}
9393

94-
/*
95-
* Since, the read from inputStream is happening in parallel thread, the
96-
* test has to wait for the execution to get over. If we don't wait, test
97-
* main thread will go on to do assertion where the stream execution may or
98-
* may not happen.
99-
*/
100-
while (!checkIfAllExecutionCompleted(executionCompletion)) {
101-
Thread.sleep(checkExecutionWaitTime);
102-
}
94+
/*
95+
* Since, the read from inputStream is happening in parallel thread, the
96+
* test has to wait for the execution to get over. If we don't wait, test
97+
* main thread will go on to do assertion where the stream execution may or
98+
* may not happen.
99+
*/
100+
while (!checkIfAllExecutionCompleted(executionCompletion)) {
101+
Thread.sleep(checkExecutionWaitTime);
102+
}
103103

104-
/*
105-
* The close() method of AbfsInputStream would lead to purge of completedList.
106-
* Because the readBufferWorkers are running in parallel thread, due to race condition,
107-
* after close and before assert, it can happen that processing of inProgress buffer
108-
* can get completed and hence we cannot assert on completedList to be empty.
109-
* That is why completedList are checked to not have a buffer other than the
110-
* buffers in inProgressQueue just before the closure of AbfsInputStream object.
111-
*/
112-
assertCompletedListContainsSubSetOfCertainSet(
113-
bufferManager.getCompletedReadListCopy(), inProgressBuffers,
114-
streamsInTest);
115-
for (AbfsInputStream stream : streamsInTest) {
116-
assertListDoesnotContainBuffersForIstream(
117-
bufferManager.getReadAheadQueueCopy(), stream);
118-
}
104+
/*
105+
* The close() method of AbfsInputStream would lead to purge of completedList.
106+
* Because the readBufferWorkers are running in parallel thread, due to race condition,
107+
* after close and before assert, it can happen that processing of inProgress buffer
108+
* can get completed and hence we cannot assert on completedList to be empty.
109+
* That is why completedList are checked to not have a buffer other than the
110+
* buffers in inProgressQueue just before the closure of AbfsInputStream object.
111+
*/
112+
assertCompletedListContainsSubSetOfCertainSet(
113+
bufferManager.getCompletedReadListCopy(), inProgressBuffers,
114+
streamsInTest);
115+
for (AbfsInputStream stream : streamsInTest) {
116+
assertListDoesnotContainBuffersForIstream(
117+
bufferManager.getReadAheadQueueCopy(), stream);
118+
}
119119
}
120120

121121
private void assertCompletedListContainsSubSetOfCertainSet(final List<ReadBuffer> completedList,
@@ -184,17 +184,17 @@ public void testPurgeBufferManagerForSequentialStream() throws Exception {
184184
// After closing stream2, no queued buffers of stream2 should be present.
185185
assertListDoesnotContainBuffersForIstream(bufferManager.getReadAheadQueueCopy(), iStream2);
186186

187-
/*
188-
* The close() method of AbfsInputStream would lead to purge of completedList.
189-
* Because the readBufferWorkers are running in parallel thread, due to race condition,
190-
* after close and before assert, it can happen that processing of inProgress buffer
191-
* can get completed and hence we cannot assert on completedList to be empty.
192-
* That is why completedList are checked to not have a buffer other than the
193-
* buffers in inProgressQueue just before the closure of AbfsInputStream object.
194-
*/
195-
assertCompletedListContainsSubSetOfCertainSet(
196-
bufferManager.getCompletedReadListCopy(), inProgressBufferSet,
197-
streamsInTest);
187+
/*
188+
* The close() method of AbfsInputStream would lead to purge of completedList.
189+
* Because the readBufferWorkers are running in parallel thread, due to race condition,
190+
* after close and before assert, it can happen that processing of inProgress buffer
191+
* can get completed and hence we cannot assert on completedList to be empty.
192+
* That is why completedList are checked to not have a buffer other than the
193+
* buffers in inProgressQueue just before the closure of AbfsInputStream object.
194+
*/
195+
assertCompletedListContainsSubSetOfCertainSet(
196+
bufferManager.getCompletedReadListCopy(), inProgressBufferSet,
197+
streamsInTest);
198198
}
199199

200200

0 commit comments

Comments
 (0)