ClusterStatusServlet extends HttpServlet { public static long parseTimestampFromHdfsPath(String hdfsPath) { int index = hdfsPath.lastIndexOf('/'); if (index >= 0) { return Long.parseLong(hdfsPath.substring(index + 1)); } else { return Long.parseLong(hdfsPath); } }  static long parseTimestampFromHdfsPath(String hdfsPath); static List<FileSetStatusRow> getFileSetStatusTable(
      ZooKeeperManager zkManager, List<FileSetWithErrorRow> fileSetsWithError); static List<LoadingFileSetRow> getLoadingFileSetTable(
      ZooKeeperManager zkManager, List<FileSetWithErrorRow> fileSetsWithError); static List<String> getAllNodeNames(DFSClient hdfsClient); @Override void doGet(HttpServletRequest request, HttpServletResponse response); static final String BASE_URI; }
@Test public void testParseTimestampFromHdfsPath() { assertEquals(1234567890123l, ClusterStatusServlet.parseTimestampFromHdfsPath("/1234567890123")); assertEquals(1234567890123l, ClusterStatusServlet.parseTimestampFromHdfsPath("1234567890123")); assertEquals(1234567890123l, ClusterStatusServlet.parseTimestampFromHdfsPath("/a/b/1234567890123")); }