@Test public void testGetAllRunningArcs() throws Exception { List<ArcVO> allRunningArcs = storage.getAllRunningArcs(); assertEquals(0, allRunningArcs.size()); storage.addARC(arcFile1); storage.addARC(arcFile2); storage.setARCProperties(arcFile1, "1", ArchonConnector.ARC_STATE.RUNNING, 9); allRunningArcs = storage.getAllRunningArcs(); assertEquals(1, allRunningArcs.size()); }
public List<ArcVO> getAllRunningArcs() throws Exception{ PreparedStatement stmt = null; List<ArcVO> latestArcs = new ArrayList<ArcVO>(); try { stmt = connection.prepareStatement(selectAllRunningQuery); ResultSet rs = stmt.executeQuery(); while (rs.next()){ latestArcs.add(createArcVOFromRS(rs)); } return latestArcs; } catch (SQLException e) { log.error("SQL Exception in getAllRunningArcs:" + e.getMessage()); throw e; } finally { closeStatement(stmt); } }
ArchonStorage { public List<ArcVO> getAllRunningArcs() throws Exception{ PreparedStatement stmt = null; List<ArcVO> latestArcs = new ArrayList<ArcVO>(); try { stmt = connection.prepareStatement(selectAllRunningQuery); ResultSet rs = stmt.executeQuery(); while (rs.next()){ latestArcs.add(createArcVOFromRS(rs)); } return latestArcs; } catch (SQLException e) { log.error("SQL Exception in getAllRunningArcs:" + e.getMessage()); throw e; } finally { closeStatement(stmt); } } }
ArchonStorage { public List<ArcVO> getAllRunningArcs() throws Exception{ PreparedStatement stmt = null; List<ArcVO> latestArcs = new ArrayList<ArcVO>(); try { stmt = connection.prepareStatement(selectAllRunningQuery); ResultSet rs = stmt.executeQuery(); while (rs.next()){ latestArcs.add(createArcVOFromRS(rs)); } return latestArcs; } catch (SQLException e) { log.error("SQL Exception in getAllRunningArcs:" + e.getMessage()); throw e; } finally { closeStatement(stmt); } } ArchonStorage(); }
ArchonStorage { public List<ArcVO> getAllRunningArcs() throws Exception{ PreparedStatement stmt = null; List<ArcVO> latestArcs = new ArrayList<ArcVO>(); try { stmt = connection.prepareStatement(selectAllRunningQuery); ResultSet rs = stmt.executeQuery(); while (rs.next()){ latestArcs.add(createArcVOFromRS(rs)); } return latestArcs; } catch (SQLException e) { log.error("SQL Exception in getAllRunningArcs:" + e.getMessage()); throw e; } finally { closeStatement(stmt); } } ArchonStorage(); static void initialize(String driverName, String driverUrl, String userName, String password); int nextShardId(); void addARC(String arcPath); void addOrUpdateARC(String arcPath); List<String> getShardIDs(); String nextARC(String shardID); List<String> getARCFiles(String shardID); ArcVO getArcByID(String arcID); int getArcCount(); List<ArcVO> getLatest1000Arcs(); List<ArcVO> getAllRunningArcs(); void setARCState(String arcPath, ArchonConnector.ARC_STATE arcState); void setShardState(String shardID, ArchonConnector.ARC_STATE state, int priority); void setARCProperties(String fullPath, String shardID,ArchonConnector.ARC_STATE state, int priority); void setARCPriority(String fullPath, int priority); void resetArcWithPriorityStatement(String fullPath, int priority); void removeARC(String arcID); void clearIndexing(String shardID); void resetShardId(String shardID); void commit(); void rollback(); void close(); static void shutdown(); }
ArchonStorage { public List<ArcVO> getAllRunningArcs() throws Exception{ PreparedStatement stmt = null; List<ArcVO> latestArcs = new ArrayList<ArcVO>(); try { stmt = connection.prepareStatement(selectAllRunningQuery); ResultSet rs = stmt.executeQuery(); while (rs.next()){ latestArcs.add(createArcVOFromRS(rs)); } return latestArcs; } catch (SQLException e) { log.error("SQL Exception in getAllRunningArcs:" + e.getMessage()); throw e; } finally { closeStatement(stmt); } } ArchonStorage(); static void initialize(String driverName, String driverUrl, String userName, String password); int nextShardId(); void addARC(String arcPath); void addOrUpdateARC(String arcPath); List<String> getShardIDs(); String nextARC(String shardID); List<String> getARCFiles(String shardID); ArcVO getArcByID(String arcID); int getArcCount(); List<ArcVO> getLatest1000Arcs(); List<ArcVO> getAllRunningArcs(); void setARCState(String arcPath, ArchonConnector.ARC_STATE arcState); void setShardState(String shardID, ArchonConnector.ARC_STATE state, int priority); void setARCProperties(String fullPath, String shardID,ArchonConnector.ARC_STATE state, int priority); void setARCPriority(String fullPath, int priority); void resetArcWithPriorityStatement(String fullPath, int priority); void removeARC(String arcID); void clearIndexing(String shardID); void resetShardId(String shardID); void commit(); void rollback(); void close(); static void shutdown(); static Date INITDATE; }