public class PhoenixUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ASYNC_KEYWORD |
static com.google.gson.Gson |
GSON |
| Modifier and Type | Method and Description |
|---|---|
String |
buildSql(List<Column> columns,
String tableName) |
PreparedStatement |
buildStatement(RulesApplier rulesApplier,
Scenario scenario,
List<Column> columns,
PreparedStatement statement,
SimpleDateFormat simpleDateFormat) |
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 |
dropChildView(org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment taskRegionEnvironment,
int depth) |
void |
executeQuerySetDdls(QuerySet querySet)
Execute all querySet DDLs first based on tenantId if specified.
|
void |
executeScenarioDdl(List<Ddl> ddls,
String tenantId,
DataLoadTimeSummary dataLoadTimeSummary)
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> propertyHashMap) |
Connection |
getConnection(String tenantId,
Map<String,String> propertyHashMap) |
Connection |
getConnection(String tenantId,
Properties properties) |
String |
getExplainPlan(Query query) |
String |
getExplainPlan(Query query,
Scenario scenario,
RulesApplier ruleApplier)
Get explain plan for a query
|
static com.google.gson.Gson |
getGSON() |
static String |
getQueryServerUrl() |
org.apache.hadoop.hbase.util.Pair<Long,Long> |
getResults(Query query,
ResultSet rs,
String queryIteration,
boolean isSelectCountStatement,
Long queryStartTime) |
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) |
void |
waitForAsyncIndexToFinish(String tableName)
Waits for ASYNC index to build
|
public static final String ASYNC_KEYWORD
public static final com.google.gson.Gson GSON
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 static com.google.gson.Gson getGSON()
public Connection getConnection() throws Exception
Exceptionpublic Connection getConnection(String tenantId) throws Exception
Exceptionpublic Connection getConnection(String tenantId, Properties properties) throws Exception
Exceptionpublic Connection getConnection(String tenantId, Map<String,String> propertyHashMap) throws Exception
Exceptionpublic Connection getConnection(String tenantId, boolean testEnabled, Map<String,String> propertyHashMap) 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 void dropChildView(org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment taskRegionEnvironment, int depth)
public 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(List<Ddl> ddls, String tenantId, DataLoadTimeSummary dataLoadTimeSummary) throws Exception
Exceptionpublic void waitForAsyncIndexToFinish(String tableName) throws InterruptedException
tableName - InterruptedExceptionpublic 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 - SQLExceptionpublic PreparedStatement buildStatement(RulesApplier rulesApplier, Scenario scenario, List<Column> columns, PreparedStatement statement, SimpleDateFormat simpleDateFormat) throws Exception
ExceptionCopyright © 2022 Apache Software Foundation. All rights reserved.