Apache Ignite C++ Client
Loading...
Searching...
No Matches
ignite::record_view< T > Class Template Reference

#include <record_view.h>

Public Types

typedef std::decay< T >::type value_type

Public Member Functions

 record_view (const record_view &)=delete
record_viewoperator= (const record_view &)=delete
 record_view (record_view &&) noexcept=default
record_viewoperator= (record_view &&) noexcept=default
void get_async (transaction *tx, const value_type &key, ignite_callback< std::optional< value_type > > callback)
std::optional< value_type > get (transaction *tx, const value_type &key)
void get_all_async (transaction *tx, std::vector< value_type > keys, ignite_callback< std::vector< std::optional< value_type > > > callback)
std::vector< std::optional< value_type > > get_all (transaction *tx, std::vector< value_type > keys)
void upsert_async (transaction *tx, const value_type &record, ignite_callback< void > callback)
void upsert (transaction *tx, const value_type &record)
void upsert_all_async (transaction *tx, std::vector< value_type > records, ignite_callback< void > callback)
void upsert_all (transaction *tx, std::vector< value_type > records)
void get_and_upsert_async (transaction *tx, const value_type &record, ignite_callback< std::optional< value_type > > callback)
std::optional< value_type > get_and_upsert (transaction *tx, const value_type &record)
void insert_async (transaction *tx, const value_type &record, ignite_callback< bool > callback)
bool insert (transaction *tx, const value_type &record)
void insert_all_async (transaction *tx, std::vector< value_type > records, ignite_callback< std::vector< value_type > > callback)
std::vector< value_type > insert_all (transaction *tx, std::vector< value_type > records)
void replace_async (transaction *tx, const value_type &record, ignite_callback< bool > callback)
bool replace (transaction *tx, const value_type &record)
void replace_async (transaction *tx, const value_type &record, const value_type &new_record, ignite_callback< bool > callback)
bool replace (transaction *tx, const value_type &record, const value_type &new_record)
void get_and_replace_async (transaction *tx, const value_type &record, ignite_callback< std::optional< value_type > > callback)
std::optional< value_type > get_and_replace (transaction *tx, const value_type &record)
void remove_async (transaction *tx, const value_type &key, ignite_callback< bool > callback)
bool remove (transaction *tx, const value_type &record)
void remove_exact_async (transaction *tx, const value_type &record, ignite_callback< bool > callback)
bool remove_exact (transaction *tx, const value_type &record)
void get_and_remove_async (transaction *tx, const value_type &key, ignite_callback< std::optional< value_type > > callback)
std::optional< value_type > get_and_remove (transaction *tx, const value_type &key)
void remove_all_async (transaction *tx, std::vector< value_type > keys, ignite_callback< std::vector< value_type > > callback)
std::vector< value_type > remove_all (transaction *tx, std::vector< value_type > keys)
void remove_all_exact_async (transaction *tx, std::vector< value_type > records, ignite_callback< std::vector< value_type > > callback)
std::vector< value_type > remove_all_exact (transaction *tx, std::vector< value_type > records)

Friends

class table

Detailed Description

template<typename T>
class ignite::record_view< T >

Record view interface provides methods to access table records.

Member Function Documentation

◆ get()

template<typename T>
std::optional< value_type > ignite::record_view< T >::get ( transaction * tx,
const value_type & key )
inlinenodiscard

Gets a record by key.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
keyKey.
Returns
Value if exists and std::nullopt otherwise.

◆ get_all()

template<typename T>
std::vector< std::optional< value_type > > ignite::record_view< T >::get_all ( transaction * tx,
std::vector< value_type > keys )
inlinenodiscard

Gets multiple records by keys.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
keysKeys.
Returns
Resulting records with all columns filled from the table. The order of elements is guaranteed to be the same as the order of keys. If a record does not exist, the resulting element of the corresponding order is std::nullopt.

◆ get_all_async()

template<typename T>
void ignite::record_view< T >::get_all_async ( transaction * tx,
std::vector< value_type > keys,
ignite_callback< std::vector< std::optional< value_type > > > callback )
inline

Gets multiple records by keys asynchronously.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
keysKeys.
callbackCallback that is called on operation completion. Called with resulting records with all columns filled from the table. The order of elements is guaranteed to be the same as the order of keys. If a record does not exist, the resulting element of the corresponding order is std::nullopt.

◆ get_and_remove()

template<typename T>
std::optional< value_type > ignite::record_view< T >::get_and_remove ( transaction * tx,
const value_type & key )
inline

Gets and deletes a record with the specified key.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
keyA record with key columns set.
Returns
A deleted record or std::nullopt if it did not exist.

◆ get_and_remove_async()

template<typename T>
void ignite::record_view< T >::get_and_remove_async ( transaction * tx,
const value_type & key,
ignite_callback< std::optional< value_type > > callback )
inline

Gets and deletes a record with the specified key asynchronously.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
keyA record with key columns set.
callbackCallback that is called on operation completion. Called with a deleted record or std::nullopt if it did not exist.

◆ get_and_replace()

template<typename T>
std::optional< value_type > ignite::record_view< T >::get_and_replace ( transaction * tx,
const value_type & record )
inlinenodiscard

Replaces a record with the same key columns if it exists returning previous record value.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record to insert.
callbackA previous value for the given key, or std::nullopt if it did not exist.

◆ get_and_replace_async()

template<typename T>
void ignite::record_view< T >::get_and_replace_async ( transaction * tx,
const value_type & record,
ignite_callback< std::optional< value_type > > callback )
inline

Asynchronously replaces a record with the same key columns if it exists returning previous record value.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record to insert.
callbackCallback. Called with a previous value for the given key, or std::nullopt if it did not exist.

◆ get_and_upsert()

template<typename T>
std::optional< value_type > ignite::record_view< T >::get_and_upsert ( transaction * tx,
const value_type & record )
inlinenodiscard

Inserts a record into the table and returns previous record.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record to upsert.
Returns
A replaced record or std::nullopt if it did not exist.

◆ get_and_upsert_async()

template<typename T>
void ignite::record_view< T >::get_and_upsert_async ( transaction * tx,
const value_type & record,
ignite_callback< std::optional< value_type > > callback )
inline

Inserts a record into the table and returns previous record asynchronously.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record to upsert.
callbackCallback. Called with a value which contains replaced record or std::nullopt if it did not exist.

◆ get_async()

template<typename T>
void ignite::record_view< T >::get_async ( transaction * tx,
const value_type & key,
ignite_callback< std::optional< value_type > > callback )
inline

Gets a record by key asynchronously.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
keyKey.
callbackCallback which is called on success with value if it exists and std::nullopt otherwise

◆ insert()

template<typename T>
bool ignite::record_view< T >::insert ( transaction * tx,
const value_type & record )
inline

Inserts a record into the table if does not exist.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record to insert into the table.

◆ insert_all()

template<typename T>
std::vector< value_type > ignite::record_view< T >::insert_all ( transaction * tx,
std::vector< value_type > records )
inline

Inserts multiple records into the table, skipping existing ones.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordsRecords to insert.
Returns
Skipped records.

◆ insert_all_async()

template<typename T>
void ignite::record_view< T >::insert_all_async ( transaction * tx,
std::vector< value_type > records,
ignite_callback< std::vector< value_type > > callback )
inline

Inserts multiple records into the table asynchronously, skipping existing ones.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordsRecords to insert.
callbackCallback that is called on operation completion. Called with skipped records.

◆ insert_async()

template<typename T>
void ignite::record_view< T >::insert_async ( transaction * tx,
const value_type & record,
ignite_callback< bool > callback )
inline

Inserts a record into the table if it does not exist asynchronously.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record to insert into the table.
callbackCallback. Called with a value indicating whether the record was inserted. Equals false if a record with the same key already exists.

◆ remove()

template<typename T>
bool ignite::record_view< T >::remove ( transaction * tx,
const value_type & record )
inline

Deletes a record with the specified key.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
keyA record with key columns set.
Returns
A value indicating whether a record with the specified key was deleted.

◆ remove_all()

template<typename T>
std::vector< value_type > ignite::record_view< T >::remove_all ( transaction * tx,
std::vector< value_type > keys )
inline

Deletes multiple records from the table If one or more keys do not exist, other records are still deleted

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
keysRecord keys to delete.
Returns
Records from keys that did not exist.

◆ remove_all_async()

template<typename T>
void ignite::record_view< T >::remove_all_async ( transaction * tx,
std::vector< value_type > keys,
ignite_callback< std::vector< value_type > > callback )
inline

Deletes multiple records from the table asynchronously. If one or more keys do not exist, other records are still deleted

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
keysRecord keys to delete.
callbackCallback that is called on operation completion. Called with records from keys that did not exist.

◆ remove_all_exact()

template<typename T>
std::vector< value_type > ignite::record_view< T >::remove_all_exact ( transaction * tx,
std::vector< value_type > records )
inline

Deletes multiple exactly matching records. If one or more records do not exist, other records are still deleted.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordsRecords to delete.
Returns
Records from records that did not exist.

◆ remove_all_exact_async()

template<typename T>
void ignite::record_view< T >::remove_all_exact_async ( transaction * tx,
std::vector< value_type > records,
ignite_callback< std::vector< value_type > > callback )
inline

Deletes multiple exactly matching records asynchronously. If one or more records do not exist, other records are still deleted.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordsRecords to delete.
callbackCallback that is called on operation completion. Called with records from records that did not exist.

◆ remove_async()

template<typename T>
void ignite::record_view< T >::remove_async ( transaction * tx,
const value_type & key,
ignite_callback< bool > callback )
inline

Deletes a record with the specified key asynchronously.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
keyA record with key columns set.
callbackCallback that is called on operation completion. Called with a value indicating whether a record with the specified key was deleted.

◆ remove_exact()

template<typename T>
bool ignite::record_view< T >::remove_exact ( transaction * tx,
const value_type & record )
inline

Deletes a record only if all existing columns have the same values as the specified record.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record with all columns set.
Returns
A value indicating whether a record with the specified key was deleted.

◆ remove_exact_async()

template<typename T>
void ignite::record_view< T >::remove_exact_async ( transaction * tx,
const value_type & record,
ignite_callback< bool > callback )
inline

Deletes a record only if all existing columns have the same values as the specified record asynchronously.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record with all columns set.
callbackCallback that is called on operation completion. Called with a value indicating whether a record with the specified key was deleted.

◆ replace() [1/2]

template<typename T>
bool ignite::record_view< T >::replace ( transaction * tx,
const value_type & record )
inline

Replaces a record with the same key columns if it exists, otherwise does nothing.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record to insert into the table.
Returns
A value indicating whether a record with the specified key was replaced.

◆ replace() [2/2]

template<typename T>
bool ignite::record_view< T >::replace ( transaction * tx,
const value_type & record,
const value_type & new_record )
inline

Replaces a record with a new one only if all existing columns have the same values as the specified record.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordCurrent value of the record to be replaced.
new_recordA record to replace it with.
Returns
A value indicating whether a specified record was replaced.

◆ replace_async() [1/2]

template<typename T>
void ignite::record_view< T >::replace_async ( transaction * tx,
const value_type & record,
const value_type & new_record,
ignite_callback< bool > callback )
inline

Asynchronously replaces a record with a new one only if all existing columns have the same values as the specified record.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordCurrent value of the record to be replaced.
new_recordA record to replace it with.
callbackCallback. Called with a value indicating whether a specified record was replaced.

◆ replace_async() [2/2]

template<typename T>
void ignite::record_view< T >::replace_async ( transaction * tx,
const value_type & record,
ignite_callback< bool > callback )
inline

Asynchronously replaces a record with the same key columns if it exists, otherwise does nothing.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record to insert into the table.
callbackCallback. Called with a value indicating whether a record with the specified key was replaced.

◆ upsert()

template<typename T>
void ignite::record_view< T >::upsert ( transaction * tx,
const value_type & record )
inline

Inserts a record into the table if does not exist or replaces the existing one.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record to insert into the table. The record cannot be nullptr.

◆ upsert_all()

template<typename T>
void ignite::record_view< T >::upsert_all ( transaction * tx,
std::vector< value_type > records )
inline

Inserts multiple records into the table, replacing existing.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordsRecords to upsert.

◆ upsert_all_async()

template<typename T>
void ignite::record_view< T >::upsert_all_async ( transaction * tx,
std::vector< value_type > records,
ignite_callback< void > callback )
inline

Inserts multiple records into the table asynchronously, replacing existing.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordsRecords to upsert.
callbackCallback that is called on operation completion.

◆ upsert_async()

template<typename T>
void ignite::record_view< T >::upsert_async ( transaction * tx,
const value_type & record,
ignite_callback< void > callback )
inline

Inserts a record into the table if does not exist or replaces the existing one.

Parameters
txOptional transaction. If nullptr implicit transaction for this single operation is used.
recordA record to insert into the table. The record cannot be nullptr.
callbackCallback.

The documentation for this class was generated from the following file: