Repository: ignite
Updated Branches:
  refs/heads/master 3cb9e2582 -> 1142a3681


IGNITE-7860: JDBC thin: changed default socket buffer size to 64Kb. This closes 
#3600.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1142a368
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1142a368
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1142a368

Branch: refs/heads/master
Commit: 1142a368187a07fe91993edebb40bd027c7cb72a
Parents: 3cb9e25
Author: tledkov-gridgain <tled...@gridgain.com>
Authored: Tue Mar 13 12:37:29 2018 +0300
Committer: devozerov <voze...@gridgain.com>
Committed: Tue Mar 13 12:37:29 2018 +0300

----------------------------------------------------------------------
 .../ignite/jdbc/thin/JdbcThinConnectionSelfTest.java      | 10 ++++++----
 .../internal/jdbc/thin/ConnectionPropertiesImpl.java      |  7 +++++--
 2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1142a368/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
 
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
index ad98683..bdaa107 100644
--- 
a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
+++ 
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
@@ -155,6 +155,8 @@ public class JdbcThinConnectionSelfTest extends 
JdbcThinAbstractSelfTest {
      * @throws Exception If failed.
      */
     public void testSocketBuffers() throws Exception {
+        final int dfltDufSize = 64 * 1024;
+
         assertInvalid("jdbc:ignite:thin://127.0.0.1?socketSendBuffer=-1",
             "Property cannot be lower than 0 [name=socketSendBuffer, 
value=-1]");
 
@@ -162,18 +164,18 @@ public class JdbcThinConnectionSelfTest extends 
JdbcThinAbstractSelfTest {
             "Property cannot be lower than 0 [name=socketReceiveBuffer, 
value=-1]");
 
         try (Connection conn = 
DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1")) {
-            assertEquals(0, 
io(conn).connectionProperties().getSocketSendBuffer());
-            assertEquals(0, 
io(conn).connectionProperties().getSocketReceiveBuffer());
+            assertEquals(dfltDufSize, 
io(conn).connectionProperties().getSocketSendBuffer());
+            assertEquals(dfltDufSize, 
io(conn).connectionProperties().getSocketReceiveBuffer());
         }
 
         // Note that SO_* options are hints, so we check that value is equals 
to either what we set or to default.
         try (Connection conn = 
DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1?socketSendBuffer=1024"))
 {
             assertEquals(1024, 
io(conn).connectionProperties().getSocketSendBuffer());
-            assertEquals(0, 
io(conn).connectionProperties().getSocketReceiveBuffer());
+            assertEquals(dfltDufSize, 
io(conn).connectionProperties().getSocketReceiveBuffer());
         }
 
         try (Connection conn = 
DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1?socketReceiveBuffer=1024"))
 {
-            assertEquals(0, 
io(conn).connectionProperties().getSocketSendBuffer());
+            assertEquals(dfltDufSize, 
io(conn).connectionProperties().getSocketSendBuffer());
             assertEquals(1024, 
io(conn).connectionProperties().getSocketReceiveBuffer());
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/1142a368/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java
index 471381b..060c5bf 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java
@@ -38,6 +38,9 @@ public class ConnectionPropertiesImpl implements 
ConnectionProperties, Serializa
     /** Prefix for property names. */
     public static final String PROP_PREFIX = "ignite.jdbc.";
 
+    /** Default socket buffer size. */
+    private static final int DFLT_SOCK_BUFFER_SIZE = 64 * 1024;
+
     /** Host name property. */
     private StringProperty host = new StringProperty(
         "host", "Ignite node IP to connect", null, null, true,
@@ -80,12 +83,12 @@ public class ConnectionPropertiesImpl implements 
ConnectionProperties, Serializa
     /** Socket send buffer size property. */
     private IntegerProperty socketSendBuffer = new IntegerProperty(
         "socketSendBuffer", "Socket send buffer size",
-        0, false, 0, Integer.MAX_VALUE);
+        DFLT_SOCK_BUFFER_SIZE, false, 0, Integer.MAX_VALUE);
 
     /** Socket receive buffer size property. */
     private IntegerProperty socketReceiveBuffer = new IntegerProperty(
         "socketReceiveBuffer", "Socket send buffer size",
-        0, false, 0, Integer.MAX_VALUE);
+        DFLT_SOCK_BUFFER_SIZE, false, 0, Integer.MAX_VALUE);
 
     /** Executes update queries on ignite server nodes flag. */
     private BooleanProperty skipReducerOnUpdate = new BooleanProperty(

Reply via email to