|
| read_result_set (int32_t read_count, std::vector< serialization::pimpl::data > &&data_items, serialization::pimpl::SerializationService &serialization_service, boost::optional< std::vector< int64_t > > &item_seqs, int64_t next_seq) |
int32_t | read_count () const |
| Returns the number of items that have been read before filtering.
|
const std::vector< typed_data > & | get_items () const |
int64_t | get_sequence (int32_t index) const |
| Return the sequence number for the item at the given index.
|
int64_t | get_next_sequence_to_read_from () const |
| Returns the sequence of the item following the last read item.
|
|
static const int64_t | SEQUENCE_UNAVAILABLE = -1 |
| Value returned from methods returning a sequence number when the information is not available (e.g.
|
Definition at line 32 of file read_result_set.h.
◆ read_result_set()
hazelcast::client::rb::read_result_set::read_result_set |
( |
int32_t | read_count, |
|
|
std::vector< serialization::pimpl::data > && | data_items, |
|
|
serialization::pimpl::SerializationService & | serialization_service, |
|
|
boost::optional< std::vector< int64_t > > & | item_seqs, |
|
|
int64_t | next_seq ) |
|
inline |
Definition at line 42 of file read_result_set.h.
49 , item_seqs_(std::move(item_seqs))
50 , next_seq_(next_seq)
51 {
52 for (auto&& item : data_items) {
53 items_.emplace_back(item, serialization_service);
54 }
55 }
int32_t read_count() const
Returns the number of items that have been read before filtering.
◆ get_items()
const std::vector< typed_data > & hazelcast::client::rb::read_result_set::get_items |
( |
| ) |
const |
|
inline |
◆ get_next_sequence_to_read_from()
int64_t hazelcast::client::rb::read_result_set::get_next_sequence_to_read_from |
( |
| ) |
const |
|
inline |
Returns the sequence of the item following the last read item.
This sequence can then be used to read items following the ones returned by this result set. Usually this sequence is equal to the sequence used to retrieve this result set incremented by the readCount()
. In cases when the reader tolerates lost items, this is not the case. For instance, if the reader requests an item with a stale sequence (one which has already been overwritten), the read will jump to the oldest sequence and read from there. Similarly, if the reader requests an item in the future (e.g. because the partition was lost and the reader was unaware of this), the read method will jump back to the newest available sequence. Because of these jumps and only in the case when the reader is loss tolerant, the next sequence must be retrieved using this method. A return value of {@value SEQUENCE_UNAVAILABLE} means that the information is not available.
- Returns
- the sequence of the item following the last item in the result set
- Since
- 3.10
Definition at line 118 of file read_result_set.h.
◆ get_sequence()
int64_t hazelcast::client::rb::read_result_set::get_sequence |
( |
int32_t | index | ) |
const |
|
inline |
Return the sequence number for the item at the given index.
- Parameters
-
- Returns
- the sequence number for the ringbuffer item
- Exceptions
-
illegal_argument | if index out of bounds. |
- Since
- 3.9
Definition at line 82 of file read_result_set.h.
83 {
84 if (index >= (int32_t)item_seqs_->size() || index < 0) {
85 BOOST_THROW_EXCEPTION(
86 (exception::exception_builder<exception::illegal_argument>(
87 "read_result_set::getSequence")
88 << "Index " << index
89 << " is out of bounds. Sequences size is:" << item_seqs_->size())
90 .build());
91 }
92
93 return (*item_seqs_)[index];
94 }
◆ read_count()
int32_t hazelcast::client::rb::read_result_set::read_count |
( |
| ) |
const |
|
inline |
Returns the number of items that have been read before filtering.
If no filter is set, then the readCount
will be equal to size
. But if a filter is applied, it could be that items are read, but are filtered out. So if you are trying to make another read based on the read_result_set
then you should increment the sequence by readCount
and not by size()
. Otherwise you will be re-reading the same filtered messages.
- Returns
- the number of items read (including the filtered ones).
Definition at line 70 of file read_result_set.h.
70{ return items_read_count_; }
◆ SEQUENCE_UNAVAILABLE
const int64_t hazelcast::client::rb::read_result_set::SEQUENCE_UNAVAILABLE = -1 |
|
static |
Value returned from methods returning a sequence number when the information is not available (e.g.
because of rolling upgrade and some members not returning the sequence).
Definition at line 40 of file read_result_set.h.
The documentation for this class was generated from the following file: