Package org.apache.tika.eval.app.db
Class JDBCUtil
java.lang.Object
org.apache.tika.eval.app.db.JDBCUtil
- Direct Known Subclasses:
H2Util
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringOverride for the h2 page cache in KB; unclamped, so a big box can go well beyond the heap-relative default. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbatchInsert(PreparedStatement insertStatement, TableInfo table, Map<Cols, String> data) booleancontainsTable(String tableName) voidcreateTables(List<TableInfo> tableInfos, JDBCUtil.CREATE_TABLE createTable) booleandropTableIfExists(Connection conn, String tableName) Override this any optimizations you want to do on the db before writing/reading.static longH2's page cache is on heap, so the default is a quarter of the heap clamped to [64MB, 1GB] rather than a fixed size that a small JVM cannot afford.static StringgetJdbcConnectionString(String dbPath) If dbPath is already a jdbc string, it is used as is; otherwise this builds the tika-eval h2 default: CACHE_SIZE (KB) sized bygetH2CacheSizeKb().JDBC driver class.getTables(Connection connection) static voidupdateInsertStatement(int dbColOffset, PreparedStatement st, ColInfo colInfo, String value)
-
Field Details
-
H2_CACHE_SIZE_KB_PROPERTY
Override for the h2 page cache in KB; unclamped, so a big box can go well beyond the heap-relative default.- See Also:
-
-
Constructor Details
-
JDBCUtil
-
-
Method Details
-
getJdbcConnectionString
If dbPath is already a jdbc string, it is used as is; otherwise this builds the tika-eval h2 default: CACHE_SIZE (KB) sized bygetH2CacheSizeKb(). Chunk retention stays at H2's 45s default: RETENTION_TIME=0 let dead chunks be dropped under the background writer (assert in FileStore.serializeAndStore). -
getH2CacheSizeKb
public static long getH2CacheSizeKb()H2's page cache is on heap, so the default is a quarter of the heap clamped to [64MB, 1GB] rather than a fixed size that a small JVM cannot afford. Set "tika.eval.h2.cacheSizeKb" to override. -
batchInsert
public static void batchInsert(PreparedStatement insertStatement, TableInfo table, Map<Cols, String> data) throws SQLException- Throws:
SQLException
-
updateInsertStatement
public static void updateInsertStatement(int dbColOffset, PreparedStatement st, ColInfo colInfo, String value) throws SQLException - Throws:
SQLException
-
getConnection
Override this any optimizations you want to do on the db before writing/reading.- Returns:
- Throws:
IOExceptionSQLException
-
getJDBCDriverClass
JDBC driver class. Override as necessary.- Returns:
-
dropTableIfExists
- Throws:
SQLException
-
getConnectionString
-
getTables
- Throws:
SQLException
-
createTables
public void createTables(List<TableInfo> tableInfos, JDBCUtil.CREATE_TABLE createTable) throws SQLException, IOException - Throws:
SQLExceptionIOException
-
containsTable
- Throws:
SQLException
-