[ https://issues.apache.org/jira/browse/LENS-1546?focusedWorklogId=291187&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-291187 ]
ASF GitHub Bot logged work on LENS-1546: ---------------------------------------- Author: ASF GitHub Bot Created on: 08/Aug/19 11:31 Start Date: 08/Aug/19 11:31 Worklog Time Spent: 10m Work Description: RajashekharChoukimath commented on pull request #35: [LENS-1546] Prepared Query should come from DB after 10 minutes. URL: https://github.com/apache/lens/pull/35#discussion_r311986590 ########## File path: lens-server/src/main/java/org/apache/lens/server/query/LensServerDAO.java ########## @@ -868,4 +868,18 @@ public void insertPreparedQuery(PreparedQueryContext preparedQueryContext) throw DbUtils.closeQuietly(conn); } } + + public PreparedLensQuery getPreparedQuery(String handle) { + ResultSetHandler<PreparedLensQuery> rsh = new BeanHandler<>(PreparedLensQuery.class, + new BasicRowProcessor(new FinishedLensQueryBeanProcessor())); + String sql = "select * from prepared_queries where handle=?"; + QueryRunner runner = new QueryRunner(ds); + try { + PreparedLensQuery preparedLensQuery = runner.query(sql, rsh, handle); + return preparedLensQuery; + } catch (SQLException e) { Review comment: fixed it. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 291187) Time Spent: 50m (was: 40m) > Prepared Query should come from DB after few minutes > ---------------------------------------------------- > > Key: LENS-1546 > URL: https://issues.apache.org/jira/browse/LENS-1546 > Project: Apache Lens > Issue Type: Bug > Components: cube > Reporter: Rajashekhar > Assignee: Rajashekhar > Priority: Major > Time Spent: 50m > Remaining Estimate: 0h > > Prepared Queries were getting destroyed after 1 week, it was bloating the > memory(as in the new flow, we have 100K prepared queries/day), we had to > restart Lens every 12 hours. > I changed the flow: > # Prepared Query should come from Memory for first 10 minutes. In the old > flow it was in memory for 1 week. > # After that PreparedQuery will get destroyed(old flow) > # After 10 minutes, it should come from DB. -- This message was sent by Atlassian JIRA (v7.6.14#76016)