ptupitsyn commented on code in PR #10033:
URL: https://github.com/apache/ignite/pull/10033#discussion_r880221181


##########
modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_scan.h:
##########
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file
+ * Declares ignite::thin::cache::query::ScanQuery class.
+ */
+
+#ifndef _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
+#define _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include <ignite/impl/thin/copyable_writable.h>
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace thin
+        {
+            // Forward declaration
+            class ScanQueryRequest;
+        }
+    }
+
+    namespace thin
+    {
+        namespace cache
+        {
+            namespace query
+            {
+               /**
+                * Scan query.
+                */
+                class ScanQuery
+                {
+                public:
+                    friend class ScanQueryRequest;
+
+                    /**
+                     * Default constructor.
+                     */
+                    ScanQuery() : part(-1), pageSize(1024), loc(false)
+                    {
+                        // No-op.
+                    }
+
+                    /**
+                     * Constructor.
+                     *
+                     * @param part Partition.
+                     */
+                    ScanQuery(int32_t part) : part(part), pageSize(1024), 
loc(false)
+                    {
+                        // No-op.
+                    }
+
+                    /**
+                     * Get partition to scan.
+                     *
+                     * @return Partition to scan.
+                     */
+                    int32_t GetPartition() const
+                    {
+                        return part;
+                    }
+
+                    /**
+                     * Set partition to scan.
+                     *
+                     * @param partition Partition to scan.
+                     */
+                    void SetPartition(int32_t partition)
+                    {
+                        this->part = partition;
+                    }
+
+                    /**
+                     * Get page size.
+                     *
+                     * @return Page size.
+                     */
+                    int32_t GetPageSize() const
+                    {
+                        return pageSize;
+                    }
+
+                    /**
+                     * Set the size of the resul page.

Review Comment:
   ```suggestion
                        * Set the size of the result page.
   ```



##########
modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_scan.h:
##########
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file
+ * Declares ignite::thin::cache::query::ScanQuery class.
+ */
+
+#ifndef _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
+#define _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include <ignite/impl/thin/copyable_writable.h>
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace thin
+        {
+            // Forward declaration
+            class ScanQueryRequest;
+        }
+    }
+
+    namespace thin
+    {
+        namespace cache
+        {
+            namespace query
+            {
+               /**
+                * Scan query.
+                */
+                class ScanQuery
+                {
+                public:
+                    friend class ScanQueryRequest;
+
+                    /**
+                     * Default constructor.
+                     */
+                    ScanQuery() : part(-1), pageSize(1024), loc(false)
+                    {
+                        // No-op.
+                    }
+
+                    /**
+                     * Constructor.
+                     *
+                     * @param part Partition.
+                     */
+                    ScanQuery(int32_t part) : part(part), pageSize(1024), 
loc(false)

Review Comment:
   Not sure about a dedicated constructor only for the `partition` property. We 
could create a constructor with all properties, but in my opinion, a single 
default constructor is enough.



##########
modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_scan.h:
##########
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file
+ * Declares ignite::thin::cache::query::ScanQuery class.
+ */
+
+#ifndef _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
+#define _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include <ignite/impl/thin/copyable_writable.h>
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace thin
+        {
+            // Forward declaration
+            class ScanQueryRequest;
+        }
+    }
+
+    namespace thin
+    {
+        namespace cache
+        {
+            namespace query
+            {
+               /**
+                * Scan query.
+                */
+                class ScanQuery
+                {
+                public:
+                    friend class ScanQueryRequest;
+
+                    /**
+                     * Default constructor.
+                     */
+                    ScanQuery() : part(-1), pageSize(1024), loc(false)
+                    {
+                        // No-op.
+                    }
+
+                    /**
+                     * Constructor.
+                     *
+                     * @param part Partition.
+                     */
+                    ScanQuery(int32_t part) : part(part), pageSize(1024), 
loc(false)
+                    {
+                        // No-op.
+                    }
+
+                    /**
+                     * Get partition to scan.
+                     *
+                     * @return Partition to scan.
+                     */
+                    int32_t GetPartition() const
+                    {
+                        return part;
+                    }
+
+                    /**
+                     * Set partition to scan.

Review Comment:
   ```suggestion
                        * Sets partition to scan.
   ```
   
   (here and above/below - I think gets/sets instead of get/set is preferred)



##########
modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_scan.h:
##########
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file
+ * Declares ignite::thin::cache::query::ScanQuery class.
+ */
+
+#ifndef _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
+#define _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include <ignite/impl/thin/copyable_writable.h>
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace thin
+        {
+            // Forward declaration
+            class ScanQueryRequest;
+        }
+    }
+
+    namespace thin
+    {
+        namespace cache
+        {
+            namespace query
+            {
+               /**
+                * Scan query.
+                */
+                class ScanQuery
+                {
+                public:
+                    friend class ScanQueryRequest;
+
+                    /**
+                     * Default constructor.
+                     */
+                    ScanQuery() : part(-1), pageSize(1024), loc(false)
+                    {
+                        // No-op.
+                    }
+
+                    /**
+                     * Constructor.
+                     *
+                     * @param part Partition.
+                     */
+                    ScanQuery(int32_t part) : part(part), pageSize(1024), 
loc(false)
+                    {
+                        // No-op.
+                    }
+
+                    /**
+                     * Get partition to scan.
+                     *
+                     * @return Partition to scan.
+                     */
+                    int32_t GetPartition() const
+                    {
+                        return part;
+                    }
+
+                    /**
+                     * Set partition to scan.
+                     *
+                     * @param partition Partition to scan.
+                     */
+                    void SetPartition(int32_t partition)
+                    {
+                        this->part = partition;
+                    }
+
+                    /**
+                     * Get page size.
+                     *
+                     * @return Page size.
+                     */
+                    int32_t GetPageSize() const
+                    {
+                        return pageSize;
+                    }
+
+                    /**
+                     * Set the size of the resul page.
+                     *
+                     * @param resultPageSize Result page size.
+                     */
+                    void SetPageSize(int32_t resultPageSize)
+                    {
+                        this->pageSize = resultPageSize;
+                    }
+
+                    /**
+                     * Get local flag.
+                     *
+                     * @return Local flag.
+                     */
+                    bool IsLocal() const
+                    {
+                        return loc;
+                    }
+
+                    /**
+                     * Set local flag.

Review Comment:
   Should we provide more details here - what does it mean to do a local query?



##########
modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_scan.h:
##########
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file
+ * Declares ignite::thin::cache::query::ScanQuery class.
+ */
+
+#ifndef _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
+#define _IGNITE_THIN_CACHE_QUERY_QUERY_SCAN
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include <ignite/impl/thin/copyable_writable.h>
+
+namespace ignite
+{
+    namespace impl
+    {
+        namespace thin
+        {
+            // Forward declaration
+            class ScanQueryRequest;
+        }
+    }
+
+    namespace thin
+    {
+        namespace cache
+        {
+            namespace query
+            {
+               /**
+                * Scan query.
+                */
+                class ScanQuery
+                {
+                public:
+                    friend class ScanQueryRequest;
+
+                    /**
+                     * Default constructor.
+                     */
+                    ScanQuery() : part(-1), pageSize(1024), loc(false)
+                    {
+                        // No-op.
+                    }
+
+                    /**
+                     * Constructor.
+                     *
+                     * @param part Partition.
+                     */
+                    ScanQuery(int32_t part) : part(part), pageSize(1024), 
loc(false)
+                    {
+                        // No-op.
+                    }
+
+                    /**
+                     * Get partition to scan.

Review Comment:
   ```suggestion
                        * Gets partition to scan.
   ```



##########
modules/platforms/cpp/thin-client/src/impl/cache/cache_client_impl.cpp:
##########
@@ -369,6 +369,24 @@ namespace ignite
                     return cursorImpl;
                 }
 
+                query::SP_QueryCursorImpl CacheClientImpl::Query(const 
ignite::thin::cache::query::ScanQuery& qry)
+                {
+                    ScanQueryRequest req(id, qry);
+                    ScanQueryResponse rsp;
+
+                    SP_DataChannel channel = SyncMessageSql(req, rsp);

Review Comment:
   Sql?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to