简体   繁体   中英

Pentaho - Execute a Kettle Transformation remotely using Java

I am executing My Jobs/ Transformation using Java API and I am able to do it correctly in my host.

Now I am looking for a way to execute the transformation in remote host(where carte in running). Please help me or redirect me to the proper documentation where I find the classes to use to accomplish this.

PDI Version - 5.0.1

Currently I am executing my Job as below

  try {
        if(jobDetails.getGraphlocation()!=null)
        {
            KettleEnvironment.init();
            JobMeta jobMeta = new JobMeta(jobDetails.getGraphlocation(), null);

            for( String s : jobDetails.getArguments() )
            {
                String[] splitString = s.split("\\=");
                if(splitString.length==2)
                {
                    jobMeta.setParameterValue(splitString[0], splitString[1]);

                }
                else
                    System.err.println("Parameter should be of the form - name=value");
            }

            Job job = new Job(null, jobMeta);
            job.setLogLevel(LogLevel.valueOf(jobDetails.getLoglevel().toString()));

            job.start();
            job.waitUntilFinished();
            if (job.getErrors()!=0) {
                System.out.println("Error encountered!");
            }   
        }

The above code is able to execute the Job where ever I am running it. But I want to execute it in slave server by just passing the carte username,password ans server IP address.

you can do it through spoon by registering the carte server, or you can do it in a job by specifying the name and port of the carte server in the actual job/transformation step. ie you can create a launcher which just has start, job ( pointing at carte server ), success steps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM