Skip to content
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
Merged
Show file tree
Hide file tree
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 Mar 6, 2024
0ec18da
test method refactors
saxenapranav Mar 6, 2024
12ccd7f
made tests more parallelised and faster
saxenapranav Mar 7, 2024
dbca78b
formatting
saxenapranav Mar 8, 2024
0a1491a
set and unset executorservice; magic num for 256 KB
saxenapranav Mar 8, 2024
fd7189a
review refactors
saxenapranav Mar 11, 2024
e0108f8
static consts
saxenapranav Mar 11, 2024
18d88aa
FutureIO APIs added
saxenapranav Mar 13, 2024
6ed1297
test method refactor; FutureIO.awaitFuture new APIs use
saxenapranav Mar 13, 2024
b19fbed
Merge branch 'trunk' into saxenapranav/footerBufferSizeFix
saxenapranav Mar 13, 2024
eaa5550
javadocs fixture
saxenapranav Mar 15, 2024
514699b
Merge branch 'trunk' into saxenapranav/footerBufferSizeFix
saxenapranav Mar 26, 2024
2b4f68e
AbfsInputStreamTestUtil to have common methods
saxenapranav Mar 27, 2024
5a06792
removed ITestAbfsInputStream inheritence from ITestAbfsInputStreamSma…
saxenapranav Mar 27, 2024
b0733c9
Merge branch 'trunk' into saxenapranav/footerBufferSizeFix
saxenapranav Apr 16, 2024
bd4f396
review comments;
saxenapranav Apr 16, 2024
5bf2321
refactor in verifyAbsInputStreamStateAfterSeek
saxenapranav Apr 16, 2024
fbbf9fa
assertion on content read.
saxenapranav Apr 16, 2024
3cf5c72
refactored tests testing readBuffer: javadocs + explained that its fo…
saxenapranav Apr 16, 2024
8aad995
checkstyle
saxenapranav Apr 16, 2024
2354260
import block refactor; log.debug instead of error
saxenapranav Apr 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,6 +32,8 @@
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.slf4j.Logger;
Copy link
Contributor

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

import org.slf4j.LoggerFactory;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
Expand Down Expand Up @@ -58,6 +61,7 @@
@InterfaceStability.Unstable
public final class FutureIO {

private static final Logger LOG = LoggerFactory.getLogger(FutureIO.class.getName());
private FutureIO() {
}

Expand Down Expand Up @@ -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 {
Expand All @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The 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());
Copy link
Contributor

Choose a reason for hiding this comment

The 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
}
}
Expand All @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,14 @@ public AbfsConfiguration getConfiguration() {
return abfsConfig;
}

public AbfsConfiguration getConfiguration(AzureBlobFileSystem fs) {
return fs.getAbfsStore().getAbfsConfiguration();
}

public Map<String, Long> getInstrumentationMap(AzureBlobFileSystem fs) {
return fs.getInstrumentationMap();
}

public Configuration getRawConfiguration() {
return abfsConfig.getRawConfiguration();
}
Expand Down
Loading
Loading