linkedin / linkedin/ambry

Add TTL option for NettyPerfClient

Open
#1,437 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

newbie
Dominant language
Java
Stars
1.8k
Forks
298
Avg merge
21h 43m
Merged PRs (30d)
9

Description

NettyPerfClient is a Netty based tool to generate PUT/GET traffic to frontend.

CLI to run this tool:
```
java -Dlog4j.configuration=file:../config/log4j.properties -cp ambry.jar com.github.ambry.tools.perf.rest.NettyPerfClient --hosts localhost --port 1174 --requestType POST --concurrency 10 --postBlobTotalSize 100 --postBlobChunkSize 100 --targetAccountName ambry_hadoop_test_account --targetContainerName ambry_hadoop_test_cntr
```

The tool is lack of a TTL option, without it all blob PUT to ambry is infinity. We want to have an option for Blob TTL when issue a command.

Core change:
NettyPerfClient:
```
private void reset() {
if (chunk != null) {
chunkedInput = new HttpChunkedInput(new RepeatedBytesInput());
request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, path);
HttpUtil.setContentLength(request, totalSize);
request.headers().add(RestUtils.Headers.BLOB_SIZE, totalSize);
request.headers().add(RestUtils.Headers.SERVICE_ID, serviceId);
request.headers().add(RestUtils.Headers.AMBRY_CONTENT_TYPE, "application/octet-stream");
request.headers().add(RestUtils.Headers.TARGET_ACCOUNT_NAME, targetAccountName);
request.headers().add(RestUtils.Headers.TARGET_CONTAINER_NAME, targetContainerName);
++ request.headers().add(RestUtils.Headers.TTL, 86400); // make 86400 configureable. a.k.a pass in from CLI.
} else {
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search for NettyPerfClient and its reset() method, then inspect how the existing CLI options are parsed. Done means the command accepts a configurable TTL and applies that value to the blob PUT request instead of the hard-coded 86400.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.