-
Notifications
You must be signed in to change notification settings - Fork 17
Adds more stats. #358
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
Adds more stats. #358
Changes from all commits
95c7954
65d85d7
8dc0ad2
9d7b7cf
cefe410
8609bfe
54b2f78
a04b838
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,7 @@ | |
| import software.amazon.s3.analyticsaccelerator.util.BlockKey; | ||
| import software.amazon.s3.analyticsaccelerator.util.ObjectKey; | ||
| import software.amazon.s3.analyticsaccelerator.util.OpenStreamInformation; | ||
| import software.amazon.s3.analyticsaccelerator.util.RequestCallback; | ||
| import software.amazon.s3.analyticsaccelerator.util.StreamAttributes; | ||
|
|
||
| /** Implements a Block Manager responsible for planning and scheduling reads on a key. */ | ||
|
|
@@ -59,6 +60,7 @@ public class BlockManager implements Closeable { | |
| private final SequentialReadProgression sequentialReadProgression; | ||
| private final RangeOptimiser rangeOptimiser; | ||
| private final OpenStreamInformation openStreamInformation; | ||
| private final RequestCallback requestCallback; | ||
| private final int maxGeneration; | ||
|
|
||
| private static final String OPERATION_MAKE_RANGE_AVAILABLE = "block.manager.make.range.available"; | ||
|
|
@@ -95,6 +97,7 @@ public BlockManager( | |
| this.indexCache = indexCache; | ||
| this.blockStore = new BlockStore(indexCache, aggregatingMetrics, configuration); | ||
| this.openStreamInformation = openStreamInformation; | ||
| this.requestCallback = openStreamInformation.getRequestCallback(); | ||
| this.streamReader = | ||
| new StreamReader( | ||
| objectClient, | ||
|
|
@@ -153,7 +156,16 @@ public synchronized void makeRangeAvailable(long pos, long len, ReadMode readMod | |
| long endPos = pos + len - 1; | ||
|
|
||
| // Range is available, return | ||
| if (isRangeAvailable(pos, endPos)) return; | ||
| if (isRangeAvailable(pos, endPos)) { | ||
| if (readMode == ReadMode.SYNC) { | ||
| openStreamInformation.getRequestCallback().onCacheHit(); | ||
| } | ||
| return; | ||
| } | ||
|
|
||
| if (readMode.isPrefetch()) { | ||
| requestCallback.onBlockPrefetch(pos, endPos); | ||
| } | ||
|
|
||
| long generation = getGeneration(pos, readMode); | ||
|
|
||
|
|
@@ -171,6 +183,9 @@ public synchronized void makeRangeAvailable(long pos, long len, ReadMode readMod | |
| if (generation > 0) { | ||
| maxReadLength = | ||
| Math.max(maxReadLength, sequentialReadProgression.getSizeForGeneration(generation)); | ||
|
|
||
| // Record any range extension due to sequential prefetching | ||
| requestCallback.onBlockPrefetch(endPos + 1, truncatePos(pos + maxReadLength - 1)); | ||
|
Contributor
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. can u explain this a bit more for me?
Collaborator
Author
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. these are the number of extra bytes AAL requested that the user did not ask for. the user request was for till endPos. And then AAL extended the request due to sequential prefetching, so we report these as prefetched bytes |
||
| } | ||
| // Truncate end position to the object length | ||
| long effectiveEnd = truncatePos(pos + maxReadLength - 1); | ||
|
|
||
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.
I don't really get the point of this test
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.
had to add it to ensure test coverage passes