Enum RDBDocumentStoreDB
java.lang.Object
java.lang.Enum<RDBDocumentStoreDB>
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStoreDB
- All Implemented Interfaces:
Serializable
,Comparable<RDBDocumentStoreDB>
Defines variation in the capabilities of different RDBs.
-
Nested Class Summary
Nested Classes -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionCheck the database brand and versionprotected String
extractFields
(ResultSet rs, String indexStats) getAdditionalDiagnostics
(RDBConnectionHandler ch, String tableName) getAdditionalStatistics
(RDBConnectionHandler ch, String catalog, String tableName) Returns additional DB-specific statistics, augmenting the return value ofRDBDocumentStore.getStats()
.getConcatQuery
(String appendData, int dataOctetLimit) Returns the CONCAT function or its equivalent function or sub-query.Query syntax for current time in ms since the epochQuery syntax for "FETCH FIRST"getIndexCreationStatements
(String tableName, int level) @NotNull String
Query for any required initialization of the DB.getModifiedIndexStatement
(String tableName) getTableCreationStatement
(String tableName, int schema) Table creation statement stringgetTableUpgradeStatements
(String tableName, int level) Statements needed to upgrade the DBstatic @NotNull RDBDocumentStoreDB
makeIndexConditionalForColumn
(String columnName) toString()
static RDBDocumentStoreDB
Returns the enum constant of this type with the specified name.static RDBDocumentStoreDB[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
-
H2
-
DERBY
-
POSTGRES
-
DB2
-
ORACLE
-
MYSQL
-
MSSQL
-
-
Field Details
-
description
-
vendorCode
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
checkVersion
Check the database brand and version- Throws:
SQLException
-
getFetchFirstSyntax
Query syntax for "FETCH FIRST" -
getCurrentTimeStampInSecondsSyntax
Query syntax for current time in ms since the epoch- Returns:
- the query syntax or empty string when no such syntax is available
-
getConcatQuery
public RDBJDBCTools.PreparedStatementComponent getConcatQuery(String appendData, int dataOctetLimit) Returns the CONCAT function or its equivalent function or sub-query. Note that the function MUST NOT cause a truncated value to be written!- Parameters:
appendData
- string to be inserteddataOctetLimit
- expected capacity of data column
-
getInitializationStatement
Query for any required initialization of the DB.- Returns:
- the DB initialization SQL string
-
getTableCreationStatement
Table creation statement string- Parameters:
tableName
-- Returns:
- the table creation string
-
getIndexCreationStatements
-
getAdditionalDiagnostics
@NotNull public @NotNull Map<String,String> getAdditionalDiagnostics(RDBConnectionHandler ch, String tableName) -
getAdditionalStatistics
public Map<String,String> getAdditionalStatistics(RDBConnectionHandler ch, String catalog, String tableName) Returns additional DB-specific statistics, augmenting the return value ofRDBDocumentStore.getStats()
.Where applicable, the following fields are returned similar to the output for MongoDB:
- storageSize
- total size of table
- size
- size of table (excl. indexes)
- totalIndexSize
- total size of all indexes
- indexSizes.indexName
- size of individual indexes
Additionally, a information obtained from the databases system tables/views can be included:
- _data
- table specific data
- indexName._data
- index specific data
These fields will just contain DB-specific name/value pairs obtained from the database. The exact fields to fetch are preconfigured by can be tuned using system properties, such as:
-Dorg.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.DB2.TABLE_STATS="card npages mpages fpages overflow pctfree avgrowsize stats_time" -Dorg.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.DB2.INDEX_STATS="indextype colnames pctfree clusterratio nleaf nlevels fullkeycard density indcard numrids numrids_deleted avgleafkeysize avgnleafkeysize remarks stats_time"
(this currently applies to DB types:
DB2
,ORACLE
, andMYSQL
).See links below for the definition of the individual fields:
POSTGRES
- PostgreSQL 9.6.6 Documentation - 9.26.7. Database Object Management FunctionsDB2
- DB2 10.5 for Linux, UNIX, and Windows: SYSCAT.TABLES catalog view, SYSCAT.INDEXES catalog viewORACLE
- Oracle Database Online Documentation 12c Release 1 (12.1): 3.118 ALL_TABLES, 2.127 ALL_INDEXESMYSQL
- MySQL 5.7 Reference Manual: 13.7.5.36 SHOW TABLE STATUS Syntax, 13.7.5.22 SHOW INDEX SyntaxMSSQL
- Developer Reference for SQL Server: sys.dm_db_partition_stats (Transact-SQL), sp_spaceused (Transact-SQL)DERBY
- Derby Reference Manual: SYSCS_DIAG.SPACE_TABLE diagnostic table function
-
getSmallintType
-
getBigintType
-
makeIndexConditionalForColumn
-
getModifiedIndexStatement
-
getTableUpgradeStatements
Statements needed to upgrade the DB- Returns:
- the table modification string
-
extractFields
- Throws:
SQLException
-
toString
- Overrides:
toString
in classEnum<RDBDocumentStoreDB>
-
getValue
-