org.apache.lens.cli.commands
Class LensQueryCommands

java.lang.Object
  extended by org.apache.lens.cli.commands.BaseLensCommand
      extended by org.apache.lens.cli.commands.LensQueryCommands
All Implemented Interfaces:
org.springframework.shell.core.CommandMarker

@Component
public class LensQueryCommands
extends BaseLensCommand
implements org.springframework.shell.core.CommandMarker

The Class LensQueryCommands.


Field Summary
 
Fields inherited from class org.apache.lens.cli.commands.BaseLensCommand
LOG
 
Constructor Summary
LensQueryCommands()
           
 
Method Summary
 String destroyPreparedQuery(String ph)
          Destroy prepared query.
 String executePreparedQuery(String phandle, boolean asynch, String queryName)
          Execute prepared query.
 String executeQuery(String sql, boolean asynch, String queryName)
          Execute query.
 String explainAndPrepare(String sql, String queryName)
          Explain and prepare.
 String explainQuery(String sql, String location)
          Explain query.
 String getAllPreparedQueries(String userName, String queryName, long fromDate, long toDate)
          Gets the all prepared queries.
 String getAllQueries(String state, String queryName, String user, long fromDate, long toDate)
          Gets the all queries.
 String getPreparedStatus(String ph)
          Gets the prepared status.
 String getQueryResults(String qh)
          Gets the query results.
 String getStatus(String qh)
          Gets the status.
 String killQuery(String qh)
          Kill query.
 String prepare(String sql, String queryName)
          Prepare.
 
Methods inherited from class org.apache.lens.cli.commands.BaseLensCommand
formatJson, getClient, getClientWrapper, setClient
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LensQueryCommands

public LensQueryCommands()
Method Detail

executeQuery

public String executeQuery(String sql,
                           boolean asynch,
                           String queryName)
Execute query.

Parameters:
sql - the sql
asynch - the asynch
queryName - the query name
Returns:
the string

getStatus

public String getStatus(String qh)
Gets the status.

Parameters:
qh - the qh
Returns:
the status

explainQuery

public String explainQuery(String sql,
                           String location)
                    throws UnsupportedEncodingException
Explain query.

Parameters:
sql - the sql
location - the location
Returns:
the string
Throws:
UnsupportedEncodingException - the unsupported encoding exception

getAllQueries

public String getAllQueries(String state,
                            String queryName,
                            String user,
                            long fromDate,
                            long toDate)
Gets the all queries.

Parameters:
state - the state
queryName - the query name
user - the user
fromDate - the from date
toDate - the to date
Returns:
the all queries

killQuery

public String killQuery(String qh)
Kill query.

Parameters:
qh - the qh
Returns:
the string

getQueryResults

public String getQueryResults(String qh)
Gets the query results.

Parameters:
qh - the qh
Returns:
the query results

getAllPreparedQueries

public String getAllPreparedQueries(String userName,
                                    String queryName,
                                    long fromDate,
                                    long toDate)
Gets the all prepared queries.

Parameters:
userName - the user name
queryName - the query name
fromDate - the from date
toDate - the to date
Returns:
the all prepared queries

getPreparedStatus

public String getPreparedStatus(String ph)
Gets the prepared status.

Parameters:
ph - the ph
Returns:
the prepared status

destroyPreparedQuery

public String destroyPreparedQuery(String ph)
Destroy prepared query.

Parameters:
ph - the ph
Returns:
the string

executePreparedQuery

public String executePreparedQuery(String phandle,
                                   boolean asynch,
                                   String queryName)
Execute prepared query.

Parameters:
phandle - the phandle
asynch - the asynch
queryName - the query name
Returns:
the string

prepare

public String prepare(String sql,
                      String queryName)
               throws UnsupportedEncodingException
Prepare.

Parameters:
sql - the sql
queryName - the query name
Returns:
the string
Throws:
UnsupportedEncodingException - the unsupported encoding exception

explainAndPrepare

public String explainAndPrepare(String sql,
                                String queryName)
                         throws UnsupportedEncodingException
Explain and prepare.

Parameters:
sql - the sql
queryName - the query name
Returns:
the string
Throws:
UnsupportedEncodingException - the unsupported encoding exception


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