-
Notifications
You must be signed in to change notification settings - Fork 132
IGNITE-27212 - Complete automation for compute deployment unit; Minor bug fixes #7122
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
base: main
Are you sure you want to change the base?
Conversation
d32e518 to
ffcfa2b
Compare
| * High-priority job. | ||
| */ | ||
| private static class HighPriorityJob implements ComputeJob<Integer, String> { | ||
| public static class HighPriorityJob implements ComputeJob<Integer, String> { |
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 reason behind changing the visibility scope? Here and in all other implementations of ComputeJob.
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.
Made it public/static so Ignite can access and create the job class remotely without instantiation errors.
DeploymentUnit is not able to find these jobs unless we make it accessible remotely
| @@ -1,33 +1,28 @@ | |||
| /* | |||
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 keep the header with licensing info.
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.
Have added the licensing info back.
| } | ||
| } | ||
| } | ||
| } |
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.
No reason to change this file. Please revert it (keep existing newlines).
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.
Reverted to original.
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 revert the file completely.
examples/java/src/main/java/org/apache/ignite/example/compute/ComputeBroadcastExample.java
Outdated
Show resolved
Hide resolved
|
|
||
| System.out.println("\nConfiguring compute job..."); | ||
|
|
||
| // 1) Check if deployment unit already exists |
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 is step 2?
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.
Removing all comments as previously advised
|
|
||
| System.out.println("\nConfiguring compute job..."); | ||
|
|
||
| // 1) Check if deployment unit already exists |
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.
Same 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.
Removing all comments as previously advised
| Statement stmt = conn.createStatement() | ||
| ) { | ||
|
|
||
| stmt.executeUpdate("DROP TABLE IF EXISTS Person"); |
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 a bad practice, an example must not delete tables that it did not create.
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 received. Reverted unintended file addition - The file is being handled in a separate PR : #7103
| stmt.executeUpdate("DROP TABLE IF EXISTS Person"); | ||
|
|
||
| stmt.executeUpdate( | ||
| "CREATE TABLE IF NOT EXISTS Person (" |
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 we should avoid using IF NOT EXISTS/IF EXISTS if the table already exists - the example shouldn't work because the table schema might be different and we'll get confusing errors.
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 received. Reverted unintended file addition - The file is being handled in a separate PR : #7103
Deployment Unit - Complete automation and standardization of all examples containing Deployment Unit
Minor bug fixes to support complete automation.
Tested on : apacheignite/ignite:3.1.0
Repo : https://github.com/apache/ignite-3/tree/main/examples
Absolute Path of affected files :
examples/java/src/main/java/org/apache/ignite/example/compute/* – All files under compute
examples/java/src/main/java/org/apache/ignite/example/code/deployment/CodeDeploymentExample.java
examples/java/src/main/java/org/apache/ignite/example/serialization/SerializationExample.java
examples/java/src/main/java/org/apache/ignite/example/streaming/DistributedComputeWithReceiverExample.java
examples/java/src/main/java/org/apache/ignite/example/streaming/MultiTableDataStreamerExample.java
Sample Error :
Exception in thread "main" org.apache.ignite.compute.ComputeException: IGN-COMPUTE-9 Job execution failed: java.lang.ClassNotFoundException: org.apache.ignite.example.compute.ComputeColocatedExample$PrintAccountInfoJob. Deployment unit computeExampleUnit:1.0.0 doesn't exist TraceId:e232314f
Solution : Completely automated deployment unit dependent examples and made minor bug fixes to support the same