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

Mantis runtime compile warn fix #468

Merged

Conversation

g1rjeevan
Copy link
Contributor

@g1rjeevan g1rjeevan commented Jun 29, 2023

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
  • Added new tests where applicable
  • ./gradlew test passes all tests
  • Extended README or added javadocs where applicable

@g1rjeevan g1rjeevan force-pushed the mantis-runtime-compile-warn-fix branch from db11f3c to 58853a9 Compare June 29, 2023 03:07
@g1rjeevan g1rjeevan had a problem deploying to Integrate Pull Request June 29, 2023 03:07 — with GitHub Actions Failure
Comment on lines 56 to 57
is.close();
Objects.requireNonNull(is).close();
Copy link
Collaborator

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()

Copy link
Contributor Author

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());
Copy link
Collaborator

@sundargates sundargates Jun 29, 2023

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Screenshot 2023-06-29 at 10 30 26 AM

Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the logger.

Comment on lines -148 to +149
if (runNewSseServerImpl(context.getWorkerInfo().getJobName())) {
if (runNewSseServerImpl(context.getWorkerInfo().getJobClusterName())) {
Copy link
Collaborator

@sundargates sundargates Jun 29, 2023

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getJobName() is deprecated and links to use getJobClusterName() , But both getJobName refers the same variable which is jobName string value.
Screenshot 2023-06-29 at 10 36 41 AM

@@ -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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a todo comment.

Copy link
Contributor Author

@g1rjeevan g1rjeevan Jun 29, 2023

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.

@github-actions
Copy link

github-actions bot commented Jun 29, 2023

Test Results

126 files  ±0  126 suites  ±0   6m 30s ⏱️ +36s
536 tests ±0  526 ✔️  - 1  8 💤 ±0  2 +1 
538 runs  +1  528 ✔️ ±0  8 💤 ±0  2 +1 

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.

Comment on lines +132 to 134
Set<OperandNode<?>> successorsNodes = graphDag.successors(n);
if (successorsNodes.size() == 0) {
continue;
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

@sundargates sundargates left a 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
@g1rjeevan g1rjeevan had a problem deploying to Integrate Pull Request June 29, 2023 08:15 — with GitHub Actions Failure
@g1rjeevan
Copy link
Contributor Author

LGTM! Please address the comments below. I'll take one final pass after you address the comments.

Thank you for your contribution.

Thank you.

Copy link
Collaborator

@sundargates sundargates left a 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.*;
Copy link
Collaborator

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.

Copy link
Contributor Author

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.
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@g1rjeevan g1rjeevan had a problem deploying to Integrate Pull Request June 29, 2023 16:30 — with GitHub Actions Failure
@g1rjeevan g1rjeevan had a problem deploying to Integrate Pull Request July 2, 2023 15:01 — with GitHub Actions Failure
@g1rjeevan g1rjeevan had a problem deploying to Integrate Pull Request July 2, 2023 15:01 — with GitHub Actions Failure
@sundargates sundargates merged commit 8053059 into Netflix:master Jul 9, 2023
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants