ashishkumar50 commented on code in PR #8409: URL: https://github.com/apache/ozone/pull/8409#discussion_r2078860239
########## hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/logs/container/utils/ContainerDatanodeDatabase.java: ########## @@ -541,5 +541,69 @@ private List<DatanodeContainerInfo> getContainerLogData(Long containerID, Connec return logEntries; } + + private void createIdxContainerlogContainerId(Connection conn) throws SQLException { + String sql = SQLDBConstants.CREATE_CONTAINER_ID_INDEX; + try (Statement stmt = conn.createStatement()) { + stmt.execute(sql); + } + } + + public void findDuplicateOpenContainer() throws SQLException { + String sql = SQLDBConstants.SELECT_DISTINCT_CONTAINER_IDS_QUERY; + + try (Connection connection = getConnection()) { + + createIdxContainerlogContainerId(connection); Review Comment: Index has to be created here? It should be created during create DB itself. Otherwise when we run this command multiple times, we will try to create index everytime which is unnecessary(even though we are checking exists). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org