public class SqlDataManager extends BasicDataManager implements DataManager
Modifier and Type | Class and Description |
---|---|
class |
SqlDataManager.SqlDataManagerLogger
Wrapper for a log4j logger
|
Modifier and Type | Field and Description |
---|---|
(package private) java.util.concurrent.ThreadPoolExecutor |
executor |
SqlDataManager.SqlDataManagerLogger |
log
The log object used by the data manager.
|
(package private) ScrapingSession |
session |
cacher, currentCacheBlock, currentDataNodes, eventEngine, mergeable, root, rootLock, schema, updateable
Constructor and Description |
---|
SqlDataManager(javax.sql.DataSource dataSource)
Creates an SqlDataManager that uses the given data source to connect to the database
|
SqlDataManager(javax.sql.DataSource dataSource,
ScrapingSession session)
Creates an SqlDataManager that uses the given data source to connect to the database
|
Modifier and Type | Method and Description |
---|---|
SchemaForeignKey |
addForeignKey(java.lang.String childTable,
java.lang.String childColumn,
java.lang.String parentTable,
java.lang.String parentColumn)
Add a foreign key to the schemas.
|
void |
addSessionVariablesOnCommit(boolean val)
Sets whether or not to add session variables on commit
|
void |
awaitCompletionOfPendingWrites()
Blocks until all pending and active writes have completed from all threads.
|
void |
awaitCompletionOfPendingWrites(long timeout,
java.util.concurrent.TimeUnit unit)
Blocks until all pending and active writes have completed from all threads.
|
void |
buildSchemas()
Builds the schemas from a database.
|
void |
buildSchemas(boolean useOldSchemaIfKnown)
Builds the schemas from a database.
|
void |
buildSchemas(java.util.List<java.lang.String> tables)
Builds the schemas from a database including only tables
|
void |
buildSchemas(java.lang.String schemaName)
Builds the schemas from a database.
|
void |
buildSchemas(java.lang.String schemaName,
boolean useOldSchemaIfKnown)
Builds the schemas from a database.
|
void |
buildSchemas(java.lang.String schemaName,
java.util.List<java.lang.String> tables)
Builds the schemas from a database including only tables
|
void |
cacheContext()
Cache the current context, using the session to get all SEARCH_ values for the context
|
boolean |
checkColumnLength(DataNode n,
java.lang.String column) |
boolean |
checkDataNode(java.lang.String schema)
verifies that the data is ready to be inserted.
|
boolean |
checkNullValue(DataNode n,
java.lang.String column) |
void |
clearSessionVariables(java.lang.String table)
Clears session variables that match fields in the given table
|
void |
clearSessionVariablesOnCommit(boolean val)
Sets whether or not to clear session variables on commit
|
void |
clearThreadLocals()
Clears all thread locals for the object
|
void |
close()
close should be called when you are done with the DataManager
|
boolean |
commit(java.lang.String table)
commits the row of data corresponding to the schema, so the next time addData is called it will be in a new row.
|
boolean |
constraintMet(DataNode n,
SchemaKey k) |
void |
enableConnectionMonitoring()
Tells this data manager to log out information about connections it has given out that have been open for a long time.
|
void |
enablePageAndContextCaching(java.lang.String cacheTableName,
java.util.Collection<java.lang.String> scrapeableFilesToCache,
boolean autoCacheDataRecords,
boolean keepMostRecentPageOnly)
Deprecated.
|
boolean |
fkConstraintsMet(DataNode n) |
boolean |
flush()
writes the current data to the Database and clears out all the data.
|
boolean |
flushSameThread()
This method is for when you have multi-threaded database writes enabled, but you need certain writes to be inline, for example if you need to run a query
afterwards that depends on the data you just wrote being current.
|
java.sql.Connection |
getActiveConnection()
Returns the connection currently writing to the database for the active thread
|
CacheLoader |
getCacheLoader()
Deprecated.
|
CacheLoader |
getCacheLoader(java.lang.String additionalWhereConstraints)
Deprecated.
|
java.sql.Connection |
getConnection()
get a direct connection to the database from the Connection pool for specific queries When the connection is done being used call close() on it to return
it to the pool.
|
java.sql.Connection |
getConnection(java.lang.String name)
get a direct connection to the database from the Connection pool for specific queries When the connection is done being used call close() on it to return
it to the pool.
|
java.lang.String |
getConnectionURL()
Returns the URL used to connection to the database for this SqlDataManager, or the string "Unknown" if the url wasn't determinable
|
int |
getCurrentActiveWriters()
Returns the current number of writing tasks.
|
DataManagerDataSource |
getDataSource()
Returns the DataSource for the object.
|
DataObject |
getLastAutoIncrementValue(java.lang.String table)
returns the value of the autoincrement key for the table for the last commit, or null if none is set
|
int |
getMaxActiveWritersSoFar()
Returns the maximum number of writing tasks that have occurred at any given time.
|
int |
getMaxBackgroundWriterThreads()
Returns the maximum number of background writer threads that will be used at any given time
|
int |
getMaxQueuedWritesSoFar()
Returns the maximum number of writing tasks that have been in queue at any given time.
|
DataWriter |
getNewDataWriter()
Gets a new data writer for writing to the database
|
java.util.Set<java.lang.String> |
getPrimaryKeys(java.lang.String table)
return a set of the columns which are primary keys defined in the SqlSchema
|
int |
getQueuedWrites()
Returns the current number of writing tasks that are in queue but not running.
|
java.lang.String |
getSchemaName()
Returns the SchemaName for the object (this is largely for PostgreSQL where you can have a single database with multiple schemas, each with tables in
them)
|
java.util.Set<RelationalSchema> |
getSchemas()
Helper method for backward compatibility to retrieve the relational (table) schemas
|
boolean |
isSqlAutoCommit()
Returns whether or not this data manager should use auto commit (each statement is it's own transaction)
|
boolean |
keyConstraintsMet(DataNode n) |
boolean |
keyConstraintsMet(DataNode n,
java.lang.String column) |
void |
removeEventListener(java.lang.String schema,
DataManagerEventSource.EventFireTime when,
DataManagerEventListener listener)
Removes an event listener
|
void |
setActiveConnection(java.sql.Connection connection)
Sets the connection currently writing to the database for the active thread
|
void |
setAutoCloseAfterScrapeEnds()
Tells the data manager to close when the scrape ends.
|
void |
setAutoIncrementSessionDuplicateRecords(ScrapingSession session,
java.lang.String schema,
DataManagerEventSource.EventFireTime fireTime)
Increments the number of duplicate records saved value on the session when the given fire time occurs for the given schema
|
void |
setAutoIncrementSessionDuplicateRecords(java.lang.String schema,
DataManagerEventSource.EventFireTime fireTime)
Increments the number of duplicate records saved value on the session when the given fire time occurs for the given schema
|
void |
setAutoIncrementSessionErrorRecords(ScrapingSession session,
java.lang.String schema,
DataManagerEventSource.EventFireTime fireTime)
Increments the number of error records saved value on the session when the given fire time occurs for the given schema
|
void |
setAutoIncrementSessionErrorRecords(java.lang.String schema,
DataManagerEventSource.EventFireTime fireTime)
Increments the number of error records saved value on the session when the given fire time occurs for the given schema
|
void |
setAutoIncrementSessionNewRecords(ScrapingSession session,
java.lang.String schema,
DataManagerEventSource.EventFireTime fireTime)
Increments the number of new records saved value on the session when the given fire time occurs for the given schema
|
void |
setAutoIncrementSessionNewRecords(java.lang.String schema,
DataManagerEventSource.EventFireTime fireTime)
Increments the number of new records saved value on the session when the given fire time occurs for the given schema
|
void |
setAutoIncrementSessionUpdatedOrDuplicateRecordsByFields(ScrapingSession session,
java.lang.String schema,
java.lang.String... ignoreFieldsForDuplicateCheck)
Increments the number of updated or duplicate records saved value on the session when the a record is being written.
|
void |
setAutoIncrementSessionUpdatedOrDuplicateRecordsByFields(java.lang.String schema,
java.lang.String... ignoreFieldsForDuplicateCheck)
Increments the number of updated or duplicate records saved value on the session when the a record is being written.
|
void |
setAutoIncrementSessionUpdatedRecords(ScrapingSession session,
java.lang.String schema,
DataManagerEventSource.EventFireTime fireTime)
Increments the number of updated records saved value on the session when the given fire time occurs for the given schema
|
void |
setAutoIncrementSessionUpdatedRecords(java.lang.String schema,
DataManagerEventSource.EventFireTime fireTime)
Increments the number of updated records saved value on the session when the given fire time occurs for the given schema
|
void |
setAutoManyToMany(boolean enable)
toggles automatically generating many to many relationship nodes based on schema information.
|
void |
setBasicAutoIncrementRecordsByWriteType(ScrapingSession session,
java.lang.String schema,
java.lang.String... ignoreFieldsForDuplicateCheck)
Sets up basic new/updated/duplicate/error record count increment handlers for the given schema.
|
void |
setBasicAutoIncrementRecordsByWriteType(java.lang.String schema,
java.lang.String... ignoreFieldsForDuplicateCheck)
Sets up basic new/updated/duplicate/error record count increment handlers for the given schema.
|
DataManagerDataSource |
setDataSource(javax.sql.DataSource newDataSource)
Sets a new data source for the data manager.
|
void |
setDateFormat(java.lang.String table,
java.lang.String column,
java.time.format.DateTimeFormatter inputDateFormat)
Set the input date format for a date/time/timestamp column so that the database can convert a String input it into an appropriate value for the database
|
void |
setDateFormat(java.lang.String table,
java.lang.String column,
java.text.SimpleDateFormat inputDateFormat)
Set the input date format for a date/time/timestamp column so that the database can convert a String input it into an appropriate value for the database
|
void |
setGlobalMergeEnabled(boolean merge)
Sets all the nodes to be able to merge the values with the corresponding rows in the database when there is a primary key match.
|
void |
setGlobalUpdateEnabled(boolean update)
Sets all the nodes to be able to overwrite columns in the database with the new values when there is a primary key match.
|
void |
setLastAutoIncrementValue(java.lang.String schemaName,
DataObject value)
Manually sets the last auto increment value for a schema.
|
void |
setLastAutoIncrementValue(java.lang.String schemaName,
java.lang.Object value)
Manually sets the last auto increment value for a schema.
|
void |
setLoggingLevel(org.apache.log4j.Level level)
Sets the logging level
|
void |
setLoggingLevelDebug()
Shortcut method for setting the log level to debug
|
void |
setLoggingLevelError()
Shortcut method for setting the log level to error
|
void |
setLoggingLevelInfo()
Shortcut method for setting the log level to info
|
void |
setLoggingLevelTrace()
Shortcut method for setting the log level to trace
|
void |
setLoggingLevelWarn()
Shortcut method for setting the log level to warn
|
protected void |
setManyToMany(DataNode dataNode)
If a many to many relationship between this node and another in the set of current datanodes is possible and doesn't already exist, that node will be
created.
|
void |
setMultiThreadWrite(int numThreads)
enables database writing to be done in its own thread.
|
void |
setSchemaName(java.lang.String schemaName)
Sets the SchemaName for the object (this is largely for PostgreSQL where you can have a single database with multiple schemas, each with tables in them)
|
void |
setSingleThreadWrite()
disables database writing to be done in its own thread.
|
void |
setSqlAutoCommit(boolean sqlAutoCommit)
Sets whether or not this data manager should use auto commit (each statement is it's own transaction)
|
(package private) boolean |
validateData(DataNode n) |
addData, addData, addData, addDataAssertion, addDataAssertion, addEventListener, addEventListener, addEventListenerWithPriority, addSchemalessEventListener, addSchemalessEventListenerWithPriority, cacheContent, cacheContent, cacheContent, cacheContext, cacheScrapeableFile, cacheScrapeableFile, catData, catData, clearAllData, clearData, connectTree, enablePageAndContextCaching, generateUID, getCacheReaderWriter, getColumns, getCurrentDataNode, getDatabaseSchema, getNewDataNode, getRoot, getSchema, hashData, hashData, hasSchema, importSchemas, removeSchemalessEventListener, rollback, setDatabaseSchema, setMergeEnabled, setUpdateEnabled, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addData, addData, addData, addEventListener, addEventListenerWithPriority, clearAllData, clearData, getColumns, getCurrentDataNode, getDatabaseSchema, getNewDataNode, getRoot, getSchema, hasSchema, setDatabaseSchema
@NotNull public final SqlDataManager.SqlDataManagerLogger log
@NotNull final java.util.concurrent.ThreadPoolExecutor executor
@Nullable final ScrapingSession session
@InternalOnly public SqlDataManager(@NotNull javax.sql.DataSource dataSource)
dataSource
- The data source to use (cannot be null)java.lang.IllegalArgumentException
- If the given data source is nullpublic SqlDataManager(@NotNull javax.sql.DataSource dataSource, @Nullable ScrapingSession session)
dataSource
- The data source to use (cannot be null)session
- The scraping session the data manager will be running underjava.lang.IllegalArgumentException
- If the given data source is null@NotNull public DataManagerDataSource getDataSource()
@NotNull public DataManagerDataSource setDataSource(@NotNull javax.sql.DataSource newDataSource)
newDataSource
- The new data source to usepublic void enableConnectionMonitoring()
public void setLoggingLevelTrace()
public void setLoggingLevelDebug()
public void setLoggingLevelInfo()
public final void setLoggingLevelWarn()
public void setLoggingLevelError()
public void setLoggingLevel(org.apache.log4j.Level level)
level
- The new logging levelpublic void addSessionVariablesOnCommit(boolean val)
val
- Whether or not to add session variables on commitpublic boolean isSqlAutoCommit()
public void setSqlAutoCommit(boolean sqlAutoCommit)
sqlAutoCommit
- True if this data manager should use auto commit (each statement is it's own transaction)@InternalOnly public void setActiveConnection(@Nullable java.sql.Connection connection)
connection
- The connection currently writing to the database for the active thread@Nullable public java.sql.Connection getActiveConnection()
public void clearThreadLocals()
public void clearSessionVariablesOnCommit(boolean val)
val
- Whether to clear values or not@InternalOnly public void clearSessionVariables(@NotNull java.lang.String table)
table
- The table for which to clear valuespublic void removeEventListener(java.lang.String schema, DataManagerEventSource.EventFireTime when, DataManagerEventListener listener)
removeEventListener
in class BasicDataManager
schema
- The schema to remove the listener fromwhen
- When the event would firelistener
- The listener that will be removed@NotNull @InternalOnly public java.util.Set<java.lang.String> getPrimaryKeys(java.lang.String table)
table
- The name of the table@NotNull public SchemaForeignKey addForeignKey(@NotNull java.lang.String childTable, java.lang.String childColumn, java.lang.String parentTable, java.lang.String parentColumn)
childTable
- The name of the child tablechildColumn
- The column on the child tableparentTable
- The name of the parent tableparentColumn
- The name of the column on the parent tablepublic void setDateFormat(@NotNull java.lang.String table, java.lang.String column, java.text.SimpleDateFormat inputDateFormat)
table
- The name of the tablecolumn
- The field to set the format forinputDateFormat
- The date format for the given table / fieldpublic void setDateFormat(@NotNull java.lang.String table, java.lang.String column, java.time.format.DateTimeFormatter inputDateFormat)
table
- The name of the tablecolumn
- The field to set the format forinputDateFormat
- The date format for the given table / fieldpublic DataObject getLastAutoIncrementValue(java.lang.String table)
table
- The name of the tablepublic void buildSchemas()
buildSchemas
in interface DataManager
buildSchemas
in class BasicDataManager
public void buildSchemas(@Nullable java.lang.String schemaName)
buildSchemas(List)
schemaName
- The name of the schema to parse, or null to parse all. For some database types this matterspublic void buildSchemas(boolean useOldSchemaIfKnown)
buildSchemas(List)
useOldSchemaIfKnown
- True to indicate we should use a schema we parsed before, if known. False to rebuild the schema regardless of whether or not
it has been done before.public void buildSchemas(@Nullable java.lang.String schemaName, boolean useOldSchemaIfKnown)
buildSchemas(List)
schemaName
- The name of the schema to parse, or null to parse all. For some database types this mattersuseOldSchemaIfKnown
- True to indicate we should use a schema we parsed before, if known. False to rebuild the schema regardless of whether or not
it has been done before.public void buildSchemas(@NotNull java.util.List<java.lang.String> tables) throws java.lang.Exception
tables
- A list of table names to build schemas forjava.lang.Exception
- On failure to build the schemaspublic void buildSchemas(@Nullable java.lang.String schemaName, @NotNull java.util.List<java.lang.String> tables) throws java.lang.Exception
schemaName
- The name of the schema to parse, or null to parse all. For some database types this matterstables
- A list of table names to build schemas forjava.lang.Exception
- On failure to build the schemas@NotNull @InternalOnly public DataWriter getNewDataWriter()
getNewDataWriter
in class BasicDataManager
public void setLastAutoIncrementValue(@NotNull java.lang.String schemaName, java.lang.Object value)
schemaName
- The name of the schemavalue
- The value to set as the last auto increment valuepublic void setLastAutoIncrementValue(@NotNull java.lang.String schemaName, DataObject value)
schemaName
- The name of the schemavalue
- The value to set as the last auto increment value@NotNull @InternalOnly public java.util.Set<RelationalSchema> getSchemas()
@Nullable public java.lang.String getSchemaName()
public void setSchemaName(@Nullable java.lang.String schemaName)
schemaName
- The new value for SchemaNamepublic java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
- If there is an error getting a connectionpublic java.sql.Connection getConnection(java.lang.String name) throws java.sql.SQLException
name
- A name to help debug abandoned connectionsjava.sql.SQLException
- If no connection could be retrievedpublic void setGlobalUpdateEnabled(boolean update)
update
- Whether updating should be enabled or notpublic void setGlobalMergeEnabled(boolean merge)
merge
- Whether merging should be enabled or not@InternalOnly public boolean checkDataNode(@NotNull java.lang.String schema)
checkDataNode
in interface DataManager
checkDataNode
in class BasicDataManager
schema
- The schemapublic void setAutoManyToMany(boolean enable)
enable
- True to enable many to many relations being automatically detected.public void setMultiThreadWrite(int numThreads)
setSingleThreadWrite()
to set no background threads. Calling that method overwrites what this method set.numThreads
- The number of threads used to writepublic int getMaxBackgroundWriterThreads()
public void setSingleThreadWrite()
setMultiThreadWrite(int)
to set background threads. Calling that method overwrites what this method set.public void close()
DataManager
close
in interface DataManager
close
in class BasicDataManager
public void setAutoCloseAfterScrapeEnds()
public void setAutoIncrementSessionNewRecords(@NotNull java.lang.String schema, DataManagerEventSource.EventFireTime fireTime)
schema
- The schemafireTime
- The fire timepublic void setAutoIncrementSessionNewRecords(@NotNull ScrapingSession session, @NotNull java.lang.String schema, DataManagerEventSource.EventFireTime fireTime)
session
- The session on which to increment records (useful for parent/child scrapes)schema
- The schemafireTime
- The fire timepublic void setAutoIncrementSessionDuplicateRecords(@NotNull java.lang.String schema, DataManagerEventSource.EventFireTime fireTime)
schema
- The schemafireTime
- The fire timepublic void setAutoIncrementSessionDuplicateRecords(@NotNull ScrapingSession session, @NotNull java.lang.String schema, DataManagerEventSource.EventFireTime fireTime)
session
- The session on which to increment records (useful for parent/child scrapes)schema
- The schemafireTime
- The fire timepublic void setAutoIncrementSessionUpdatedRecords(@NotNull java.lang.String schema, DataManagerEventSource.EventFireTime fireTime)
schema
- The schemafireTime
- The fire timepublic void setAutoIncrementSessionUpdatedRecords(@NotNull ScrapingSession session, @NotNull java.lang.String schema, DataManagerEventSource.EventFireTime fireTime)
session
- The session on which to increment records (useful for parent/child scrapes)schema
- The schemafireTime
- The fire timepublic void setAutoIncrementSessionUpdatedOrDuplicateRecordsByFields(@NotNull java.lang.String schema, @NotNull java.lang.String... ignoreFieldsForDuplicateCheck)
schema
- The schemaignoreFieldsForDuplicateCheck
- The fields to ignore for duplicate counts. If only fields from the ignore fields are being written, this is considered to be a duplicate, otherwise it is an updatepublic void setAutoIncrementSessionUpdatedOrDuplicateRecordsByFields(@NotNull ScrapingSession session, @NotNull java.lang.String schema, @NotNull java.lang.String... ignoreFieldsForDuplicateCheck)
session
- The session on which to increment records (useful for parent/child scrapes)schema
- The schemaignoreFieldsForDuplicateCheck
- The fields to ignore for duplicate counts. If only fields from the ignore fields are being written, this is considered to be a duplicate, otherwise it is an updatepublic void setBasicAutoIncrementRecordsByWriteType(@NotNull java.lang.String schema, @NotNull java.lang.String... ignoreFieldsForDuplicateCheck)
schema
- The schemaignoreFieldsForDuplicateCheck
- The fields to ignore for duplicate counts. If only fields from the ignore fields are being written, this is considered to be a duplicate, otherwise it is an update (for records being updated in the database)public void setAutoIncrementSessionErrorRecords(@NotNull java.lang.String schema, DataManagerEventSource.EventFireTime fireTime)
schema
- The schemafireTime
- The fire timepublic void setAutoIncrementSessionErrorRecords(@NotNull ScrapingSession session, @NotNull java.lang.String schema, DataManagerEventSource.EventFireTime fireTime)
session
- The session on which to increment records (useful for parent/child scrapes)schema
- The schemafireTime
- The fire timepublic void setBasicAutoIncrementRecordsByWriteType(@NotNull ScrapingSession session, @NotNull java.lang.String schema, @NotNull java.lang.String... ignoreFieldsForDuplicateCheck)
session
- The session on which to increment records (useful for parent/child scrapes)schema
- The schemaignoreFieldsForDuplicateCheck
- The fields to ignore for duplicate counts. If only fields from the ignore fields are being written, this is considered to be a duplicate, otherwise it is an update (for records being updated in the database)public boolean flush()
flush
in interface DataManager
flush
in class BasicDataManager
public void awaitCompletionOfPendingWrites() throws java.lang.InterruptedException
java.lang.InterruptedException
- If the thread was interrupted while waitingpublic void awaitCompletionOfPendingWrites(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
timeout
- The amount of time to wait (negative for infinite)unit
- The unit of the amount to waitjava.lang.InterruptedException
- If the thread was interrupted while waitingjava.util.concurrent.TimeoutException
- If the time elapsed before the pending writes completedprotected void setManyToMany(@NotNull DataNode dataNode)
dataNode
- The node on which to set many to manypublic boolean commit(java.lang.String table)
commit
in interface DataManager
commit
in class BasicDataManager
table
- The table to commitpublic boolean flushSameThread()
@InternalOnly boolean validateData(@NotNull DataNode n)
@InternalOnly public boolean keyConstraintsMet(@NotNull DataNode n)
@InternalOnly public boolean keyConstraintsMet(@NotNull DataNode n, @Nullable java.lang.String column)
@InternalOnly public boolean constraintMet(@NotNull DataNode n, @Nullable SchemaKey k)
@InternalOnly public boolean checkNullValue(@NotNull DataNode n, java.lang.String column)
@InternalOnly public boolean fkConstraintsMet(@NotNull DataNode n)
@InternalOnly public boolean checkColumnLength(@NotNull DataNode n, java.lang.String column)
@InternalOnly @Deprecated public void enablePageAndContextCaching(@NotNull java.lang.String cacheTableName, @Nullable java.util.Collection<java.lang.String> scrapeableFilesToCache, boolean autoCacheDataRecords, boolean keepMostRecentPageOnly)
Field | Data Type |
---|---|
main_pk | Same as the unique single field the context will relate to, usually an unsigned autoincrement integer |
hash | varchar (80) |
name | varchar |
type | tinyint (See CacheType for the values) |
cache_time | timestamp |
compression | tinyint |
cached_data | blob |
There should be a foreign key from main_pk to the primary key in the main record table.
There should also be a primary key on main_pk, name, hash, type although that is not required (but will make things nicer).It is also recommended if you plan to run queries on the data that you have an index on type and name
cacheTableName
- The name of the cache table. This should be the table name that will store the cached content as opposed to the name of the table
where the data you are extracting will be stored.scrapeableFilesToCache
- A set of scrapeable file names that should be cached automatically for this scrape. These will be cached anytime data is
added to the data manager AND the current scrapeable file is one of those named.autoCacheDataRecords
- True if anytime data is added (not committed) for the main table the current data record (if there is a dataRecord in the
script) should be cached as well.keepMostRecentPageOnly
- True if only the most recent copy of a given cached page (by name). Basically this means if a page is cached, but one with
the same name already exists, the new version will overwrite the old versionjava.lang.IllegalArgumentException
- If the cache table doesn't exist in the parsed schemasjava.lang.IllegalStateException
- If the cache table has an invalid format@NotNull @InternalOnly @Deprecated public CacheLoader getCacheLoader()
@NotNull @InternalOnly @Deprecated public CacheLoader getCacheLoader(@Nullable java.lang.String additionalWhereConstraints)
additionalWhereConstraints
- Additional where constraints for the lookup. This is useful if you are storing multiple sources in a single database.
For example, if you have a scrape table, and then the main records have a foreign key to that table to indicate which scrape the data is actually from.public void cacheContext()
public int getCurrentActiveWriters()
public int getMaxActiveWritersSoFar()
public int getQueuedWrites()
public int getMaxQueuedWritesSoFar()
@NotNull public java.lang.String getConnectionURL()