-
Couldn't load subscription status.
- Fork 9.1k
HADOOP-16612 Track Azure Blob File System client-perceived latency #1611
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
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c4dd43d
track ADLS end-to-end latency
jemangwa f6e7183
fix checkstyle issues
jemangwa 266635e
fix more checkstyle issues
jemangwa e7502e3
use try-with-resources to reduce the verbosity
jemangwa d3258ff
use generic interfaceto get log string
jemangwa 48fb799
add detailed documentation and comments
jemangwa 70d4020
address PR feedback
jemangwa 0c4b559
include the logging into perf tracking as well
jemangwa 0fd18a0
cut short the lines
jemangwa df2647f
address comments on styles
jemangwa 3bcd936
address more nits
jemangwa f12d371
fix checkstyle issues
jemangwa e8727a6
fix javadoc warnings
jemangwa 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
844 changes: 514 additions & 330 deletions
844
...ls/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
34 changes: 34 additions & 0 deletions
34
...zure/src/main/java/org/apache/hadoop/fs/azurebfs/contracts/services/AbfsPerfLoggable.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,34 @@ | ||
| /** | ||
| * 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 | ||
| * <p> | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * <p> | ||
| * 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.azurebfs.contracts.services; | ||
|
|
||
| import org.apache.hadoop.classification.InterfaceStability; | ||
|
|
||
| /** | ||
| * The AbfsPerfLoggable contract. | ||
| */ | ||
| @InterfaceStability.Evolving | ||
| public interface AbfsPerfLoggable { | ||
| /** | ||
| * Gets the string to log to the Abfs Logging API. | ||
| * | ||
| * @return the string that will be logged. | ||
| */ | ||
| String getLogString(); | ||
| } |
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
133 changes: 133 additions & 0 deletions
133
...tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsPerfInfo.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,133 @@ | ||
| /** | ||
| * 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.azurebfs.services; | ||
|
|
||
| import java.time.Instant; | ||
|
|
||
| import org.apache.hadoop.fs.azurebfs.contracts.services.AbfsPerfLoggable; | ||
|
|
||
| /** | ||
| * {@code AbfsPerfInfo} holds information on ADLS Gen 2 API performance observed by {@code AbfsClient}. Every | ||
| * Abfs request keeps adding its information (success/failure, latency etc) to its {@code AbfsPerfInfo}'s object | ||
| * as and when it becomes available. When the request is over, the performance information is recorded while | ||
| * the {@code AutoCloseable} {@code AbfsPerfInfo} object is "closed". | ||
| */ | ||
| public final class AbfsPerfInfo implements AutoCloseable { | ||
|
|
||
| // the tracker which will be extracting perf info out of this object. | ||
| private AbfsPerfTracker abfsPerfTracker; | ||
|
|
||
| // the caller name. | ||
| private String callerName; | ||
|
|
||
| // the callee name. | ||
| private String calleeName; | ||
|
|
||
| // time when this tracking started. | ||
| private Instant trackingStart; | ||
|
|
||
| // time when this tracking ended. | ||
| private Instant trackingEnd; | ||
|
|
||
| // whether the tracked request was successful. | ||
| private boolean success; | ||
|
|
||
| // time when the aggregate operation (to which this request belongs) started. | ||
| private Instant aggregateStart; | ||
|
|
||
| // number of requests in the aggregate operation (to which this request belongs). | ||
| private long aggregateCount; | ||
|
|
||
| // result of the request. | ||
| private AbfsPerfLoggable res; | ||
|
|
||
| public AbfsPerfInfo(AbfsPerfTracker abfsPerfTracker, String callerName, String calleeName) { | ||
| this.callerName = callerName; | ||
| this.calleeName = calleeName; | ||
| this.abfsPerfTracker = abfsPerfTracker; | ||
| this.success = false; | ||
| this.trackingStart = abfsPerfTracker.getLatencyInstant(); | ||
| } | ||
|
|
||
| public AbfsPerfInfo registerSuccess(boolean success) { | ||
| this.success = success; | ||
| return this; | ||
| } | ||
|
|
||
| public AbfsPerfInfo registerResult(AbfsPerfLoggable res) { | ||
| this.res = res; | ||
| return this; | ||
| } | ||
|
|
||
| public AbfsPerfInfo registerAggregates(Instant aggregateStart, long aggregateCount) { | ||
| this.aggregateStart = aggregateStart; | ||
| this.aggregateCount = aggregateCount; | ||
| return this; | ||
| } | ||
|
|
||
| public AbfsPerfInfo finishTracking() { | ||
| if (this.trackingEnd == null) { | ||
| this.trackingEnd = abfsPerfTracker.getLatencyInstant(); | ||
| } | ||
|
|
||
| return this; | ||
| } | ||
|
|
||
| public AbfsPerfInfo registerCallee(String calleeName) { | ||
| this.calleeName = calleeName; | ||
| return this; | ||
| } | ||
|
|
||
| @Override | ||
| public void close() { | ||
| abfsPerfTracker.trackInfo(this.finishTracking()); | ||
| } | ||
|
|
||
| public String getCallerName() { | ||
| return callerName; | ||
| }; | ||
|
|
||
| public String getCalleeName() { | ||
| return calleeName; | ||
| } | ||
|
|
||
| public Instant getTrackingStart() { | ||
| return trackingStart; | ||
| } | ||
|
|
||
| public Instant getTrackingEnd() { | ||
| return trackingEnd; | ||
| } | ||
|
|
||
| public boolean getSuccess() { | ||
| return success; | ||
| } | ||
|
|
||
| public Instant getAggregateStart() { | ||
| return aggregateStart; | ||
| } | ||
|
|
||
| public long getAggregateCount() { | ||
| return aggregateCount; | ||
| } | ||
|
|
||
| public AbfsPerfLoggable getResult() { | ||
| return res; | ||
| } | ||
| } |
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.