String[] programIdParts = args[0].split("\\.");
String appId = programIdParts[0];
String programId = programIdParts[1];
DistributedProgramLiveInfo liveInfo = programClient.getLiveInfo(appId, elementType.getProgramType(), programId);
new AsciiTable<DistributedProgramLiveInfo>(
new String[] { "app", "type", "id", "runtime", "yarn app id"},
Lists.newArrayList(liveInfo),
new RowMaker<DistributedProgramLiveInfo>() {
@Override
public Object[] makeRow(DistributedProgramLiveInfo object) {
return new Object[] { object.getApp(), object.getType(), object.getId(), object.getRuntime(),
object.getYarnAppId() };
}
}
).print(output);
if (liveInfo.getContainers() != null) {
new AsciiTable<Containers.ContainerInfo>(
new String[] { "containers", "instance", "host", "container", "memory", "virtual cores", "debug port" },
liveInfo.getContainers(),
new RowMaker<Containers.ContainerInfo>() {
@Override
public Object[] makeRow(Containers.ContainerInfo object) {
return new Object[] { "", object.getInstance(), object.getHost(), object.getContainer(), object.getMemory(),
object.getVirtualCores(), object.getDebugPort() };