-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HADOOP-19102. FooterReadBufferSize should not be greater than readBufferSize #6617
Merged
steveloughran
merged 21 commits into
apache:trunk
from
saxenapranav:saxenapranav/footerBufferSizeFix
Apr 22, 2024
Merged
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
458f9bf
test method fixture; set of footerReadBufferSize
saxenapranav 0ec18da
test method refactors
saxenapranav 12ccd7f
made tests more parallelised and faster
saxenapranav dbca78b
formatting
saxenapranav 0a1491a
set and unset executorservice; magic num for 256 KB
saxenapranav fd7189a
review refactors
saxenapranav e0108f8
static consts
saxenapranav 18d88aa
FutureIO APIs added
saxenapranav 6ed1297
test method refactor; FutureIO.awaitFuture new APIs use
saxenapranav b19fbed
Merge branch 'trunk' into saxenapranav/footerBufferSizeFix
saxenapranav eaa5550
javadocs fixture
saxenapranav 514699b
Merge branch 'trunk' into saxenapranav/footerBufferSizeFix
saxenapranav 2b4f68e
AbfsInputStreamTestUtil to have common methods
saxenapranav 5a06792
removed ITestAbfsInputStream inheritence from ITestAbfsInputStreamSma…
saxenapranav b0733c9
Merge branch 'trunk' into saxenapranav/footerBufferSizeFix
saxenapranav bd4f396
review comments;
saxenapranav 5bf2321
refactor in verifyAbsInputStreamStateAfterSeek
saxenapranav fbbf9fa
assertion on content read.
saxenapranav 3cf5c72
refactored tests testing readBuffer: javadocs + explained that its fo…
saxenapranav 8aad995
checkstyle
saxenapranav 2354260
import block refactor; log.debug instead of error
saxenapranav File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
import java.io.IOException; | ||
import java.io.InterruptedIOException; | ||
import java.io.UncheckedIOException; | ||
import java.time.Duration; | ||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
@@ -31,6 +32,8 @@ | |
import java.util.concurrent.Future; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.concurrent.TimeoutException; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import org.apache.hadoop.classification.InterfaceAudience; | ||
import org.apache.hadoop.classification.InterfaceStability; | ||
|
@@ -58,6 +61,7 @@ | |
@InterfaceStability.Unstable | ||
public final class FutureIO { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(FutureIO.class.getName()); | ||
private FutureIO() { | ||
} | ||
|
||
|
@@ -132,7 +136,7 @@ public static <T> T awaitFuture(final Future<T> future, | |
* @throws IOException if something went wrong | ||
* @throws RuntimeException any nested RTE thrown | ||
*/ | ||
public static <T> List<T> awaitFuture(final Collection<Future<T>> collection) | ||
public static <T> List<T> awaitAllFutures(final Collection<Future<T>> collection) | ||
throws InterruptedIOException, IOException, RuntimeException { | ||
List<T> results = new ArrayList<>(); | ||
try { | ||
|
@@ -141,9 +145,11 @@ public static <T> List<T> awaitFuture(final Collection<Future<T>> collection) | |
} | ||
return results; | ||
} catch (InterruptedException e) { | ||
LOG.error("Execution of future interrupted ", e); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets make these a debug() and let the caller handle the the rest. |
||
throw (InterruptedIOException) new InterruptedIOException(e.toString()) | ||
.initCause(e); | ||
} catch (ExecutionException e) { | ||
LOG.error("Execution of future failed with exception", e.getCause()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. log this at debug. handlers up the stack can choose what to do -it may be harmless |
||
return raiseInnerCause(e); | ||
steveloughran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
|
@@ -158,30 +164,30 @@ public static <T> List<T> awaitFuture(final Collection<Future<T>> collection) | |
* </p> | ||
* | ||
* @param collection collection of futures to be evaluated | ||
* @param timeout timeout to wait | ||
* @param unit time unit. | ||
* @param duration timeout duration | ||
* @param <T> type of the result. | ||
* @return the list of future's result, if all went well. | ||
* @throws InterruptedIOException future was interrupted | ||
* @throws IOException if something went wrong | ||
* @throws RuntimeException any nested RTE thrown | ||
* @throws TimeoutException the future timed out. | ||
*/ | ||
public static <T> List<T> awaitFuture(final Collection<Future<T>> collection, | ||
final long timeout, | ||
final TimeUnit unit) | ||
public static <T> List<T> awaitAllFutures(final Collection<Future<T>> collection, | ||
final Duration duration) | ||
throws InterruptedIOException, IOException, RuntimeException, | ||
TimeoutException { | ||
List<T> results = new ArrayList<>(); | ||
try { | ||
for (Future<T> future : collection) { | ||
results.add(future.get(timeout, unit)); | ||
results.add(future.get(duration.toMillis(), TimeUnit.MILLISECONDS)); | ||
} | ||
return results; | ||
} catch (InterruptedException e) { | ||
LOG.error("Execution of future interrupted ", e); | ||
throw (InterruptedIOException) new InterruptedIOException(e.toString()) | ||
.initCause(e); | ||
} catch (ExecutionException e) { | ||
LOG.error("Execution of future failed with exception", e.getCause()); | ||
return raiseInnerCause(e); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't be in same import block as java*.
tip: you can set your IDE up for these rules