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

Standardize log messages for datastream operations #961

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public DatastreamResources(DatastreamStore store, Coordinator coordinator, Prope
* </ol>
*/
private void doUpdateDatastreams(Map<String, Datastream> datastreamMap) {
LOG.info("Update datastream call with request: {}", datastreamMap);
LOG.info("[UPDATE] datastream called with request = {}", datastreamMap);
_dynamicMetricsManager.createOrUpdateMeter(CLASS_NAME, UPDATE_CALL, 1);
if (datastreamMap.isEmpty()) {
LOG.warn("Update datastream call with empty input.");
Expand Down Expand Up @@ -359,7 +359,7 @@ public ActionResult<Void> pause(@PathKeysParam PathKeys pathKeys,
String datastreamName = pathKeys.getAsString(KEY_NAME);
Datastream datastream = _store.getDatastream(datastreamName);

LOG.info("Received request to pause datastream {}", datastream);
LOG.info("[PAUSE] datastream called for datastream = {}", datastream);

if (datastream == null) {
_errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_404_NOT_FOUND,
Expand Down Expand Up @@ -462,7 +462,7 @@ public ActionResult<Void> stop(@PathKeysParam PathKeys pathKeys,
String datastreamName = pathKeys.getAsString(KEY_NAME);
Datastream datastream = _store.getDatastream(datastreamName);

LOG.info("Received request to stop datastream {}, force: {}", datastream, force);
LOG.info("[STOP] datastream called for datastream = {} with force = {}", datastream, force);

if (datastream == null) {
_errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_404_NOT_FOUND,
Expand Down Expand Up @@ -553,7 +553,7 @@ public ActionResult<Void> resume(@PathKeysParam PathKeys pathKeys,
String datastreamName = pathKeys.getAsString(KEY_NAME);
Datastream datastream = _store.getDatastream(datastreamName);

LOG.info("Received request to resume datastream {}", datastream);
LOG.info("[RESUME] datastream called for datastream = {}", datastream);

if (datastream == null) {
_errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_404_NOT_FOUND,
Expand Down Expand Up @@ -768,7 +768,7 @@ public UpdateResponse delete(String datastreamName) {
}

try {
LOG.info("[DELETE] operation called for datastream {} = {}", datastreamName, datastream);
LOG.info("[DELETE] datastream called for datastream {} = {}", datastreamName, datastream);

_dynamicMetricsManager.createOrUpdateMeter(CLASS_NAME, DELETE_CALL, 1);
Instant startTime = Instant.now();
Expand All @@ -795,7 +795,7 @@ public UpdateResponse delete(String datastreamName) {
public Datastream get(String name) {
Datastream stream = null;
try {
LOG.info("Get datastream called for datastream {}", name);
LOG.info("[GET] datastream called for datastream = {}", name);
_dynamicMetricsManager.createOrUpdateMeter(CLASS_NAME, GET_CALL, 1);
stream = _store.getDatastream(name);
} catch (Exception e) {
Expand Down Expand Up @@ -846,7 +846,7 @@ public String getTaskAssignment(@PathKeysParam PathKeys pathKeys, @ActionParam("
@Override
public List<Datastream> getAll(@Context PagingContext pagingContext) {
try {
LOG.info("Get all datastreams called with paging context {}", pagingContext);
LOG.info("[GET ALL] datastreams called with paging context = {}", pagingContext);
_dynamicMetricsManager.createOrUpdateMeter(CLASS_NAME, GET_ALL_CALL, 1);
Instant startTime = Instant.now();
List<Datastream> ret = RestliUtils.withPaging(_store.getAllDatastreams(), pagingContext)
Expand Down Expand Up @@ -897,7 +897,7 @@ public List<Datastream> findGroup(@Context PagingContext pagingContext,
@Override
public CreateResponse create(Datastream datastream) {
try {
LOG.info("Create datastream called with datastream {}", datastream);
LOG.info("[CREATE] datastream called with datastream = {}", datastream);
if (LOG.isDebugEnabled()) {
LOG.debug("Handling request on object: {} thread: {}", this, Thread.currentThread());
}
Expand Down