Package org.apache.ignite.table
Interface RecordView<R>
- Type Parameters:
R
- Mapped record type.
- All Superinterfaces:
ContinuousQuerySource<R>
,CriteriaQuerySource<R>
,DataStreamerTarget<R>
public interface RecordView<R>
extends DataStreamerTarget<R>, CriteriaQuerySource<R>, ContinuousQuerySource<R>
Table view interface provides methods to access table records.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(@Nullable Transaction tx, R keyRec) Determines whether a table contains an entry for the specified key.boolean
containsAll
(@Nullable Transaction tx, Collection<R> keys) Determines whether a table contains entries for all given keys.containsAllAsync
(@Nullable Transaction tx, Collection<R> keys) Determines whether a table contains entries for all given keys.containsAsync
(@Nullable Transaction tx, R keyRec) Determines whether a table contains an entry for the specified key.boolean
delete
(@Nullable Transaction tx, R keyRec) Deletes a record with the same key column values as the given one from a table.deleteAll
(@Nullable Transaction tx, Collection<R> keyRecs) Removes from a table records with the same key column values as the given one.deleteAllAsync
(@Nullable Transaction tx, Collection<R> keyRecs) Asynchronously removes from a table records with the same key column values as the given one.deleteAllExact
(@Nullable Transaction tx, Collection<R> recs) Remove the given records from a table.deleteAllExactAsync
(@Nullable Transaction tx, Collection<R> recs) Asynchronously removes the given records from a table.deleteAsync
(@Nullable Transaction tx, R keyRec) Asynchronously deletes a record with the same key column values as the given one from a table.boolean
deleteExact
(@Nullable Transaction tx, R rec) Deletes the given record from a table.deleteExactAsync
(@Nullable Transaction tx, R rec) Asynchronously deletes the given record from a table.get
(@Nullable Transaction tx, R keyRec) Gets a record with the same key column values as the given one from a table.getAll
(@Nullable Transaction tx, Collection<R> keyRecs) Gets records from a table.getAllAsync
(@Nullable Transaction tx, Collection<R> keyRecs) Asynchronously gets records from a table.getAndDelete
(@Nullable Transaction tx, R keyRec) Gets and deletes from a table a record with the same key column values as the given one.getAndDeleteAsync
(@Nullable Transaction tx, R keyRec) Asynchronously gets and deletes from a table a record with the same key columns values as the given one.getAndReplace
(@Nullable Transaction tx, R rec) Gets an existing record associated with the same key columns values as the given one, then replaces it with the given one.getAndReplaceAsync
(@Nullable Transaction tx, R rec) Asynchronously gets an existing record associated with the same key column values as the given one, then replaces it with the given one.getAndUpsert
(@Nullable Transaction tx, R rec) Inserts a record into a table, or replaces an existing record and returns the replaced record.getAndUpsertAsync
(@Nullable Transaction tx, R rec) Asynchronously inserts a record into a table, or replaces an existing record and returns the replaced record.getAsync
(@Nullable Transaction tx, R keyRec) Asynchronously gets a record with the same key column values as the given one from a table.boolean
insert
(@Nullable Transaction tx, R rec) Inserts a record into a table if it does not exists.insertAll
(@Nullable Transaction tx, Collection<R> recs) Inserts into a table records that do not exist, skips those that exist.insertAllAsync
(@Nullable Transaction tx, Collection<R> recs) Asynchronously inserts into a table records that do not exist, skips those that exist.insertAsync
(@Nullable Transaction tx, R rec) Asynchronously inserts a record into a table if it does not exists.boolean
replace
(@Nullable Transaction tx, R rec) Replaces an existing record associated with the same key column values as the given record.boolean
replace
(@Nullable Transaction tx, R oldRec, R newRec) Replaces an expected record in the table with the given new one.replaceAsync
(@Nullable Transaction tx, R rec) Asynchronously replaces an existing record associated with the same key columns values as the given record.replaceAsync
(@Nullable Transaction tx, R oldRec, R newRec) Asynchronously replaces an existing record in the table with the given new one.void
upsert
(@Nullable Transaction tx, R rec) Inserts a record into a table, if it does not exist, or replaces an existing one.void
upsertAll
(@Nullable Transaction tx, Collection<R> recs) Inserts records into a table, if they do not exist, or replaces the existing ones.upsertAllAsync
(@Nullable Transaction tx, Collection<R> recs) Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.upsertAsync
(@Nullable Transaction tx, R rec) Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.Methods inherited from interface org.apache.ignite.table.ContinuousQuerySource
queryContinuously
Methods inherited from interface org.apache.ignite.table.criteria.CriteriaQuerySource
query, query, query, queryAsync, queryAsync, queryAsync
Methods inherited from interface org.apache.ignite.table.DataStreamerTarget
streamData, streamData
-
Method Details
-
get
Gets a record with the same key column values as the given one from a table.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRec
- Record with the key columns set. The record cannot benull
.- Returns:
- Record with all columns filled from the table.
-
getAsync
Asynchronously gets a record with the same key column values as the given one from a table.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRec
- Record with the key columns set. The record cannot benull
.- Returns:
- Future that represents the pending completion of the operation.
-
getAll
Gets records from a table.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRecs
- Records with key columns set. The records cannot benull
.- Returns:
- Records with all columns filled from the table. The order of collection elements is
guaranteed to be the same as the order of
keyRecs
. If a record does not exist, the element at the corresponding index of the resulting collection isnull
.
-
getAllAsync
Asynchronously gets records from a table.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRecs
- Records with the key columns set. The records cannot benull
.- Returns:
- Future that will return records with all columns filled from the table. The order of collection elements is
guaranteed to be the same as the order of
keyRecs
. If a record does not exist, the element at the corresponding index of the resulting collection isnull
.
-
contains
Determines whether a table contains an entry for the specified key.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRec
- A record with key columns set. The key cannot benull
.- Returns:
True
if a value exists for every specified key,false
otherwise.- Throws:
MarshallerException
- if the key doesn't match the schema.
-
containsAsync
Determines whether a table contains an entry for the specified key.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRec
- A record with key columns set. The key cannot benull
.- Returns:
- Future that represents the pending completion of the operation.
- Throws:
MarshallerException
- if the key doesn't match the schema.
-
containsAll
Determines whether a table contains entries for all given keys.- Parameters:
tx
- Transaction ornull
for implicit transaction.keys
- Keys whose presence is to be verified. The collection and it's values cannot benull
.- Returns:
True
if a value exists for every specified key,false
otherwise.- Throws:
MarshallerException
- if the key doesn't match the schema.
-
containsAllAsync
Determines whether a table contains entries for all given keys.- Parameters:
tx
- Transaction ornull
for implicit transaction.keys
- Keys whose presence is to be verified. The collection and it's values cannot benull
.- Returns:
- Future that represents the pending completion of the operation. The result of the future will be
true
if a value exists for every specified key,false
otherwise. - Throws:
MarshallerException
- if the key doesn't match the schema.
-
upsert
Inserts a record into a table, if it does not exist, or replaces an existing one.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- Record to insert into the table. The record cannot benull
.
-
upsertAsync
Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- Record to insert into the table. The record cannot benull
.- Returns:
- Future that represents the pending completion of the operation.
-
upsertAll
Inserts records into a table, if they do not exist, or replaces the existing ones.- Parameters:
tx
- Transaction ornull
for implicit transaction.recs
- Records to insert into the table. The records cannot benull
.
-
upsertAllAsync
Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.- Parameters:
tx
- Transaction ornull
for implicit transaction.recs
- Records to insert into the table. The records cannot benull
.- Returns:
- Future that represents the pending completion of the operation.
-
getAndUpsert
Inserts a record into a table, or replaces an existing record and returns the replaced record.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- A record to insert into the table. The record cannot benull
.- Returns:
- Replaced record or
null
if it did not exist.
-
getAndUpsertAsync
Asynchronously inserts a record into a table, or replaces an existing record and returns the replaced record.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- Record to insert into the table. The record cannot benull
.- Returns:
- Future that represents the pending completion of the operation.
-
insert
Inserts a record into a table if it does not exists.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- Record to insert into the table. The record cannot benull
.- Returns:
True
if successful,false
otherwise.
-
insertAsync
Asynchronously inserts a record into a table if it does not exists.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- Record to insert into the table. The record cannot benull
.- Returns:
- Future that represents the pending completion of the operation.
-
insertAll
Inserts into a table records that do not exist, skips those that exist.- Parameters:
tx
- Transaction ornull
for implicit transaction.recs
- Records to insert into the table. The records cannot benull
.- Returns:
- Skipped records. The order of collection elements is guaranteed to be the same as the order of
recs
. If a record is inserted, the element will be excluded from the collection result.
-
insertAllAsync
Asynchronously inserts into a table records that do not exist, skips those that exist.- Parameters:
tx
- Transaction ornull
for implicit transaction.recs
- Records to insert into the table. The records cannot benull
.- Returns:
- Future representing pending completion of the operation, with rejected rows for insertion in the result. The order of
collection elements is guaranteed to be the same as the order of
recs
. If a record is inserted, the element will be excluded from the collection result.
-
replace
Replaces an existing record associated with the same key column values as the given record.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- Record to replace with. The record cannot benull
.- Returns:
True
if a record was found and replaced successfully,false
otherwise.
-
replace
Replaces an expected record in the table with the given new one.- Parameters:
tx
- Transaction ornull
for implicit transaction.oldRec
- Record to replace. The record cannot benull
.newRec
- Record to replace with. The record cannot benull
.- Returns:
True
if a record was replaced successfully,false
otherwise.
-
replaceAsync
Asynchronously replaces an existing record associated with the same key columns values as the given record.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- Record to replace with. The record cannot benull
.- Returns:
- Future that represents the pending completion of the operation.
-
replaceAsync
Asynchronously replaces an existing record in the table with the given new one.- Parameters:
tx
- Transaction ornull
for implicit transaction.oldRec
- Record to replace. The record cannot benull
.newRec
- Record to replace with. The record cannot benull
.- Returns:
- Future that represents the pending completion of the operation.
-
getAndReplace
Gets an existing record associated with the same key columns values as the given one, then replaces it with the given one.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- Record to replace with. The record cannot benull
.- Returns:
- Replaced record or
null
if it did not exist.
-
getAndReplaceAsync
Asynchronously gets an existing record associated with the same key column values as the given one, then replaces it with the given one.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- Record to replace with. The record cannot benull
.- Returns:
- Future that represents the pending completion of the operation.
-
delete
Deletes a record with the same key column values as the given one from a table.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRec
- Record with the key columns set. The record cannot benull
.- Returns:
True
if removed successfully,false
otherwise.
-
deleteAsync
Asynchronously deletes a record with the same key column values as the given one from a table.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRec
- Record with the key columns set. The record cannot benull
.- Returns:
- Future that represents the pending completion of the operation.
-
deleteExact
Deletes the given record from a table.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- Record to delete. The record cannot benull
.- Returns:
True
if removed successfully,false
otherwise.
-
deleteExactAsync
Asynchronously deletes the given record from a table.- Parameters:
tx
- Transaction ornull
for implicit transaction.rec
- Record to delete. The record cannot benull
.- Returns:
- Future tha represents the pending completion of the operation.
-
getAndDelete
Gets and deletes from a table a record with the same key column values as the given one.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRec
- Record with the key columns set. The record cannot benull
.- Returns:
- Removed record or
null
if it did not exist.
-
getAndDeleteAsync
Asynchronously gets and deletes from a table a record with the same key columns values as the given one.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRec
- Record with the key columns set. The record cannot benull
.- Returns:
- Future that represents the pending completion of the operation.
-
deleteAll
Removes from a table records with the same key column values as the given one.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRecs
- Records with the key columns set. The records cannot benull
.- Returns:
- Records with the key columns set that did not exist. The order of collection elements is guaranteed to be the same as the
order of
keyRecs
. If a record is removed, the element will be excluded from the collection result.
-
deleteAllAsync
CompletableFuture<List<R>> deleteAllAsync(@Nullable @Nullable Transaction tx, Collection<R> keyRecs) Asynchronously removes from a table records with the same key column values as the given one.- Parameters:
tx
- Transaction ornull
for implicit transaction.keyRecs
- Records with the key columns set. The records cannot benull
.- Returns:
- Future represents the pending completion of the operation, with rejected rows for deletion in the result. The order of
collection elements is guaranteed to be the same as the order of
keyRecs
. If a record is removed, the element will be excluded from the collection result.
-
deleteAllExact
Remove the given records from a table.- Parameters:
tx
- Transaction ornull
for implicit transaction.recs
- Records to delete. The records cannot benull
.- Returns:
- Records that were not deleted. The order of collection elements is guaranteed to be the same as the order of
recs
. If a record is removed, the element will be excluded from the collection result.
-
deleteAllExactAsync
CompletableFuture<List<R>> deleteAllExactAsync(@Nullable @Nullable Transaction tx, Collection<R> recs) Asynchronously removes the given records from a table.- Parameters:
tx
- Transaction ornull
for implicit transaction.recs
- Records to delete. The records cannot benull
.- Returns:
- Future represents the pending completion of the operation, with rejected rows for deletion in the result. The order of
collection elements is guaranteed to be the same as the order of
recs
. If a record is removed, the element will be excluded from the collection result.
-