public class ConnectionQueryServicesImpl extends DelegateQueryServices implements ConnectionQueryServices
ConnectionQueryServices.Feature
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.conf.Configuration |
config |
protected PhoenixEmbeddedDriver.ConnectionInfo |
connectionInfo |
static byte[] |
UPGRADE_MUTEX |
static byte[] |
UPGRADE_MUTEX_LOCKED |
static byte[] |
UPGRADE_MUTEX_UNLOCKED |
INITIAL_META_DATA_TABLE_CAPACITY
AGGREGATE_CHUNK_SIZE_INCREASE_ATTRIB, ALLOW_LOCAL_INDEX_ATTRIB, ALLOW_ONLINE_TABLE_SCHEMA_UPDATE, ALLOW_USER_DEFINED_FUNCTIONS_ATTRIB, ALLOW_VIEWS_ADD_NEW_CF_BASE_TABLE, AUTO_COMMIT_ATTRIB, AUTO_FLUSH_ATTRIB, AUTO_UPGRADE_ENABLED, AUTO_UPGRADE_WHITELIST_ATTRIB, CALL_QUEUE_PRODUCER_ATTRIB_NAME, CALL_QUEUE_ROUND_ROBIN_ATTRIB, CLIENT_CACHE_ENCODING, CLIENT_CONNECTION_CACHE_MAX_DURATION_MILLISECONDS, CLIENT_CONNECTION_MAX_ALLOWED_CONNECTIONS, CLOCK_SKEW_INTERVAL_ATTRIB, COLLECT_REQUEST_LEVEL_METRICS, COMMIT_STATS_ASYNC, CONSISTENCY_ATTRIB, COPROCESSOR_PRIORITY_ATTRIB, COST_BASED_OPTIMIZER_ENABLED, DATE_FORMAT_ATTRIB, DATE_FORMAT_TIMEZONE_ATTRIB, DEFAULT_COLUMN_ENCODED_BYTES_ATRRIB, DEFAULT_IMMUTABLE_STORAGE_SCHEME_ATTRIB, DEFAULT_MULTITENANT_IMMUTABLE_STORAGE_SCHEME_ATTRIB, DEFAULT_STORE_NULLS_ATTRIB, DEFAULT_SYSTEM_KEEP_DELETED_CELLS_ATTRIB, DEFAULT_SYSTEM_MAX_VERSIONS_ATTRIB, DEFAULT_TABLE_ISTRANSACTIONAL_ATTRIB, DEFAULT_TRANSACTION_PROVIDER_ATTRIB, DEFAULT_UPDATE_CACHE_FREQUENCY_ATRRIB, DELAY_FOR_SCHEMA_UPDATE_CHECK, DISTINCT_VALUE_COMPRESS_THRESHOLD_ATTRIB, DRIVER_SHUTDOWN_TIMEOUT_MS, DROP_METADATA_ATTRIB, DYNAMIC_JARS_DIR_KEY, ENABLE_SERVER_UPSERT_SELECT, EXPLAIN_CHUNK_COUNT_ATTRIB, EXPLAIN_ROW_COUNT_ATTRIB, EXTRA_JDBC_ARGUMENTS_ATTRIB, FORCE_ROW_KEY_ORDER_ATTRIB, GLOBAL_METRICS_ENABLED, GROUPBY_ESTIMATED_DISTINCT_VALUES_ATTRIB, GROUPBY_MAX_CACHE_SIZE_ATTRIB, GROUPBY_SPILL_FILES_ATTRIB, GROUPBY_SPILLABLE_ATTRIB, HBASE_CLIENT_KEYTAB, HBASE_CLIENT_PRINCIPAL, HBASE_CLIENT_SCANNER_TIMEOUT_ATTRIB, HCONNECTION_POOL_CORE_SIZE, HCONNECTION_POOL_MAX_SIZE, HTABLE_MAX_THREADS, IMMUTABLE_ROWS_ATTRIB, INDEX_ASYNC_BUILD_ENABLED, INDEX_FAILURE_BLOCK_WRITE, INDEX_FAILURE_DISABLE_INDEX, INDEX_FAILURE_HANDLING_REBUILD_ATTRIB, INDEX_FAILURE_HANDLING_REBUILD_INTERVAL_ATTRIB, INDEX_FAILURE_HANDLING_REBUILD_NUMBER_OF_BATCHES_PER_TABLE, INDEX_FAILURE_HANDLING_REBUILD_OVERLAP_BACKWARD_TIME_ATTRIB, INDEX_FAILURE_HANDLING_REBUILD_OVERLAP_FORWARD_TIME_ATTRIB, INDEX_FAILURE_HANDLING_REBUILD_OVERLAP_TIME_ATTRIB, INDEX_FAILURE_HANDLING_REBUILD_PERIOD, INDEX_FAILURE_KILL_SERVER, INDEX_FAILURE_THROW_EXCEPTION_ATTRIB, INDEX_HANDLER_COUNT_ATTRIB, INDEX_MUTATE_BATCH_SIZE_THRESHOLD_ATTRIB, INDEX_PENDING_DISABLE_THRESHOLD, INDEX_POPULATION_SLEEP_TIME, INDEX_PRIOIRTY_ATTRIB, INDEX_REBUILD_CLIENT_SCANNER_TIMEOUT_ATTRIB, INDEX_REBUILD_DISABLE_TIMESTAMP_THRESHOLD, INDEX_REBUILD_QUERY_TIMEOUT_ATTRIB, INDEX_REBUILD_RPC_RETRIES_COUNTER, INDEX_REBUILD_RPC_RETRY_PAUSE_TIME, INDEX_REBUILD_RPC_TIMEOUT_ATTRIB, INDEX_REBUILD_TASK_INITIAL_DELAY, IS_NAMESPACE_MAPPING_ENABLED, IS_SYSTEM_TABLE_MAPPED_TO_NAMESPACE, KEEP_ALIVE_MS_ATTRIB, LIMITED_QUERY_SERIAL_THRESHOLD, LOCAL_INDEX_CLIENT_UPGRADE_ATTRIB, LOG_BUFFER_SIZE, LOG_BUFFER_WAIT_STRATEGY, LOG_LEVEL, LOG_SALT_BUCKETS_ATTRIB, LOG_SAMPLE_RATE, MASTER_INFO_PORT_ATTRIB, MAX_CLIENT_METADATA_CACHE_SIZE_ATTRIB, MAX_INDEXES_PER_TABLE, MAX_MEMORY_PERC_ATTRIB, MAX_MEMORY_SIZE_ATTRIB, MAX_MUTATION_SIZE_ATTRIB, MAX_MUTATION_SIZE_BYTES_ATTRIB, MAX_SERVER_CACHE_SIZE_ATTRIB, MAX_SERVER_CACHE_TIME_TO_LIVE_MS_ATTRIB, MAX_SERVER_METADATA_CACHE_SIZE_ATTRIB, MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS_ATTRIB, MAX_SPOOL_TO_DISK_BYTES_ATTRIB, MAX_TENANT_MEMORY_PERC_ATTRIB, MAX_VERSIONS_TRANSACTIONAL_ATTRIB, METADATA_HANDLER_COUNT_ATTRIB, METADATA_PRIOIRTY_ATTRIB, METADATA_WRITE_RETRIES_NUMBER, METADATA_WRITE_RETRY_PAUSE, MIN_STATS_UPDATE_FREQ_MS_ATTRIB, MUTATE_BATCH_SIZE_ATTRIB, MUTATE_BATCH_SIZE_BYTES_ATTRIB, NUM_RETRIES_FOR_SCHEMA_UPDATE_CHECK, NUMBER_FORMAT_ATTRIB, PHOENIX_ACLS_ENABLED, PHOENIX_QUERY_SERVER_CLUSTER_BASE_PATH, PHOENIX_QUERY_SERVER_LOADBALANCER_ENABLED, PHOENIX_QUERY_SERVER_SERVICE_NAME, PHOENIX_QUERY_SERVER_ZK_ACL_PASSWORD, PHOENIX_QUERY_SERVER_ZK_ACL_USERNAME, PROPERTY_POLICY_PROVIDER_ENABLED, QUERY_SERVER_CUSTOM_AUTH_ENABLED, QUERY_SERVER_CUSTOMIZERS_ENABLED, QUERY_SERVER_DISABLE_KERBEROS_LOGIN, QUERY_SERVER_DNS_INTERFACE_ATTRIB, QUERY_SERVER_DNS_NAMESERVER_ATTRIB, QUERY_SERVER_ENV_LOGGING_ATTRIB, QUERY_SERVER_ENV_LOGGING_SKIPWORDS_ATTRIB, QUERY_SERVER_HBASE_SECURITY_CONF_ATTRIB, QUERY_SERVER_HTTP_KEYTAB_FILENAME_ATTRIB, QUERY_SERVER_HTTP_PORT_ATTRIB, QUERY_SERVER_KERBEROS_ALLOWED_REALMS, QUERY_SERVER_KERBEROS_HTTP_PRINCIPAL_ATTRIB, QUERY_SERVER_KERBEROS_HTTP_PRINCIPAL_ATTRIB_LEGACY, QUERY_SERVER_KERBEROS_PRINCIPAL_ATTRIB, QUERY_SERVER_KEYTAB_FILENAME_ATTRIB, QUERY_SERVER_META_FACTORY_ATTRIB, QUERY_SERVER_REMOTEUSEREXTRACTOR_PARAM, QUERY_SERVER_SERIALIZATION_ATTRIB, QUERY_SERVER_SPNEGO_AUTH_DISABLED_ATTRIB, QUERY_SERVER_UGI_CACHE_CONCURRENCY, QUERY_SERVER_UGI_CACHE_INITIAL_SIZE, QUERY_SERVER_UGI_CACHE_MAX_SIZE, QUERY_SERVER_WITH_REMOTEUSEREXTRACTOR_ATTRIB, QUEUE_SIZE_ATTRIB, REGIONSERVER_INFO_PORT_ATTRIB, RENEW_LEASE_ENABLED, RENEW_LEASE_THREAD_POOL_SIZE, RENEW_LEASE_THRESHOLD_MILLISECONDS, RETURN_SEQUENCE_VALUES_ATTRIB, ROW_KEY_ORDER_SALTED_TABLE_ATTRIB, RPC_TIMEOUT_ATTRIB, RUN_RENEW_LEASE_FREQUENCY_INTERVAL_MILLISECONDS, RUN_UPDATE_STATS_ASYNC, SCAN_CACHE_SIZE_ATTRIB, SCAN_RESULT_CHUNK_SIZE, SCHEMA_ATTRIB, SEQUENCE_CACHE_SIZE_ATTRIB, SEQUENCE_SALT_BUCKETS_ATTRIB, SMALL_SCAN_THRESHOLD_ATTRIB, SPOOL_DIRECTORY, SPOOL_THRESHOLD_BYTES_ATTRIB, STATS_COLLECTION_ENABLED, STATS_ENABLED_ATTRIB, STATS_GUIDEPOST_PER_REGION_ATTRIB, STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, STATS_MAX_CACHE_SIZE, STATS_SERVER_POOL_SIZE, STATS_UPDATE_FREQ_MS_ATTRIB, STATS_USE_CURRENT_TIME_ATTRIB, THREAD_POOL_SIZE_ATTRIB, THREAD_TIMEOUT_MS_ATTRIB, TIME_FORMAT_ATTRIB, TIMESTAMP_FORMAT_ATTRIB, TRACING_BATCH_SIZE, TRACING_CUSTOM_ANNOTATION_ATTRIB_PREFIX, TRACING_ENABLED, TRACING_FREQ_ATTRIB, TRACING_PAGE_SIZE_ATTRIB, TRACING_PROBABILITY_THRESHOLD_ATTRIB, TRACING_STATS_TABLE_NAME_ATTRIB, TRACING_THREAD_POOL_SIZE, TRACING_TRACE_BUFFER_SIZE, TRANSACTIONS_ENABLED, UPLOAD_BINARY_DATA_TYPE_ENCODING, USE_BYTE_BASED_REGEX_ATTRIB, USE_INDEXES_ATTRIB, USE_REVERSE_SCAN_ATTRIB, USE_STATS_FOR_PARALLELIZATION, ZOOKEEPER_PORT_ATTRIB, ZOOKEEPER_QUORUM_ATTRIB, ZOOKEEPER_ROOT_NODE_ATTRIB
Constructor and Description |
---|
ConnectionQueryServicesImpl(QueryServices services,
PhoenixEmbeddedDriver.ConnectionInfo connectionInfo,
Properties info)
Construct a ConnectionQueryServicesImpl that represents a connection to an HBase
cluster.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acquireUpgradeMutex(long currentServerSideTableTimestamp,
byte[] rowToLock)
Acquire distributed mutex of sorts to make sure only one JVM is able to run the upgrade code by
making use of HBase's checkAndPut api.
|
MetaDataProtocol.MetaDataMutationResult |
addColumn(List<Mutation> tableMetaData,
PTable table,
Map<String,List<Pair<String,Object>>> stmtProperties,
Set<String> colFamiliesForPColumnsToBeAdded,
List<PColumn> columns) |
void |
addConnection(PhoenixConnection connection) |
void |
addFunction(PFunction function) |
void |
addSchema(PSchema schema) |
void |
addTable(PTable table,
long resolvedTime) |
void |
addTableStats(GuidePostsKey key,
GuidePostsInfo info)
Manually adds
GuidePostsInfo for a table to the client-side cache. |
long |
clearCache()
Clears the Phoenix meta data cache on each region server
|
void |
clearTableFromCache(byte[] tenantId,
byte[] schemaName,
byte[] tableName,
long clientTS) |
void |
clearTableRegionCache(byte[] tableName) |
void |
close()
Closes the underlying connection to zookeeper.
|
PhoenixConnection |
connect(String url,
Properties info) |
MetaDataProtocol.MetaDataMutationResult |
createFunction(List<Mutation> functionData,
PFunction function,
boolean temporary) |
MetaDataProtocol.MetaDataMutationResult |
createSchema(List<Mutation> schemaMutations,
String schemaName) |
long |
createSequence(String tenantId,
String schemaName,
String sequenceName,
long startWith,
long incrementBy,
long cacheSize,
long minValue,
long maxValue,
boolean cycle,
long timestamp) |
MetaDataProtocol.MetaDataMutationResult |
createTable(List<Mutation> tableMetaData,
byte[] physicalTableName,
PTableType tableType,
Map<String,Object> tableProps,
List<Pair<byte[],Map<String,Object>>> families,
byte[][] splits,
boolean isNamespaceMapped,
boolean allocateIndexId,
boolean isDoNotUpgradePropSet) |
long |
currentSequenceValue(SequenceKey sequenceKey,
long timestamp)
Gets the current sequence value
|
MetaDataProtocol.MetaDataMutationResult |
dropColumn(List<Mutation> tableMetaData,
PTableType tableType) |
MetaDataProtocol.MetaDataMutationResult |
dropFunction(List<Mutation> functionData,
boolean ifExists) |
MetaDataProtocol.MetaDataMutationResult |
dropSchema(List<Mutation> schemaMetaData,
String schemaName) |
long |
dropSequence(String tenantId,
String schemaName,
String sequenceName,
long timestamp) |
MetaDataProtocol.MetaDataMutationResult |
dropTable(List<Mutation> tableMetaData,
PTableType tableType,
boolean cascade) |
HBaseAdmin |
getAdmin() |
List<HRegionLocation> |
getAllTableRegions(byte[] tableName) |
List<LinkedBlockingQueue<WeakReference<PhoenixConnection>>> |
getCachedConnections() |
ConnectionQueryServices |
getChildQueryServices(ImmutableBytesWritable tenantId)
Get (and create if necessary) a child QueryService for a given tenantId.
|
org.apache.hadoop.conf.Configuration |
getConfiguration() |
MetaDataProtocol.MetaDataMutationResult |
getFunctions(PName tenantId,
List<Pair<byte[],Long>> functions,
long clientTimestamp) |
protected String |
getFunctionTableDDL() |
KeyValueBuilder |
getKeyValueBuilder() |
protected String |
getLogTableDDL() |
int |
getLowestClusterHBaseVersion() |
ReadOnlyProps |
getProps()
Get the properties from the HBase configuration in a
read-only structure that avoids any synchronization
|
QueryLoggerDisruptor |
getQueryDisruptor() |
long |
getRenewLeaseThresholdMilliSeconds() |
MetaDataProtocol.MetaDataMutationResult |
getSchema(String schemaName,
long clientTimestamp) |
int |
getSequenceSaltBuckets() |
protected String |
getSystemCatalogTableDDL() |
protected String |
getSystemSequenceTableDDL(int nSaltBuckets) |
protected long |
getSystemTableVersion() |
HTableInterface |
getTable(byte[] tableName)
Get an HTableInterface by the given name.
|
MetaDataProtocol.MetaDataMutationResult |
getTable(PName tenantId,
byte[] schemaBytes,
byte[] tableBytes,
long tableTimestamp,
long clientTimestamp) |
HTableDescriptor |
getTableDescriptor(byte[] tableName) |
HRegionLocation |
getTableRegionLocation(byte[] tableName,
byte[] row) |
GuidePostsInfo |
getTableStats(GuidePostsKey key) |
User |
getUser() |
String |
getUserName() |
boolean |
hasIndexWALCodec() |
void |
incrementSequences(List<SequenceAllocation> sequenceAllocations,
long timestamp,
long[] values,
SQLException[] exceptions)
Increment any of the set of sequences that need more values.
|
void |
init(String url,
Properties props) |
PhoenixTransactionClient |
initTransactionClient(TransactionFactory.Provider provider) |
void |
invalidateStats(GuidePostsKey key)
Removes cache
GuidePostsInfo for the table with the given name. |
protected boolean |
isInitialized() |
boolean |
isRenewingLeasesEnabled() |
boolean |
isUpgradeRequired() |
protected ConnectionQueryServices |
newChildQueryService() |
boolean |
releaseUpgradeMutex(byte[] mutexRowKey) |
void |
removeColumn(PName tenantId,
String tableName,
List<PColumn> columnsToRemove,
long tableTimeStamp,
long tableSeqNum,
long resolvedTime) |
void |
removeConnection(PhoenixConnection connection) |
void |
removeFunction(PName tenantId,
String function,
long functionTimeStamp) |
void |
removeSchema(PSchema schema,
long schemaTimeStamp) |
void |
removeTable(PName tenantId,
String tableName,
String parentTableName,
long tableTimeStamp) |
void |
returnSequences(List<SequenceKey> keys,
long timestamp,
SQLException[] exceptions) |
protected void |
setInitialized(boolean isInitialized) |
protected void |
setUpgradeRequired() |
boolean |
supportsFeature(ConnectionQueryServices.Feature feature) |
MutationState |
updateData(MutationPlan plan) |
MetaDataProtocol.MetaDataMutationResult |
updateIndexState(List<Mutation> tableMetaData,
String parentTableName) |
MetaDataProtocol.MetaDataMutationResult |
updateIndexState(List<Mutation> tableMetaData,
String parentTableName,
Map<String,List<Pair<String,Object>>> stmtProperties,
PTable table) |
void |
updateResolvedTimestamp(PTable table,
long resolvedTime) |
protected PhoenixConnection |
upgradeSystemCatalogIfRequired(PhoenixConnection metaConnection,
long currentServerSideTableTimeStamp)
Upgrade the SYSCAT schema if required
|
void |
upgradeSystemTables(String url,
Properties props)
There is no other locking needed here since only one connection (on the same or different JVM) will be able to
acquire the upgrade mutex via
acquireUpgradeMutex(long, byte[]) . |
void |
validateSequences(List<SequenceAllocation> sequenceAllocations,
long timestamp,
long[] values,
SQLException[] exceptions,
Sequence.ValueOp action)
Verifies that sequences exist and reserves values for them if reserveValues is true
|
getDelegate, getExecutor, getMemoryManager, getOptimizer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExecutor, getMemoryManager, getOptimizer
protected final org.apache.hadoop.conf.Configuration config
protected final PhoenixEmbeddedDriver.ConnectionInfo connectionInfo
public static final byte[] UPGRADE_MUTEX
public static final byte[] UPGRADE_MUTEX_LOCKED
public static final byte[] UPGRADE_MUTEX_UNLOCKED
public ConnectionQueryServicesImpl(QueryServices services, PhoenixEmbeddedDriver.ConnectionInfo connectionInfo, Properties info)
services
- base services from where we derive our default configurationconnectionInfo
- to provide connection informationinfo
- hbase configuration propertiesSQLException
public HTableInterface getTable(byte[] tableName) throws SQLException
ConnectionQueryServices
getTable
in interface ConnectionQueryServices
tableName
- the name of the HTableSQLException
public HTableDescriptor getTableDescriptor(byte[] tableName) throws SQLException
getTableDescriptor
in interface ConnectionQueryServices
SQLException
public ReadOnlyProps getProps()
QueryServices
getProps
in interface QueryServices
getProps
in class DelegateQueryServices
public void close() throws SQLException
close
in interface SQLCloseable
close
in class DelegateQueryServices
SQLException
protected ConnectionQueryServices newChildQueryService()
public ConnectionQueryServices getChildQueryServices(ImmutableBytesWritable tenantId)
getChildQueryServices
in interface ConnectionQueryServices
tenantId
- the tenant IDpublic void clearTableRegionCache(byte[] tableName) throws SQLException
clearTableRegionCache
in interface ConnectionQueryServices
SQLException
public List<HRegionLocation> getAllTableRegions(byte[] tableName) throws SQLException
getAllTableRegions
in interface ConnectionQueryServices
SQLException
public void addTable(PTable table, long resolvedTime) throws SQLException
addTable
in interface MetaDataMutated
SQLException
public void updateResolvedTimestamp(PTable table, long resolvedTime) throws SQLException
updateResolvedTimestamp
in interface MetaDataMutated
SQLException
public void removeTable(PName tenantId, String tableName, String parentTableName, long tableTimeStamp) throws SQLException
removeTable
in interface MetaDataMutated
SQLException
public void removeColumn(PName tenantId, String tableName, List<PColumn> columnsToRemove, long tableTimeStamp, long tableSeqNum, long resolvedTime) throws SQLException
removeColumn
in interface MetaDataMutated
SQLException
public PhoenixConnection connect(String url, Properties info) throws SQLException
connect
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult createTable(List<Mutation> tableMetaData, byte[] physicalTableName, PTableType tableType, Map<String,Object> tableProps, List<Pair<byte[],Map<String,Object>>> families, byte[][] splits, boolean isNamespaceMapped, boolean allocateIndexId, boolean isDoNotUpgradePropSet) throws SQLException
createTable
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult getTable(PName tenantId, byte[] schemaBytes, byte[] tableBytes, long tableTimestamp, long clientTimestamp) throws SQLException
getTable
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult dropTable(List<Mutation> tableMetaData, PTableType tableType, boolean cascade) throws SQLException
dropTable
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult dropFunction(List<Mutation> functionData, boolean ifExists) throws SQLException
dropFunction
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult addColumn(List<Mutation> tableMetaData, PTable table, Map<String,List<Pair<String,Object>>> stmtProperties, Set<String> colFamiliesForPColumnsToBeAdded, List<PColumn> columns) throws SQLException
addColumn
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult dropColumn(List<Mutation> tableMetaData, PTableType tableType) throws SQLException
dropColumn
in interface ConnectionQueryServices
SQLException
protected long getSystemTableVersion()
protected void setUpgradeRequired()
protected boolean isInitialized()
protected void setInitialized(boolean isInitialized)
protected String getSystemCatalogTableDDL()
protected String getSystemSequenceTableDDL(int nSaltBuckets)
protected String getFunctionTableDDL()
protected String getLogTableDDL()
public void init(String url, Properties props) throws SQLException
init
in interface ConnectionQueryServices
SQLException
protected PhoenixConnection upgradeSystemCatalogIfRequired(PhoenixConnection metaConnection, long currentServerSideTableTimeStamp) throws SQLException, IOException, TimeoutException, InterruptedException
metaConnection
- currentServerSideTableTimeStamp
- SQLException
IOException
TimeoutException
InterruptedException
public void upgradeSystemTables(String url, Properties props) throws SQLException
acquireUpgradeMutex(long, byte[])
.upgradeSystemTables
in interface ConnectionQueryServices
SQLException
public boolean acquireUpgradeMutex(long currentServerSideTableTimestamp, byte[] rowToLock) throws IOException, SQLException
IOException
SQLException
public boolean releaseUpgradeMutex(byte[] mutexRowKey) throws IOException, SQLException
IOException
SQLException
public MutationState updateData(MutationPlan plan) throws SQLException
updateData
in interface ConnectionQueryServices
SQLException
public int getLowestClusterHBaseVersion()
getLowestClusterHBaseVersion
in interface ConnectionQueryServices
public boolean hasIndexWALCodec()
hasIndexWALCodec
in interface ConnectionQueryServices
public long clearCache() throws SQLException
clearCache
in interface ConnectionQueryServices
SQLException
public HBaseAdmin getAdmin() throws SQLException
getAdmin
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult updateIndexState(List<Mutation> tableMetaData, String parentTableName) throws SQLException
updateIndexState
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult updateIndexState(List<Mutation> tableMetaData, String parentTableName, Map<String,List<Pair<String,Object>>> stmtProperties, PTable table) throws SQLException
updateIndexState
in interface ConnectionQueryServices
SQLException
public long createSequence(String tenantId, String schemaName, String sequenceName, long startWith, long incrementBy, long cacheSize, long minValue, long maxValue, boolean cycle, long timestamp) throws SQLException
createSequence
in interface ConnectionQueryServices
SQLException
public long dropSequence(String tenantId, String schemaName, String sequenceName, long timestamp) throws SQLException
dropSequence
in interface ConnectionQueryServices
SQLException
public long currentSequenceValue(SequenceKey sequenceKey, long timestamp) throws SQLException
currentSequenceValue
in interface ConnectionQueryServices
SQLException
- if cached sequence cannot be foundpublic void validateSequences(List<SequenceAllocation> sequenceAllocations, long timestamp, long[] values, SQLException[] exceptions, Sequence.ValueOp action) throws SQLException
validateSequences
in interface ConnectionQueryServices
SQLException
public void incrementSequences(List<SequenceAllocation> sequenceAllocations, long timestamp, long[] values, SQLException[] exceptions) throws SQLException
incrementSequences
in interface ConnectionQueryServices
sequenceKeys
- sorted list of sequence kyestimestamp
- SQLException
- if any of the sequences cannot be foundpublic void clearTableFromCache(byte[] tenantId, byte[] schemaName, byte[] tableName, long clientTS) throws SQLException
clearTableFromCache
in interface ConnectionQueryServices
SQLException
public void returnSequences(List<SequenceKey> keys, long timestamp, SQLException[] exceptions) throws SQLException
returnSequences
in interface ConnectionQueryServices
SQLException
public void addConnection(PhoenixConnection connection) throws SQLException
addConnection
in interface ConnectionQueryServices
SQLException
public void removeConnection(PhoenixConnection connection) throws SQLException
removeConnection
in interface ConnectionQueryServices
SQLException
public KeyValueBuilder getKeyValueBuilder()
getKeyValueBuilder
in interface ConnectionQueryServices
KeyValueBuilder
that is valid for the locally installed version of HBase.public boolean supportsFeature(ConnectionQueryServices.Feature feature)
supportsFeature
in interface ConnectionQueryServices
public String getUserName()
getUserName
in interface ConnectionQueryServices
public User getUser()
getUser
in interface ConnectionQueryServices
public GuidePostsInfo getTableStats(GuidePostsKey key) throws SQLException
getTableStats
in interface ConnectionQueryServices
SQLException
public int getSequenceSaltBuckets()
getSequenceSaltBuckets
in interface ConnectionQueryServices
public void addFunction(PFunction function) throws SQLException
addFunction
in interface MetaDataMutated
SQLException
public void removeFunction(PName tenantId, String function, long functionTimeStamp) throws SQLException
removeFunction
in interface MetaDataMutated
SQLException
public MetaDataProtocol.MetaDataMutationResult getFunctions(PName tenantId, List<Pair<byte[],Long>> functions, long clientTimestamp) throws SQLException
getFunctions
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult getSchema(String schemaName, long clientTimestamp) throws SQLException
getSchema
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult createFunction(List<Mutation> functionData, PFunction function, boolean temporary) throws SQLException
createFunction
in interface ConnectionQueryServices
SQLException
public long getRenewLeaseThresholdMilliSeconds()
getRenewLeaseThresholdMilliSeconds
in interface ConnectionQueryServices
public boolean isRenewingLeasesEnabled()
isRenewingLeasesEnabled
in interface ConnectionQueryServices
public HRegionLocation getTableRegionLocation(byte[] tableName, byte[] row) throws SQLException
getTableRegionLocation
in interface ConnectionQueryServices
SQLException
public MetaDataProtocol.MetaDataMutationResult createSchema(List<Mutation> schemaMutations, String schemaName) throws SQLException
createSchema
in interface ConnectionQueryServices
SQLException
public void addSchema(PSchema schema) throws SQLException
addSchema
in interface MetaDataMutated
SQLException
public void removeSchema(PSchema schema, long schemaTimeStamp)
removeSchema
in interface MetaDataMutated
public MetaDataProtocol.MetaDataMutationResult dropSchema(List<Mutation> schemaMetaData, String schemaName) throws SQLException
dropSchema
in interface ConnectionQueryServices
SQLException
public void addTableStats(GuidePostsKey key, GuidePostsInfo info)
GuidePostsInfo
for a table to the client-side cache. Not a
ConnectionQueryServices
method. Exposed for testing purposes.tableName
- Table namestats
- Stats instancepublic void invalidateStats(GuidePostsKey key)
ConnectionQueryServices
GuidePostsInfo
for the table with the given name. If no cached guideposts are present, this does nothing.invalidateStats
in interface ConnectionQueryServices
public boolean isUpgradeRequired()
isUpgradeRequired
in interface ConnectionQueryServices
public org.apache.hadoop.conf.Configuration getConfiguration()
getConfiguration
in interface ConnectionQueryServices
public QueryLoggerDisruptor getQueryDisruptor()
getQueryDisruptor
in interface ConnectionQueryServices
public PhoenixTransactionClient initTransactionClient(TransactionFactory.Provider provider)
initTransactionClient
in interface ConnectionQueryServices
public List<LinkedBlockingQueue<WeakReference<PhoenixConnection>>> getCachedConnections()
Copyright © 2019 Apache Software Foundation. All Rights Reserved.