-
Couldn't load subscription status.
- Fork 9.1k
HADOOP-17461. Thread-level IOStatistics in S3A #4352
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2655a61
HADOOP-17461. Thread-level IOStatistics in S3A
mehakmeet 471379f
HADOOP-17461. IOStatisticsContext in S3ABlockOutputStream
mehakmeet 9f5631b
HADOOP-17461. steve's review comments
mehakmeet 6cb9a81
HADOOP-17461. changing the property key
mehakmeet bcb4c25
HADOOP-18242. checkstyle + merge conflicts
mehakmeet 232d6b9
HADOOP-17461. resetting stats + review comments
82bc205
HADOOP-17461. review comments + test fixes
c2dcad1
HADOOP-17461. changes required for spark wiring.
7344b4e
HADOOP-17461. IOStatisticsContext committer integration
steveloughran bf84de6
HADOOP-17461. IOStatisticsContext committer integration
steveloughran f54ad18
HADOOP-17461. javadocs and checkstyles
6f7e72e
HADOOP-17461. moving IOStatisticsContext in a different package
7b3c335
HADOOP-17461. making committer collection of context iostats optional.
steveloughran 359206d
HADOOP-17461. TaskPool automatically propagates context
steveloughran 81c0480
HADOOP-17461. adding stream capability and enabling iocontext for test
cdc9915
HADOOP-17461. review comments
de12dbe
HADOOP-17461. RawLocal streams capabilties and checkstyle
mehakmeet 2ebe82e
Revert "HADOOP-17461. RawLocal streams capabilties and checkstyle"
mehakmeet 0db1a76
HADOOP-17461. RawLocalFileSystem streams are IOStatisticsContext aware
steveloughran 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 hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
83 changes: 83 additions & 0 deletions
83
...ject/hadoop-common/src/main/java/org/apache/hadoop/fs/statistics/IOStatisticsContext.java
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.hadoop.fs.statistics; | ||
|
|
||
| import org.apache.hadoop.fs.statistics.impl.IOStatisticsContextIntegration; | ||
|
|
||
| /** | ||
| * An interface defined to capture thread-level IOStatistics by using per | ||
| * thread context. | ||
| * <p> | ||
| * The aggregator should be collected in their constructor by statistics-generating | ||
| * classes to obtain the aggregator to update <i>across all threads</i>. | ||
| * <p> | ||
| * The {@link #snapshot()} call creates a snapshot of the statistics; | ||
| * <p> | ||
| * The {@link #reset()} call resets the statistics in the context so | ||
| * that later snapshots will get the incremental data. | ||
| */ | ||
| public interface IOStatisticsContext extends IOStatisticsSource { | ||
|
|
||
| /** | ||
| * Get the IOStatisticsAggregator for the context. | ||
| * | ||
| * @return return the aggregator for the context. | ||
| */ | ||
| IOStatisticsAggregator getAggregator(); | ||
|
|
||
| /** | ||
| * Capture the snapshot of the context's IOStatistics. | ||
| * | ||
| * @return IOStatisticsSnapshot for the context. | ||
| */ | ||
| IOStatisticsSnapshot snapshot(); | ||
|
|
||
| /** | ||
| * Get a unique ID for this context, for logging | ||
| * purposes. | ||
| * | ||
| * @return an ID unique for all contexts in this process. | ||
| */ | ||
| long getID(); | ||
|
|
||
| /** | ||
| * Reset the context's IOStatistics. | ||
| */ | ||
| void reset(); | ||
|
|
||
| /** | ||
| * Get the context's IOStatisticsContext. | ||
| * | ||
| * @return instance of IOStatisticsContext for the context. | ||
| */ | ||
| static IOStatisticsContext getCurrentIOStatisticsContext() { | ||
| return IOStatisticsContextIntegration.getCurrentIOStatisticsContext(); | ||
| } | ||
|
|
||
| /** | ||
| * Set the IOStatisticsContext for the current thread. | ||
| * @param statisticsContext IOStatistics context instance for the | ||
| * current thread. If null, the context is reset. | ||
| */ | ||
| static void setThreadIOStatisticsContext( | ||
| IOStatisticsContext statisticsContext) { | ||
| IOStatisticsContextIntegration.setThreadIOStatisticsContext( | ||
| statisticsContext); | ||
| } | ||
| } |
81 changes: 81 additions & 0 deletions
81
...mmon/src/main/java/org/apache/hadoop/fs/statistics/impl/EmptyIOStatisticsContextImpl.java
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.hadoop.fs.statistics.impl; | ||
|
|
||
| import org.apache.hadoop.fs.statistics.IOStatistics; | ||
| import org.apache.hadoop.fs.statistics.IOStatisticsAggregator; | ||
| import org.apache.hadoop.fs.statistics.IOStatisticsContext; | ||
| import org.apache.hadoop.fs.statistics.IOStatisticsSnapshot; | ||
|
|
||
| /** | ||
| * Empty IOStatistics context which serves no-op for all the operations and | ||
| * returns an empty Snapshot if asked. | ||
| * | ||
| */ | ||
| final class EmptyIOStatisticsContextImpl implements IOStatisticsContext { | ||
|
|
||
| private static final IOStatisticsContext EMPTY_CONTEXT = new EmptyIOStatisticsContextImpl(); | ||
|
|
||
| private EmptyIOStatisticsContextImpl() { | ||
| } | ||
|
|
||
| /** | ||
| * Create a new empty snapshot. | ||
| * A new one is always created for isolation. | ||
| * | ||
| * @return a statistics snapshot | ||
| */ | ||
| @Override | ||
| public IOStatisticsSnapshot snapshot() { | ||
| return new IOStatisticsSnapshot(); | ||
| } | ||
|
|
||
| @Override | ||
| public IOStatisticsAggregator getAggregator() { | ||
| return EmptyIOStatisticsStore.getInstance(); | ||
| } | ||
|
|
||
| @Override | ||
| public IOStatistics getIOStatistics() { | ||
| return EmptyIOStatistics.getInstance(); | ||
| } | ||
|
|
||
| @Override | ||
| public void reset() {} | ||
|
|
||
| /** | ||
| * The ID is always 0. | ||
| * As the real context implementation counter starts at 1, | ||
| * we are guaranteed to have unique IDs even between them and | ||
| * the empty context. | ||
| * @return 0 | ||
| */ | ||
| @Override | ||
| public long getID() { | ||
| return 0; | ||
| } | ||
|
|
||
| /** | ||
| * Get the single instance. | ||
| * @return an instance. | ||
| */ | ||
| static IOStatisticsContext getInstance() { | ||
| return EMPTY_CONTEXT; | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.