Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: How to run Kitchen programmatically without a repository.xml?

  1. #1

    Default How to run Kitchen programmatically without a repository.xml?

    I am currently doing the following. But it requires existance of a repository.xml file, which is a hassle to maintain in all different configurations. How to improve?

    public class KitchenRunner {

    private static Logger LOG = Logger.getLogger(KitchenRunner.class.getName());

    public static void main(String[] args) throws UnknownHostException, Exception {
    new KitchenRunner().run(new File("./datasync/kettle-home").getAbsoluteFile(), args[0], args[1], args[2]);
    }

    public void run(File kettleHome, String repoName, String dirName, String jobName) throws UnknownHostException, Exception {

    if(!kettleHome.isDirectory()) {
    throw new IOException("Directory not found: " + kettleHome.getAbsolutePath());
    }

    File kProp = new File(kettleHome,
    InetAddress.getLocalHost().getHostName() + "/.kettle/" + Const.KETTLE_PROPERTIES).getAbsoluteFile();

    LOG.info(Const.KETTLE_PROPERTIES + " = " + kProp.toString() + " exists=" + kProp.exists());
    String kh = kProp.getParentFile().getParent();
    System.setProperty("KETTLE_HOME", kh);
    System.setProperty(Const.PENTAHO_METASTORE_FOLDER, System.getProperty("java.io.tmpdir"));

    String cli = "/rep:" + repoName + "/dir:/" + dirName + "/job:" + jobName + " -level=Basic /param:n_threads=1";
    Kitchen.main(cli.split(" "));
    }

    }

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    If you don't have any love for the repository, why don't you just go with a file as is documented?
    So long, and thanks for all the fish.

  3. #3

    Default

    Thanks I will try this. I didn't notice it at first.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.