@Test public void testGetId01() { String path = "/urmia/1/hostname/jobs/32321-32312"; assertEquals("32321-32312", JobProcess.getId(path)); }
public static String getId(String path) { int index = path.lastIndexOf('/'); return isReduce(path) ? path.substring(index + 1, path.lastIndexOf('-')) : path.substring(index + 1); }
JobProcess implements Runnable { public static String getId(String path) { int index = path.lastIndexOf('/'); return isReduce(path) ? path.substring(index + 1, path.lastIndexOf('-')) : path.substring(index + 1); } }
JobProcess implements Runnable { public static String getId(String path) { int index = path.lastIndexOf('/'); return isReduce(path) ? path.substring(index + 1, path.lastIndexOf('-')) : path.substring(index + 1); } JobProcess(String hostId, CuratorFramework client, String zkPath, String mountPoint, NamingService ns); }
JobProcess implements Runnable { public static String getId(String path) { int index = path.lastIndexOf('/'); return isReduce(path) ? path.substring(index + 1, path.lastIndexOf('-')) : path.substring(index + 1); } JobProcess(String hostId, CuratorFramework client, String zkPath, String mountPoint, NamingService ns); static String getId(String path); @Override void run(); }
JobProcess implements Runnable { public static String getId(String path) { int index = path.lastIndexOf('/'); return isReduce(path) ? path.substring(index + 1, path.lastIndexOf('-')) : path.substring(index + 1); } JobProcess(String hostId, CuratorFramework client, String zkPath, String mountPoint, NamingService ns); static String getId(String path); @Override void run();  }