NCBI C++ ToolKit
runner.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /*****************************************************************************
2  * $Id: runner.hpp 100970 2023-10-06 14:32:13Z saprykin $
3  * ===========================================================================
4  *
5  * PUBLIC DOMAIN NOTICE
6  * National Center for Biotechnology Information
7  *
8  * This software/database is a "United States Government Work" under the
9  * terms of the United States Copyright Act. It was written as part of
10  * the author's official duties as a United States Government employee and
11  * thus cannot be copyrighted. This software/database is freely available
12  * to the public for use. The National Library of Medicine and the U.S.
13  * Government have not placed any restriction on its use or reproduction.
14  *
15  * Although all reasonable efforts have been taken to ensure the accuracy
16  * and reliability of the software and data, the NLM and the U.S.
17  * Government do not and cannot warrant the performance or results that
18  * may be obtained by using this software or data. The NLM and the U.S.
19  * Government disclaim all warranties, express or implied, including
20  * warranties of performance, merchantability or fitness for any particular
21  * purpose.
22  *
23  * Please cite the author in any work or product based on this material.
24  *
25  * Db Cassandra: class managing Cassandra fullscans.
26  *
27  */
28 
29 #ifndef OBJTOOLS__PUBSEQ_GATEWAY__IMPL__CASSANDRA__FULLSCAN__RUNNER_HPP
30 #define OBJTOOLS__PUBSEQ_GATEWAY__IMPL__CASSANDRA__FULLSCAN__RUNNER_HPP
31 
32 #include <corelib/ncbistl.hpp>
33 
38 
39 #include <memory>
40 #include <mutex>
41 #include <vector>
42 #include <string>
43 
46 
48 {
49  public:
50  static const unsigned int kPageSizeDefault;
51  static const unsigned int kMaxActiveStatementsDefault;
52  static const unsigned int kMaxRetryCountDefault;
53 
59 
65  CCassandraFullscanRunner& SetExecutionPlan(unique_ptr<ICassandraFullscanPlan> plan);
66  CCassandraFullscanRunner& SetMaxRetryCount(unsigned int max_retry_count);
68 
69  bool Execute();
70  private:
71  size_t m_ThreadCount{1};
77  unique_ptr<ICassandraFullscanPlan> m_ExecutionPlan;
80 };
81 
83 
84 #endif // OBJTOOLS__PUBSEQ_GATEWAY__IMPL__CASSANDRA__FULLSCAN__RUNNER_HPP
#define END_IDBLOB_SCOPE
Definition: IdCassScope.hpp:40
#define BEGIN_IDBLOB_SCOPE
Definition: IdCassScope.hpp:39
CassConsistency TCassConsistency
Definition: cass_driver.hpp:98
static constexpr TCassConsistency kLocalQuorum
CCassandraFullscanRunner & operator=(const CCassandraFullscanRunner &)=delete
static const unsigned int kMaxRetryCountDefault
Definition: runner.hpp:52
CCassandraFullscanRunner & SetConsumerFactory(TCassandraFullscanConsumerFactory consumer_factory)
Definition: runner.cpp:78
unsigned int m_MaxActiveStatements
Definition: runner.hpp:74
unsigned int m_PageSize
Definition: runner.hpp:73
TCassandraFullscanConsumerFactory m_ConsumerFactory
Definition: runner.hpp:75
unsigned int m_MaxRetryCount
Definition: runner.hpp:78
CCassandraFullscanRunner & SetConsumerCreationPolicy(ECassandraFullscanConsumerPolicy policy)
Definition: runner.cpp:86
CCassandraFullscanRunner(const CCassandraFullscanRunner &)=delete
CCassandraFullscanRunner & SetConsistency(CassConsistency value)
Definition: runner.cpp:56
CCassandraFullscanRunner & SetMaxActiveStatements(unsigned int value)
Definition: runner.cpp:70
static const unsigned int kMaxActiveStatementsDefault
Definition: runner.hpp:51
static const unsigned int kPageSizeDefault
Definition: runner.hpp:50
CCassandraFullscanRunner & SetThreadCount(size_t value)
Definition: runner.cpp:50
CCassandraFullscanRunner & SetMaxRetryCount(unsigned int max_retry_count)
Definition: runner.cpp:105
CCassandraFullscanRunner & SetExecutionPlan(unique_ptr< ICassandraFullscanPlan > plan)
Definition: runner.cpp:92
ECassandraFullscanConsumerPolicy m_ConsumerCreationPolicy
Definition: runner.hpp:79
TCassConsistency m_Consistency
Definition: runner.hpp:72
CCassandraFullscanRunner & operator=(CCassandraFullscanRunner &&)=default
CCassandraFullscanRunner(CCassandraFullscanRunner &&)=default
unique_ptr< ICassandraFullscanPlan > m_ExecutionPlan
Definition: runner.hpp:77
CCassandraFullscanRunner & SetPageSize(unsigned int value)
Definition: runner.cpp:62
function< unique_ptr< ICassandraFullscanConsumer >()> TCassandraFullscanConsumerFactory
Definition: consumer.hpp:72
ECassandraFullscanConsumerPolicy
Definition: consumer.hpp:44
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
The NCBI C++/STL use hints.
BEGIN_IDBLOB_SCOPE USING_NCBI_SCOPE
Definition: runner.hpp:45
Modified on Mon Jun 24 05:24:26 2024 by modify_doxy.py rev. 669887