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

Rename BlobStorageService to RestRequestService #1342

Merged
merged 2 commits into from
Dec 18, 2019

Conversation

zzmao
Copy link
Contributor

@zzmao zzmao commented Dec 17, 2019

Rename BlobStorageService to RestRequestService, for

  1. RestRequestService makes more sense since the interface arguments are RestRequest.
  2. Create have clearer names for FrontendRestRequestService and StorageServerRestRequestService.

---DO NOT COMMIT MESSAGE BELOW---
grep 'BlobStorage|blobStorage' -r . | grep -v 'Azure|Binary file|AzureCloud'
./docs/release-notes.md: - Making sure ordering of tests does not matter for BlobStorage tests (#773)
./docs/release-notes.md: - Rewriting AmbryBlobStorageService to make callbacks cleaner (#250)
./docs/release-notes.md: - Wiring in IdConverter and SecurityService into AmbryBlobStorageService (#248)
./docs/release-notes.md: - Making sure ordering of tests does not matter for BlobStorage tests (#773)
./docs/release-notes.md: - Rewriting AmbryBlobStorageService to make callbacks cleaner (#250)
./docs/release-notes.md: - Wiring in IdConverter and SecurityService into AmbryBlobStorageService (#248)
./ambry.iws: ambryBlobStorageService
./ambry.iws: AmbryBlobStorageService
./ambry.iws: BlobStorage
./ambry.iws:
./ambry.iws:
./ambry.iws:
./.git/logs/HEAD:a8014eb1ebac94cd6994337819c4973108d3ee1c 13f05671e7e37eac7af1d6847e6f0edc4404cdeb Ze Mao zemao@linkedin.com 1576612062 -0800 commit: Rename BlobStorageService to RestRequestService
./.git/logs/refs/heads/master:a8014eb1ebac94cd6994337819c4973108d3ee1c 13f05671e7e37eac7af1d6847e6f0edc4404cdeb Ze Mao zemao@linkedin.com 1576612062 -0800 commit: Rename BlobStorageService to RestRequestService
[zemao@zemao-mn1]:ambry(master) $ git log

Copy link
Contributor

@cgtz cgtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after these comments are addressed.

* and generates a response. The information received from the scaling layer should be enough to perform these
* functions.
* <p/>
* RestRequestService defines a service that handles {@RestRequest}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{@link RestRequest}s

@@ -40,12 +40,12 @@
private boolean isRunning = false;
private VerifiableProperties failureProperties = null;

private BlobStorageService blobStorageService = null;
private RestRequestService _restRequestService = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not use _ before member variables since its not used elsewhere in ambry open source.

@@ -191,17 +191,17 @@ public FrontendMetrics(MetricRegistry metricRegistry) {
// RestRequestMetricsGroup
// DELETE
deleteBlobMetricsGroup =
new RestRequestMetricsGroup(AmbryBlobStorageService.class, "DeleteBlob", false, true, metricRegistry);
new RestRequestMetricsGroup(FrontendRestRequestService.class, "DeleteBlob", false, true, metricRegistry);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder that this changes a lot of metric names so setup in closed source wrapper also have to be adjusted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure.

@@ -854,7 +854,7 @@ public void onCompletion(final GetBlobResult routerResult, Exception routerExcep
response = new ByteBufferReadableStreamChannel(ByteBuffer.wrap(blobInfo.getUserMetadata()));
} else {
restResponseChannel.setHeader(Headers.CONTENT_LENGTH, 0);
response = new ByteBufferReadableStreamChannel(AmbryBlobStorageService.EMPTY_BUFFER);
response = new ByteBufferReadableStreamChannel(FrontendRestRequestService.EMPTY_BUFFER);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but could you change this to just be EMPTY_BUFFER since its in the same class.

@@ -54,7 +54,7 @@
private final Logger logger = LoggerFactory.getLogger(getClass());

private AsyncResponseHandler asyncResponseHandler = null;
private BlobStorageService blobStorageService = null;
private RestRequestService _restRequestService = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove underscore

@@ -72,7 +72,7 @@
private final JmxReporter reporter;
private final AccountService accountService;
private final Router router;
private final BlobStorageService blobStorageService;
private final RestRequestService _restRequestService;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove underscore

@@ -73,7 +73,7 @@
*/
public class NettyMessageProcessorTest {
private final InMemoryRouter router;
private final BlobStorageService blobStorageService;
private final RestRequestService _restRequestService;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove underscore

* All the operations that need to be performed by the Ambry storage server are supported here.
*/
public class ServerBlobStorageService implements BlobStorageService {
private static final Logger logger = LoggerFactory.getLogger(ServerBlobStorageService.class);
public class StorageServerRestRequestService implements RestRequestService {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just StorageRestRequestService

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@53f7a2c). Click here to learn what that means.
The diff coverage is 94.84%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1342   +/-   ##
=========================================
  Coverage          ?   72.06%           
  Complexity        ?     6527           
=========================================
  Files             ?      478           
  Lines             ?    37349           
  Branches          ?     4718           
=========================================
  Hits              ?    26917           
  Misses            ?     9172           
  Partials          ?     1260
Impacted Files Coverage Δ Complexity Δ
....github.ambry/account/ServiceIdAccountGenTool.java 0% <ø> (ø) 0 <0> (?)
...main/java/com.github.ambry/config/NettyConfig.java 100% <ø> (ø) 1 <0> (?)
...src/main/java/com.github.ambry/rest/RestUtils.java 93.92% <ø> (ø) 68 <0> (?)
...ub.ambry.rest/FrontendNettyChannelInitializer.java 100% <ø> (ø) 3 <0> (?)
...n/java/com.github.ambry/config/FrontendConfig.java 100% <ø> (ø) 3 <0> (?)
...m.github.ambry/rest/RestRequestMetricsTracker.java 96.29% <ø> (ø) 15 <0> (?)
...a/com.github.ambry.rest/NettyMessageProcessor.java 78.82% <ø> (ø) 41 <0> (?)
...github.ambry.server/StorageRestRequestService.java 0% <0%> (ø) 0 <0> (?)
...ub.ambry.frontend/AccountAndContainerInjector.java 90.72% <0%> (ø) 27 <0> (?)
...rc/main/java/com.github.ambry.rest/RestServer.java 91.87% <100%> (ø) 13 <0> (?)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53f7a2c...408ce40. Read the comment docs.

@justinlin-linkedin justinlin-linkedin merged commit 37c6246 into linkedin:master Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants