Apache Ignite C++
thin-client/include/ignite/thin/cache/query/query_scan.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
23 #ifndef _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
24 #define _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
25 
26 #include <stdint.h>
27 #include <string>
28 #include <vector>
29 
30 #include <ignite/impl/thin/copyable_writable.h>
31 
32 namespace ignite
33 {
34  namespace impl
35  {
36  namespace thin
37  {
38  // Forward declaration
39  class ScanQueryRequest;
40  }
41  }
42 
43  namespace thin
44  {
45  namespace cache
46  {
47  namespace query
48  {
52  class ScanQuery
53  {
54  public:
55  friend class ScanQueryRequest;
56 
60  ScanQuery() : part(-1), pageSize(1024), loc(false)
61  {
62  // No-op.
63  }
64 
70  int32_t GetPartition() const
71  {
72  return part;
73  }
74 
80  void SetPartition(int32_t partition)
81  {
82  this->part = partition;
83  }
84 
90  int32_t GetPageSize() const
91  {
92  return pageSize;
93  }
94 
100  void SetPageSize(int32_t resultPageSize)
101  {
102  this->pageSize = resultPageSize;
103  }
104 
112  bool IsLocal() const
113  {
114  return loc;
115  }
116 
124  void SetLocal(bool localScan)
125  {
126  loc = localScan;
127  }
128 
129  private:
131  int32_t part;
132 
134  int32_t pageSize;
135 
137  bool loc;
138  };
139  }
140  }
141  }
142 }
143 
144 #endif //_IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
ignite
Apache Ignite API.
Definition: cache.h:48
ignite::thin::cache::query::ScanQuery::GetPartition
int32_t GetPartition() const
Get partition to scan.
Definition: thin-client/include/ignite/thin/cache/query/query_scan.h:70
ignite::thin::cache::query::ScanQuery::SetLocal
void SetLocal(bool localScan)
Set local flag.
Definition: thin-client/include/ignite/thin/cache/query/query_scan.h:124
ignite::thin::cache::query::ScanQuery
Scan query.
Definition: thin-client/include/ignite/thin/cache/query/query_scan.h:52
ignite::thin::cache::query::ScanQuery::ScanQuery
ScanQuery()
Default constructor.
Definition: thin-client/include/ignite/thin/cache/query/query_scan.h:60
ignite::thin::cache::query::ScanQuery::SetPartition
void SetPartition(int32_t partition)
Set partition to scan.
Definition: thin-client/include/ignite/thin/cache/query/query_scan.h:80
ignite::thin::cache::query::ScanQuery::GetPageSize
int32_t GetPageSize() const
Get page size.
Definition: thin-client/include/ignite/thin/cache/query/query_scan.h:90
ignite::thin::cache::query::ScanQuery::SetPageSize
void SetPageSize(int32_t resultPageSize)
Set the size of the result page.
Definition: thin-client/include/ignite/thin/cache/query/query_scan.h:100
ignite::thin::cache::query::ScanQuery::IsLocal
bool IsLocal() const
Get local flag.
Definition: thin-client/include/ignite/thin/cache/query/query_scan.h:112