public static void main(String[] args) throws Exception { if (args.length < 1) { System.out.println("Usage: " + MLRunner.class.getName() + " <ml-conf-dir>"); System.exit(-1); } String confDir = args[0]; LensMLClient client = new LensMLClient(new LensClient()); MLRunner runner = new MLRunner(); runner.init(client, confDir); runner.train(); System.out.println("Created the Model successfully. Output Table: " + runner.outputTable); } }
@BeforeTest public void setUp() throws Exception { super.setUp(); Hive hive = Hive.get(new HiveConf()); Database db = new Database(); db.setName(TEST_DB); hive.createDatabase(db, true); LensClientConfig lensClientConfig = new LensClientConfig(); lensClientConfig.setLensDatabase(TEST_DB); lensClientConfig.set(LensConfConstants.SERVER_BASE_URL, "http://localhost:" + getTestPort() + "/lensapi"); LensClient client = new LensClient(lensClientConfig); mlClient = new LensMLClient(client); }
@BeforeTest public void setUp() throws Exception { super.setUp(); Hive hive = Hive.get(new HiveConf()); Database db = new Database(); db.setName(TEST_DB); hive.createDatabase(db, true); LensClientConfig lensClientConfig = new LensClientConfig(); lensClientConfig.setLensDatabase(TEST_DB); lensClientConfig.set(LensConfConstants.SERVER_BASE_URL, "http://localhost:" + getTestPort() + "/lensapi"); LensClient client = new LensClient(lensClientConfig); mlClient = new LensMLClient(client); }