Enum RDBDocumentStoreDB

java.lang.Object
java.lang.Enum<RDBDocumentStoreDB>
org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStoreDB
All Implemented Interfaces:
Serializable, Comparable<RDBDocumentStoreDB>

public enum RDBDocumentStoreDB extends Enum<RDBDocumentStoreDB>
Defines variation in the capabilities of different RDBs.
  • Enum Constant Details

  • Field Details

  • Method Details

    • values

      public static RDBDocumentStoreDB[] 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

      public static RDBDocumentStoreDB valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • checkVersion

      public String checkVersion(DatabaseMetaData md) throws SQLException
      Check the database brand and version
      Throws:
      SQLException
    • getFetchFirstSyntax

      public RDBDocumentStoreDB.FETCHFIRSTSYNTAX getFetchFirstSyntax()
      Query syntax for "FETCH FIRST"
    • getCurrentTimeStampInSecondsSyntax

      public String 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 inserted
      dataOctetLimit - expected capacity of data column
    • getInitializationStatement

      @NotNull public @NotNull String getInitializationStatement()
      Query for any required initialization of the DB.
      Returns:
      the DB initialization SQL string
    • getTableCreationStatement

      public String getTableCreationStatement(String tableName, int schema)
      Table creation statement string
      Parameters:
      tableName -
      Returns:
      the table creation string
    • getIndexCreationStatements

      public List<String> getIndexCreationStatements(String tableName, int level)
    • 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 of RDBDocumentStore.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, and MYSQL).

      See links below for the definition of the individual fields:

    • getSmallintType

      public String getSmallintType()
    • getBigintType

      public String getBigintType()
    • makeIndexConditionalForColumn

      public String makeIndexConditionalForColumn(String columnName)
    • getModifiedIndexStatement

      public String getModifiedIndexStatement(String tableName)
    • getTableUpgradeStatements

      public List<String> getTableUpgradeStatements(String tableName, int level)
      Statements needed to upgrade the DB
      Returns:
      the table modification string
    • extractFields

      protected String extractFields(ResultSet rs, String indexStats) throws SQLException
      Throws:
      SQLException
    • toString

      public String toString()
      Overrides:
      toString in class Enum<RDBDocumentStoreDB>
    • getValue

      @NotNull public static @NotNull RDBDocumentStoreDB getValue(String desc)