public class PhoenixUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static PhoenixUtil |
create() |
static PhoenixUtil |
create(boolean testEnabled) |
void |
deleteTables(String regexMatch)
Delete existing tables with schema name set as
PherfConstants.PHERF_SCHEMA_NAME with regex comparison |
void |
executeQuerySetDdls(QuerySet querySet)
Execute all querySet DDLs first based on tenantId if specified.
|
void |
executeScenarioDdl(Scenario scenario)
Executes any ddl defined at the scenario level.
|
boolean |
executeStatement(PreparedStatement preparedStatement,
Connection connection) |
boolean |
executeStatement(String sql,
Connection connection) |
boolean |
executeStatement(String sql,
Scenario scenario) |
boolean |
executeStatementThrowException(String sql,
Connection connection)
Execute statement
|
List<Column> |
getColumnsFromPhoenix(String schemaName,
String tableName,
Connection connection) |
ResultSet |
getColumnsMetaData(String schemaName,
String tableName,
Connection connection) |
Connection |
getConnection() |
Connection |
getConnection(String tenantId) |
Connection |
getConnection(String tenantId,
boolean testEnabled,
Map<String,String> phoenixProperty) |
Connection |
getConnection(String tenantId,
Map<String,String> phoenixProperty) |
String |
getExplainPlan(Query query) |
String |
getExplainPlan(Query query,
Scenario scenario,
RulesApplier ruleApplier)
Get explain plan for a query
|
static String |
getQueryServerUrl() |
static int |
getRowCountOverride() |
ResultSet |
getTableMetaData(String schemaName,
String tableName,
Connection connection) |
static String |
getZookeeper() |
static boolean |
isThinDriver() |
static void |
setRowCountOverride(int rowCountOverride) |
static void |
setZookeeper(String zookeeper) |
void |
updatePhoenixStats(String tableName,
Scenario scenario)
Update Phoenix table stats
|
static void |
useThickDriver(String zookeeper) |
static void |
useThinDriver(String queryServerUrl) |
public static PhoenixUtil create()
public static PhoenixUtil create(boolean testEnabled)
public static void useThinDriver(String queryServerUrl)
public static String getQueryServerUrl()
public static boolean isThinDriver()
public Connection getConnection() throws Exception
Exceptionpublic Connection getConnection(String tenantId) throws Exception
Exceptionpublic Connection getConnection(String tenantId, Map<String,String> phoenixProperty) throws Exception
Exceptionpublic Connection getConnection(String tenantId, boolean testEnabled, Map<String,String> phoenixProperty) throws Exception
Exceptionpublic boolean executeStatement(String sql, Scenario scenario) throws Exception
Exceptionpublic boolean executeStatementThrowException(String sql, Connection connection) throws SQLException
sql - connection - SQLExceptionpublic boolean executeStatement(String sql, Connection connection) throws SQLException
SQLExceptionpublic boolean executeStatement(PreparedStatement preparedStatement, Connection connection)
public void deleteTables(String regexMatch) throws Exception
PherfConstants.PHERF_SCHEMA_NAME with regex comparisonregexMatch - SQLExceptionExceptionpublic ResultSet getTableMetaData(String schemaName, String tableName, Connection connection) throws SQLException
SQLExceptionpublic ResultSet getColumnsMetaData(String schemaName, String tableName, Connection connection) throws SQLException
SQLExceptionpublic List<Column> getColumnsFromPhoenix(String schemaName, String tableName, Connection connection) throws SQLException
SQLExceptionpublic void executeQuerySetDdls(QuerySet querySet) throws Exception
querySet - Exceptionpublic void executeScenarioDdl(Scenario scenario) throws Exception
Exceptionpublic static String getZookeeper()
public static void setZookeeper(String zookeeper)
public static void useThickDriver(String zookeeper)
public static int getRowCountOverride()
public static void setRowCountOverride(int rowCountOverride)
public void updatePhoenixStats(String tableName, Scenario scenario) throws Exception
tableName - Exceptionpublic String getExplainPlan(Query query) throws SQLException
SQLExceptionpublic String getExplainPlan(Query query, Scenario scenario, RulesApplier ruleApplier) throws SQLException
query - ruleApplier - scenario - SQLExceptionCopyright © 2018 Apache Software Foundation. All Rights Reserved.