Interface InputTableUpdater
Implementations of this interface will make their own guarantees about how atomically changes will be applied and what operations they support.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
WritenewData
to this table.void
addAsync
(Table newData, InputTableStatusListener listener) WritenewData
to this table.default void
Delete the keys contained intable
from this input table.default void
deleteAsync
(Table table, InputTableStatusListener listener) Delete the keys contained in table from this input table.Gets the names of the key columns.Get the underlying Table definition (which includes the names and types of all of the columns).Gets the names of the value columns.default boolean
Returns true if the specified column exists in this InputTable.default boolean
Returns true if the specified column is a key.default void
validateAddOrModify
(Table tableToApply) Helper to check if a table is compatible with this table, so that it could be added as contents.default void
validateDelete
(Table tableToDelete) Validates that the given table definition is suitable to be passed todelete(Table)
.
-
Method Details
-
getKeyNames
Gets the names of the key columns.- Returns:
- a list with the names of the key columns of this input table
-
getValueNames
Gets the names of the value columns. By default, any column not marked as a key column is a value column.- Returns:
- a list with the names of the value columns of this input table
-
getTableDefinition
TableDefinition getTableDefinition()Get the underlying Table definition (which includes the names and types of all of the columns).- Returns:
- the TableDefinition for our user-visible table
-
validateAddOrModify
Helper to check if a table is compatible with this table, so that it could be added as contents.- Parameters:
tableToApply
- the table to check if it can used to add or modify this input table- Throws:
TableDefinition.IncompatibleTableDefinitionException
- if the definitions are not compatible
-
validateDelete
Validates that the given table definition is suitable to be passed todelete(Table)
.- Parameters:
tableToDelete
- The definition of the table to delete- Throws:
UnsupportedOperationException
- If this table does not support deletesArgumentException
- If the given definition isn't compatible to be used to delete
-
add
WritenewData
to this table. Added rows with keys that match existing rows will instead replace those rows, if supported.This method will block until the add is "completed", where the definition of "completed" is implementation dependenent.
For implementations where "completed" means "visible in the next update graph cycle", this method is not suitable for use from a
table listener
or any othernotification
-dispatched callback dispatched by this InputTable'supdate graph
. It may be suitable to delete from another update graph if doing so does not introduce any cycles.- Parameters:
newData
- The data to write to this table- Throws:
IOException
- If there is an error writing the data
-
addAsync
WritenewData
to this table. Added rows with keys that match existing rows replace those rows, if supported.The callback to
listener
will happen when the add has "completed", where the definition of "completed" is implementation dependenent. It's possible that the callback happens immediately on the same thread.This method will not block, and can be safely used from a
table listener
or any othernotification
-dispatched callback as long astable
is alreadysatisfied
on the current cycle.- Parameters:
newData
- The data to write to this tablelistener
- The listener for asynchronous results
-
delete
Delete the keys contained intable
from this input table.This method will block until the delete is "completed", where the definition of "completed" is implementation dependenent.
For implementations where "completed" means "visible in the next update graph cycle", this method is not suitable for use from a
table listener
or any othernotification
-dispatched callback dispatched by this InputTable'supdate graph
. It may be suitable to delete from another update graph if doing so does not introduce any cycles.- Parameters:
table
- The rows to delete- Throws:
IOException
- If a problem occurred while deleting the rows.UnsupportedOperationException
- If this table does not support deletes
-
deleteAsync
Delete the keys contained in table from this input table.The callback to
listener
will happen when the delete has "completed", where the definition of "completed" is implementation dependenent. It's possible that the callback happens immediately on the same thread.This method will not block, and can be safely used from a
table listener
or any othernotification
-dispatched callback as long astable
is alreadysatisfied
on the current cycle.- Parameters:
table
- Table containing the rows to delete- Throws:
UnsupportedOperationException
- If this table does not support deletes
-
isKey
Returns true if the specified column is a key.- Parameters:
columnName
- the column to interrogate- Returns:
- true if columnName is a key column, false otherwise
-
hasColumn
Returns true if the specified column exists in this InputTable.- Parameters:
columnName
- the column to interrogate- Returns:
- true if columnName exists in this InputTable
-