jinxxxoid commented on PR #6398:
URL: https://github.com/apache/ignite-3/pull/6398#issuecomment-3208203950

   yep, the main purpose of this code snippet is to show how the user can run
   their scripts via our compute job
   bc we have a decent example of how to run your code implemented in a
   compute job, but not
   so clear example on how to run an external script, that’s why
   
   Daria Usova
   
   Technical Writer
   
   Georgia
   
   +995 555 248 170
   
   https://www.gridgain.com
   
   
   On Thu, 21 Aug 2025 at 01:37, Aleksandr Pakhomov ***@***.***>
   wrote:
   
   > ***@***.**** commented on this pull request.
   > ------------------------------
   >
   > In
   > 
examples/src/main/java/org/apache/ignite/example/code/deployment/CodeDeploymentExample.java
   > <https://github.com/apache/ignite-3/pull/6398#discussion_r2289354692>:
   >
   > > +        System.out.println("\nConnecting to server...");
   > +
   > +        try (IgniteClient client = IgniteClient.builder()
   > +                .addresses("127.0.0.1:10800")
   > +                .build()
   > +        ) {
   > +
   > +            System.out.println("\nConfiguring compute job...");
   > +
   > +            JobDescriptor<String, String> job = 
JobDescriptor.builder(MyJob.class)
   > +                    .units(new DeploymentUnit(DEPLOYMENT_UNIT_NAME, 
DEPLOYMENT_UNIT_VERSION))
   > +                    .resultClass(String.class)
   > +                    .build();
   > +
   > +            JobTarget target = 
JobTarget.anyNode(client.cluster().nodes());
   > +                System.out.println("\nExecuting compute job'" + "'...");
   >
   > formatting
   > ------------------------------
   >
   > In
   > examples/src/main/java/org/apache/ignite/example/code/deployment/MyJob.java
   > <https://github.com/apache/ignite-3/pull/6398#discussion_r2289360447>:
   >
   > > +import java.io.OutputStream;
   > +import org.apache.ignite.Ignite;
   > +import org.apache.ignite.compute.ComputeJob;
   > +import org.apache.ignite.compute.JobExecutionContext;
   > +
   > +import java.io.InputStream;
   > +import java.nio.charset.StandardCharsets;
   > +import java.util.concurrent.CompletableFuture;
   > +
   > +public class MyJob implements ComputeJob<String, String> {
   > +    @Override
   > +    public CompletableFuture<String> executeAsync(JobExecutionContext 
ctx, String arg) {
   > +        Ignite ignite = ctx.ignite();
   > +
   > +        /** Full path to the script we want to run */
   > +        final String resPath = 
"/org/apache/ignite/example/code/deployment/resources/script.sh";
   >
   > Im quite surprised by this example. Why do we show how to run an sh script
   > through out compute API? I mean can we make an example significantly
   > simpler just by running some plain java code? OR this is the main idea of
   > this example like "Look! You can run sh script on our servers!"
   >
   > —
   > Reply to this email directly, view it on GitHub
   > 
<https://github.com/apache/ignite-3/pull/6398#pullrequestreview-3138329708>,
   > or unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/BJOQUMPY3COZJ6KPY4D2BHD3OTTCLAVCNFSM6AAAAACDS3DVSKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTCMZYGMZDSNZQHA>
   > .
   > You are receiving this because you authored the thread.Message ID:
   > ***@***.***>
   >
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to