This project has retired. For details please refer to its Attic page.
LensServerDAO (Lens 2.0.1-beta-incubating API)

org.apache.lens.server.query
Class LensServerDAO

java.lang.Object
  extended by org.apache.lens.server.query.LensServerDAO

public class LensServerDAO
extends Object

Top level class which logs and retrieves finished query from Database.


Constructor Summary
LensServerDAO()
           
 
Method Summary
 void createFinishedQueriesTable()
          Method to create finished queries table, this is required for embedded lens server.
 void dropFinishedQueriesTable()
          Drop finished queries table.
 List<QueryHandle> findFinishedQueries(String state, String user, String queryName, long fromDate, long toDate)
          Find finished queries.
 Connection getConnection()
           
 FinishedLensQuery getQuery(String handle)
          Fetch Finished query from Database.
 void init(org.apache.hadoop.conf.Configuration conf)
          Inits the.
 void insertFinishedQuery(FinishedLensQuery query)
          DAO method to insert a new Finished query into Table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LensServerDAO

public LensServerDAO()
Method Detail

init

public void init(org.apache.hadoop.conf.Configuration conf)
Inits the.

Parameters:
conf - the conf

getConnection

public Connection getConnection()
                         throws SQLException
Throws:
SQLException

dropFinishedQueriesTable

public void dropFinishedQueriesTable()
Drop finished queries table.


createFinishedQueriesTable

public void createFinishedQueriesTable()
                                throws Exception
Method to create finished queries table, this is required for embedded lens server. For production server we will not be creating tables as it would be created upfront.

Throws:
Exception - the exception

insertFinishedQuery

public void insertFinishedQuery(FinishedLensQuery query)
                         throws Exception
DAO method to insert a new Finished query into Table.

Parameters:
query - to be inserted
Throws:
Exception - the exception

getQuery

public FinishedLensQuery getQuery(String handle)
Fetch Finished query from Database.

Parameters:
handle - to be fetched
Returns:
Finished query.

findFinishedQueries

public List<QueryHandle> findFinishedQueries(String state,
                                             String user,
                                             String queryName,
                                             long fromDate,
                                             long toDate)
                                      throws LensException
Find finished queries.

Parameters:
state - the state
user - the user
queryName - the query name
fromDate - the from date
toDate - the to date
Returns:
the list
Throws:
LensException - the lens exception


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.