-
Notifications
You must be signed in to change notification settings - Fork 45
Conversation
1. /UpdateParameterStore 2. /QueueExecutionAttributes/<queue_type>/<queue_name>
* PD-257044-changes-for-databus * duplicated kafka and ssm util packages in emo sor module * removed redundant dependencies
* PD-257044-changes-for-databus * duplicated kafka and ssm util packages in emo sor module * removed redundant dependencies * additional changes * additional changes * additional changes * removed unneccessary dependencies
This reverts commit 62dc31e.
quality/integration/src/test/java/test/integration/auth/TableRoleManagerDAOTest.java
Show resolved
Hide resolved
queue-api/src/main/java/com/bazaarvoice/emodb/queue/api/DedupQueueService.java
Show resolved
Hide resolved
queue-api/src/main/java/com/bazaarvoice/emodb/queue/api/QueueService.java
Show resolved
Hide resolved
queue/src/main/java/com/bazaarvoice/emodb/queue/core/stepfn/StepFunctionService.java
Show resolved
Hide resolved
queue/src/main/java/com/bazaarvoice/emodb/queue/core/stepfn/StepFunctionService.java
Outdated
Show resolved
Hide resolved
queue/src/test/java/com/bazaarvoice/emodb/queue/core/stepfn/StepFunctionServiceTest.java
Show resolved
Hide resolved
web/src/main/java/com/bazaarvoice/emodb/web/resources/queue/QueueResource1.java
Outdated
Show resolved
Hide resolved
web/src/main/java/com/bazaarvoice/emodb/web/resources/sor/DataStoreResource1.java
Show resolved
Hide resolved
sor/src/main/java/com/bazaarvoice/emodb/sor/core/DefaultDataStore.java
Outdated
Show resolved
Hide resolved
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.
LGTM
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.
one potential blocking issue
databus/src/main/java/com/bazaarvoice/emodb/databus/core/OwnerAwareDatabus.java
Outdated
Show resolved
Hide resolved
queue/src/main/java/com/bazaarvoice/emodb/queue/core/AbstractQueueService.java
Outdated
Show resolved
Hide resolved
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.
Thanks
@@ -46,7 +46,7 @@ public void sendMessages(String topic, Collection<String> events, String queueTy | |||
throw new RuntimeException("Error sending messages to Kafka", e); | |||
} | |||
} | |||
_log.info("Finished sending messages to topic '{}' time taken : {} milliseconds", topic, Duration.between(startTime,LocalDateTime.now()).toMillis()); | |||
_log.info("Finished sending messages to topic '{}' time taken : {} milliseconds", topic, Duration.between(startTime, LocalDateTime.now()).toMillis()); |
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.
do log the events.size(O as well in this log, will be easy for analytics, on time taken per topic for the events size...
return response.getVersion(); | ||
} catch (Exception e) { | ||
logger.error("Failed to update parameter: " + key + " with value: " + value, e); | ||
throw new RuntimeException("Unexpected error updating parameter: " + key + " with value: " + value, e); |
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.
Why its a RuntimeException and not an Exception?
logger.info("Successfully updated parameter: " + key + " with value: " + value + ", Update Version: " + response.getVersion()); | ||
return response.getVersion(); | ||
} catch (Exception e) { | ||
logger.error("Failed to update parameter: " + key + " with value: " + value, e); |
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.
Is this log required? adding too much log events... anyway the thrown exception will be logged by the caller/catcher...
} | ||
executionName = executionName.trim(); | ||
// Replace invalid characters with underscores | ||
String sanitized = executionName.replaceAll("[^a-zA-Z0-9\\-_]", "_"); |
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.
suggestion: to optimize
replaceAll("[^a-zA-Z0-9\\-_]+", "")
a '+' after the square bracket would be better, as it will reduce the consecutive invalid character to one '' string...
"ab_2@@3###4$$$$5%%%%%".replaceAll("[^a-zA-Z0-9\\-_]", "") would return 'ab_2___3____4_____5___'
"ab_2@@_3###4$$$$5%%%%%".replaceAll("[^a-zA-Z0-9\\-_]+", "") would return 'ab_2__3__4__5'
|
||
// Truncate from the beginning if length exceeds 66 characters | ||
if (sanitized.length() > 66) { | ||
sanitized = sanitized.substring(sanitized.length() - 66); |
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.
Is the sanitized text expected to be unique?
If so why not append a GUID value to the string, after trimming to 50 characters?
return; | ||
} catch(Exception e){ | ||
logger.error("Error starting step-function with attributes " + queueExecutionAttributes + " | " + e.getMessage()); | ||
throw new RuntimeException("Error starting step-function with attributes " + queueExecutionAttributes + " | " + e.getMessage()); |
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.
Why not throw the exception and why thrownig a RuntimeException?
private Integer queueThreshold; | ||
private Integer batchSize; | ||
private Integer interval; | ||
private String status; |
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.
Status should be a boolean or ENUM, random string will be confusing and maintenance hassle
private String queueName; | ||
private String queueType; | ||
private String topicName; | ||
private Integer queueThreshold; |
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.
Why is this an Object (Integer) and not a primitive 'integer'?
I suppose this should be a 'long', to support really long size value
} | ||
|
||
if(executionAttributes.getStatus() == null || executionAttributes.getStatus().isEmpty()) { | ||
executionAttributes.setStatus("ENABLED"); |
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.
Use Enum for status, to have the predefined list of values and easy comparison/check
} catch (StateMachineDoesNotExistException e) { | ||
logger.error("State Machine does not exist for queue_type: " + queueType + ", queue_name: " + queueName, e); | ||
} catch (InvalidArnException e) { | ||
logger.error("Invalid ARN provided for queue_type: " + queueType + ", queue_name: " + queueName, e); |
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.
Why not log the ARN?
Github Issue
1234
What Are We Doing Here?
Here is where you should describe the problem you are solving as it relates to the Github Issue referred above, adding any fine
details on the solution that might otherwise not be recognizable for someone
unfamiliar with the changes. Add some pictures if it helps.
How to Test and Verify
Risk
Level
Low
,Medium
, orHigh
. Give an indication of what you think is the level of change introduced by this PR.High
means a massive change to a core functionality.Low
means a really minor change that shouldn't have any regression effect.Required Testing
Smoke
,Regression
, orManual
. (All changes except documentation need smoketesting at a minimum).
Risk Summary
Add one or a few complete sentences about the possible risks or concerns for
this change.
Code Review Checklist
Tests are included. If not, make sure you leave us a line or two for the reason.
Pulled down the PR and performed verification of at least being able to
build and run.
Well documented, including updates to any necessary markdown files. When
we inevitably come back to this code it will only take hours to figure out, not
days.
Consistent/Clear/Thoughtful? We are better with this code. We also aren't
a victim of rampaging consistency, and should be using this course of action.
We don't have coding standards out yet for this project, so please make sure to address any feedback regarding STYLE so the codebase remains consistent.
PR has a valid summary, and a good description.