Skip to content

Commit

Permalink
Standardize log messages for datastream operations (#961)
Browse files Browse the repository at this point in the history
Co-authored-by: Amy Bu <[email protected]>
  • Loading branch information
amybubu and Amy Bu authored Oct 12, 2023
1 parent 06fed5d commit 8f58370
Showing 1 changed file with 8 additions and 8 deletions.
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

0 comments on commit 8f58370

Please sign in to comment.