github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/c-deps/libroach/iterator.h (about) 1 // Copyright 2018 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 #pragma once 12 13 #include <atomic> 14 #include <memory> 15 #include <rocksdb/iterator.h> 16 #include <rocksdb/write_batch.h> 17 #include "chunked_buffer.h" 18 19 struct DBIterator { 20 DBIterator(std::atomic<int64_t>* iters, DBIterOptions iter_options); 21 ~DBIterator(); 22 void SetLowerBound(DBKey key); 23 void SetUpperBound(DBKey key); 24 25 std::atomic<int64_t>* const iters_count; 26 std::unique_ptr<rocksdb::Iterator> rep; 27 std::unique_ptr<cockroach::chunkedBuffer> kvs; 28 std::unique_ptr<rocksdb::WriteBatch> intents; 29 std::unique_ptr<IteratorStats> stats; 30 std::string rev_resume_key; 31 32 rocksdb::ReadOptions read_opts; 33 std::string lower_bound_str; 34 std::string upper_bound_str; 35 rocksdb::Slice lower_bound; 36 rocksdb::Slice upper_bound; 37 };