You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/10/13 10:27:19 UTC

[3/8] ignite git commit: IGNITE-6024: SQL: Implemented "skipReducerOnUpdate" flag. This closes #2488.

http://git-wip-us.apache.org/repos/asf/ignite/blob/ae02a1d3/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
index 9b13481..d5aa0db 100644
--- a/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
+++ b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
@@ -180,6 +180,12 @@ namespace ignite
 
                     lazyCheckBox->SetEnabled(version >= ProtocolVersion::VERSION_2_1_5);
 
+                    skipReducerOnUpdateCheckBox = CreateCheckBox(editPosX + checkBoxSize + interval, rowPos,
+                        checkBoxSize, rowSize, "Skip reducer on update", ChildId::SKIP_REDUCER_ON_UPDATE_CHECK_BOX,
+                        config.IsSkipReducerOnUpdate());
+
+                    skipReducerOnUpdateCheckBox->SetEnabled(version >= ProtocolVersion::VERSION_2_3_0);
+
                     rowPos += interval * 2 + rowSize;
 
                     connectionSettingsGroupBox = CreateGroupBox(margin, sectionBegin, width - 2 * margin,
@@ -264,6 +270,13 @@ namespace ignite
                                     break;
                                 }
 
+                                case ChildId::SKIP_REDUCER_ON_UPDATE_CHECK_BOX:
+                                {
+                                    skipReducerOnUpdateCheckBox->SetChecked(!skipReducerOnUpdateCheckBox->IsChecked());
+
+                                    break;
+                                }
+
                                 case ChildId::PROTOCOL_VERSION_COMBO_BOX:
                                 {
                                     std::string versionStr;
@@ -271,6 +284,7 @@ namespace ignite
 
                                     ProtocolVersion version = ProtocolVersion::FromString(versionStr);
                                     lazyCheckBox->SetEnabled(version >= ProtocolVersion::VERSION_2_1_5);
+                                    skipReducerOnUpdateCheckBox->SetEnabled(version >= ProtocolVersion::VERSION_2_3_0);
 
                                     break;
                                 }
@@ -309,6 +323,7 @@ namespace ignite
                     bool replicatedOnly;
                     bool collocated;
                     bool lazy;
+                    bool skipReducerOnUpdate;
 
                     nameEdit->GetText(dsn);
                     addressEdit->GetText(address);
@@ -330,6 +345,9 @@ namespace ignite
                     collocated = collocatedCheckBox->IsEnabled() && collocatedCheckBox->IsChecked();
                     lazy = lazyCheckBox->IsEnabled() && lazyCheckBox->IsChecked();
 
+                    skipReducerOnUpdate =
+                        skipReducerOnUpdateCheckBox->IsEnabled() && skipReducerOnUpdateCheckBox->IsChecked();
+
                     LOG_MSG("Retriving arguments:");
                     LOG_MSG("DSN:                " << dsn);
                     LOG_MSG("Address:            " << address);
@@ -341,6 +359,7 @@ namespace ignite
                     LOG_MSG("Replicated only:    " << (replicatedOnly ? "true" : "false"));
                     LOG_MSG("Collocated:         " << (collocated ? "true" : "false"));
                     LOG_MSG("Lazy:               " << (lazy ? "true" : "false"));
+                    LOG_MSG("Skip reducer on update:   " << (skipReducerOnUpdate ? "true" : "false"));
 
                     if (dsn.empty())
                         throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, "DSN name can not be empty.");
@@ -355,6 +374,7 @@ namespace ignite
                     cfg.SetReplicatedOnly(replicatedOnly);
                     cfg.SetCollocated(collocated);
                     cfg.SetLazy(lazy);
+                    cfg.SetSkipReducerOnUpdate(skipReducerOnUpdate);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ae02a1d3/modules/platforms/cpp/odbc/src/config/configuration.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/config/configuration.cpp b/modules/platforms/cpp/odbc/src/config/configuration.cpp
index 95ed964..be5a781 100644
--- a/modules/platforms/cpp/odbc/src/config/configuration.cpp
+++ b/modules/platforms/cpp/odbc/src/config/configuration.cpp
@@ -32,34 +32,36 @@ namespace ignite
     {
         namespace config
         {
-            const std::string Configuration::Key::dsn               = "dsn";
-            const std::string Configuration::Key::driver            = "driver";
-            const std::string Configuration::Key::schema            = "schema";
-            const std::string Configuration::Key::address           = "address";
-            const std::string Configuration::Key::server            = "server";
-            const std::string Configuration::Key::port              = "port";
-            const std::string Configuration::Key::distributedJoins  = "distributed_joins";
-            const std::string Configuration::Key::enforceJoinOrder  = "enforce_join_order";
-            const std::string Configuration::Key::protocolVersion   = "protocol_version";
-            const std::string Configuration::Key::pageSize          = "page_size";
-            const std::string Configuration::Key::replicatedOnly    = "replicated_only";
-            const std::string Configuration::Key::collocated        = "collocated";
-            const std::string Configuration::Key::lazy              = "lazy";
-
-            const std::string Configuration::DefaultValue::dsn      = "Apache Ignite DSN";
-            const std::string Configuration::DefaultValue::driver   = "Apache Ignite";
-            const std::string Configuration::DefaultValue::schema   = "PUBLIC";
-            const std::string Configuration::DefaultValue::address  = "";
-            const std::string Configuration::DefaultValue::server   = "";
+            const std::string Configuration::Key::dsn                    = "dsn";
+            const std::string Configuration::Key::driver                 = "driver";
+            const std::string Configuration::Key::schema                 = "schema";
+            const std::string Configuration::Key::address                = "address";
+            const std::string Configuration::Key::server                 = "server";
+            const std::string Configuration::Key::port                   = "port";
+            const std::string Configuration::Key::distributedJoins       = "distributed_joins";
+            const std::string Configuration::Key::enforceJoinOrder       = "enforce_join_order";
+            const std::string Configuration::Key::protocolVersion        = "protocol_version";
+            const std::string Configuration::Key::pageSize               = "page_size";
+            const std::string Configuration::Key::replicatedOnly         = "replicated_only";
+            const std::string Configuration::Key::collocated             = "collocated";
+            const std::string Configuration::Key::lazy                   = "lazy";
+            const std::string Configuration::Key::skipReducerOnUpdate    = "skip_reducer_on_update";
+
+            const std::string Configuration::DefaultValue::dsn           = "Apache Ignite DSN";
+            const std::string Configuration::DefaultValue::driver        = "Apache Ignite";
+            const std::string Configuration::DefaultValue::schema        = "PUBLIC";
+            const std::string Configuration::DefaultValue::address       = "";
+            const std::string Configuration::DefaultValue::server        = "";
 
             const uint16_t Configuration::DefaultValue::port    = 10800;
             const int32_t Configuration::DefaultValue::pageSize = 1024;
 
-            const bool Configuration::DefaultValue::distributedJoins = false;
-            const bool Configuration::DefaultValue::enforceJoinOrder = false;
-            const bool Configuration::DefaultValue::replicatedOnly   = false;
-            const bool Configuration::DefaultValue::collocated       = false;
-            const bool Configuration::DefaultValue::lazy             = false;
+            const bool Configuration::DefaultValue::distributedJoins      = false;
+            const bool Configuration::DefaultValue::enforceJoinOrder      = false;
+            const bool Configuration::DefaultValue::replicatedOnly        = false;
+            const bool Configuration::DefaultValue::collocated            = false;
+            const bool Configuration::DefaultValue::lazy                  = false;
+            const bool Configuration::DefaultValue::skipReducerOnUpdate   = false;
 
             const ProtocolVersion& Configuration::DefaultValue::protocolVersion = ProtocolVersion::GetCurrent();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ae02a1d3/modules/platforms/cpp/odbc/src/connection.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/connection.cpp b/modules/platforms/cpp/odbc/src/connection.cpp
index 161e1c4..8f4bf14 100644
--- a/modules/platforms/cpp/odbc/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/src/connection.cpp
@@ -417,6 +417,7 @@ namespace ignite
             bool replicatedOnly = false;
             bool collocated = false;
             bool lazy = false;
+            bool skipReducerOnUpdate = false;
             ProtocolVersion protocolVersion;
 
             try
@@ -427,6 +428,7 @@ namespace ignite
                 replicatedOnly = config.IsReplicatedOnly();
                 collocated = config.IsCollocated();
                 lazy = config.IsLazy();
+                skipReducerOnUpdate = config.IsSkipReducerOnUpdate();
             }
             catch (const IgniteError& err)
             {
@@ -443,7 +445,8 @@ namespace ignite
                 return SqlResult::AI_ERROR;
             }
 
-            HandshakeRequest req(protocolVersion, distributedJoins, enforceJoinOrder, replicatedOnly, collocated, lazy);
+            HandshakeRequest req(protocolVersion, distributedJoins, enforceJoinOrder, replicatedOnly, collocated, lazy,
+                skipReducerOnUpdate);
             HandshakeResponse rsp;
 
             try

http://git-wip-us.apache.org/repos/asf/ignite/blob/ae02a1d3/modules/platforms/cpp/odbc/src/dsn_config.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/dsn_config.cpp b/modules/platforms/cpp/odbc/src/dsn_config.cpp
index c91cd8c..536f679 100644
--- a/modules/platforms/cpp/odbc/src/dsn_config.cpp
+++ b/modules/platforms/cpp/odbc/src/dsn_config.cpp
@@ -108,6 +108,9 @@ namespace ignite
 
             bool lazy = ReadDsnBool(dsn, Configuration::Key::lazy, config.IsLazy());
 
+            bool skipReducerOnUpdate =
+                ReadDsnBool(dsn, Configuration::Key::skipReducerOnUpdate, config.IsSkipReducerOnUpdate());
+
             std::string version = ReadDsnString(dsn, Configuration::Key::protocolVersion,
                 config.GetProtocolVersion().ToString().c_str());
 
@@ -125,6 +128,7 @@ namespace ignite
             config.SetReplicatedOnly(replicatedOnly);
             config.SetCollocated(collocated);
             config.SetLazy(lazy);
+            config.SetSkipReducerOnUpdate(skipReducerOnUpdate);
             config.SetProtocolVersion(version);
             config.SetPageSize(pageSize);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ae02a1d3/modules/platforms/cpp/odbc/src/message.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/message.cpp b/modules/platforms/cpp/odbc/src/message.cpp
index 3601591..4767c74 100644
--- a/modules/platforms/cpp/odbc/src/message.cpp
+++ b/modules/platforms/cpp/odbc/src/message.cpp
@@ -23,13 +23,14 @@ namespace ignite
     namespace odbc
     {
         HandshakeRequest::HandshakeRequest(const ProtocolVersion& version, bool distributedJoins,
-            bool enforceJoinOrder, bool replicatedOnly, bool collocated, bool lazy):
+            bool enforceJoinOrder, bool replicatedOnly, bool collocated, bool lazy, bool skipReducerOnUpdate):
             version(version),
             distributedJoins(distributedJoins),
             enforceJoinOrder(enforceJoinOrder),
             replicatedOnly(replicatedOnly),
             collocated(collocated),
-            lazy(lazy)
+            lazy(lazy),
+            skipReducerOnUpdate(skipReducerOnUpdate)
         {
             // No-op.
         }
@@ -53,7 +54,12 @@ namespace ignite
             writer.WriteBool(enforceJoinOrder);
             writer.WriteBool(replicatedOnly);
             writer.WriteBool(collocated);
-            writer.WriteBool(lazy);
+
+            if (version >= ProtocolVersion::VERSION_2_1_5)
+                writer.WriteBool(lazy);
+
+            if (version >= ProtocolVersion::VERSION_2_3_0)
+                writer.WriteBool(skipReducerOnUpdate);
         }
 
         QueryExecuteRequest::QueryExecuteRequest(const std::string& schema, const std::string& sql,

http://git-wip-us.apache.org/repos/asf/ignite/blob/ae02a1d3/modules/platforms/cpp/odbc/src/protocol_version.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/protocol_version.cpp b/modules/platforms/cpp/odbc/src/protocol_version.cpp
index b668fb8..b0b9121 100644
--- a/modules/platforms/cpp/odbc/src/protocol_version.cpp
+++ b/modules/platforms/cpp/odbc/src/protocol_version.cpp
@@ -28,10 +28,12 @@ namespace ignite
     {
         const ProtocolVersion ProtocolVersion::VERSION_2_1_0(2, 1, 0);
         const ProtocolVersion ProtocolVersion::VERSION_2_1_5(2, 1, 5);
+        const ProtocolVersion ProtocolVersion::VERSION_2_3_0(2, 3, 0);
 
         ProtocolVersion::VersionSet::value_type supportedArray[] = {
             ProtocolVersion::VERSION_2_1_0,
-            ProtocolVersion::VERSION_2_1_5
+            ProtocolVersion::VERSION_2_1_5,
+            ProtocolVersion::VERSION_2_3_0,
         };
 
         const ProtocolVersion::VersionSet ProtocolVersion::supported(supportedArray,
@@ -60,7 +62,7 @@ namespace ignite
 
         const ProtocolVersion& ProtocolVersion::GetCurrent()
         {
-            return VERSION_2_1_5;
+            return VERSION_2_3_0;
         }
 
         void ThrowParseError()