LuaContainerLaunchParameters implements ContainerLaunchParameters { public String toCommand(LuaWrapper table) { StringBuilder sb = new StringBuilder(table.getString(LuaFields.COMMAND_BASE)); if (!table.isNil(LuaFields.ARGS)) { LuaWrapper a = table.getTable(LuaFields.ARGS); Iterator<LuaPair> namedArgsIter = a.hashIterator(); while (namedArgsIter.hasNext()) { LuaPair lp = namedArgsIter.next(); sb.append(" "); sb.append(lp.key.tojstring()); sb.append("="); sb.append(lp.value.tojstring()); } Iterator<LuaPair> restIter = a.arrayIterator(); while (restIter.hasNext()) { sb.append(" "); sb.append(restIter.next().value.tojstring()); } } return sb.toString(); } LuaContainerLaunchParameters(LuaValue lv, Configuration conf, Map<String, URI> localFileUris);  LuaContainerLaunchParameters(LuaWrapper lv, Configuration conf, Map<String, URI> localFileUris);  LuaContainerLaunchParameters(LuaWrapper lv, Configuration conf,
      Map<String, URI> localFileUris, Extras extras); int getCores(); int getMemory(); @Override Resource getContainerResource(Resource clusterMax); @Override int getPriority(); @Override int getNumInstances(); @Override Map<String, LocalResource> getLocalResources(); @Override Map<String, String> getEnvironment(); @Override List<String> getCommands(); String toCommand(LuaWrapper table);  }
@Test public void testTableCommandCreation() { env.setString(LuaFields.COMMAND_BASE, "${JAVA_HOME}/bin/java -Xmx512M com.cloudera.kitten.test.Main"); LuaWrapper args = env.createTable(LuaFields.ARGS); args.setString("-Dmapred.jobtracker.url", "http: args.setBoolean("-Dmapred.compress.output", false); args.addString("bar"); assertEquals("${JAVA_HOME}/bin/java -Xmx512M com.cloudera.kitten.test.Main -Dmapred.compress.output=false -Dmapred.jobtracker.url=http: lclp.toCommand(env)); }