-
Notifications
You must be signed in to change notification settings - Fork 201
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
Mantis runtime compile warn fix #468
Mantis runtime compile warn fix #468
Conversation
db11f3c
to
58853a9
Compare
is.close(); | ||
Objects.requireNonNull(is).close(); |
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.
if (is != null) is.close()
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.
Update the code as suggested.
@@ -96,7 +88,7 @@ public void execute() throws CommandException { | |||
File jobDescriptor = new File(fileLoop.getParent() + "/" + jsonFile); | |||
new CreateJobDescriptorFile(job, jobDescriptor, fileVersion, fileBase).execute(); | |||
} catch (Exception e) { | |||
System.out.println("Got an error " + e.toString()); | |||
System.out.println("Got an error " + 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.
Get rid of System.out.println. Use log.error instead.
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.
Should I use Logger instead of System.out.println inside mantis runtime module in all places used?
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.
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.
Yes, let's try to eliminate System::out usages in the runtime module. Let's do that in a separate PR though. This PR is big enough already.
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.
Added the logger.
if (runNewSseServerImpl(context.getWorkerInfo().getJobName())) { | ||
if (runNewSseServerImpl(context.getWorkerInfo().getJobClusterName())) { |
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.
nit: What's the rationale for this change?
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.
@@ -213,6 +214,7 @@ public Observable<Void> handle(HttpServerRequest<ByteBuf> request, | |||
if (queryParameters != null && queryParameters.containsKey(ENABLE_PINGS_PARAM)) { | |||
// enablePings | |||
String enablePings = queryParameters.get(ENABLE_PINGS_PARAM).get(0); | |||
//Code logic can be improved here. |
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.
Add a todo comment.
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.
Updated, Please verify and resolve.
Test Results126 files ±0 126 suites ±0 6m 30s ⏱️ +36s For more details on these failures, see this check. Results for commit 6925a5d. ± Comparison against base commit 91791b2. ♻️ This comment has been updated with latest results. |
Set<OperandNode<?>> successorsNodes = graphDag.successors(n); | ||
if (successorsNodes.size() == 0) { | ||
continue; |
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.
what's the need for changing this variable name?
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.
@liuml07 suggested preferring readability over more concise code in the issue.
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! Please address the comments below. I'll take one final pass after you address the comments.
Thank you for your contribution.
… into mantis-runtime-compile-warn-fix # Conflicts: # mantis-runtime/src/main/java/io/mantisrx/runtime/command/CreateZipFile.java # mantis-runtime/src/main/java/io/mantisrx/runtime/command/LoadValidateCreateDir.java # mantis-runtime/src/main/java/io/mantisrx/runtime/sink/ServerSentEventRequestHandler.java
Thank you. |
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.
Please address the last set of comments and feel free to push it.
import java.io.BufferedInputStream; | ||
import java.io.BufferedOutputStream; | ||
import java.io.File; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
import java.io.*; |
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.
Let's not use star imports.
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.
Updated.
@@ -129,7 +129,7 @@ public Observable<Void> handle(HttpServerRequest<ByteBuf> request, | |||
|
|||
// decouple the observable on a separate thread and add backpressure handling | |||
String decoupleSSE = "false";//ServiceRegistry.INSTANCE.getPropertiesService().getStringValue("sse.decouple", "false"); | |||
//Note: Below condition would be always false during if condition. | |||
//Todo Note: Below condition would be always false during if condition. |
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.
I think this is the syntax for a TODO comment. https://www.jetbrains.com/help/idea/using-todo.html
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.
Updated.
Context
Mantis Runtime Module update on the removing of the warnings fix. Refer issue #396
Below update includes Updating of the deprecated code to latest, changing to method reference from lambda, removing used import, generifying objects and updating javadoc of the methods.
Checklist
./gradlew build
compiles code correctly./gradlew test
passes all tests