ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [06/25] ignite git commit: IGNITE-5896: Preparing base client request for integration with thin client.
Date Fri, 15 Sep 2017 08:08:35 GMT
IGNITE-5896: Preparing base client request for integration with thin client.


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

Branch: refs/heads/ignite-6149
Commit: 22b157865c304be4d13fcca6f435d2fcad842d00
Parents: 0542c76
Author: devozerov <vozerov@gridgain.com>
Authored: Wed Sep 13 13:46:13 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Wed Sep 13 13:46:13 2017 +0300

----------------------------------------------------------------------
 .../processors/odbc/SqlListenerNioListener.java | 11 +++-----
 .../processors/odbc/SqlListenerRequest.java     | 16 ++---------
 .../processors/odbc/SqlListenerRequestNoId.java | 28 ++++++++++++++++++++
 .../processors/odbc/jdbc/JdbcRequest.java       |  4 +--
 .../processors/odbc/odbc/OdbcRequest.java       |  4 +--
 5 files changed, 37 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/22b15786/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerNioListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerNioListener.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerNioListener.java
index e2d444b..98cd8ea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerNioListener.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerNioListener.java
@@ -47,9 +47,6 @@ public class SqlListenerNioListener extends GridNioServerListenerAdapter<byte[]>
     /** Connection-related metadata key. */
     private static final int CONN_CTX_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
 
-    /** Request ID generator. */
-    private static final AtomicLong REQ_ID_GEN = new AtomicLong();
-
     /** Busy lock. */
     private final GridSpinBusyLock busyLock;
 
@@ -123,15 +120,13 @@ public class SqlListenerNioListener extends GridNioServerListenerAdapter<byte[]>
 
         assert req != null;
 
-        req.requestId(REQ_ID_GEN.incrementAndGet());
-
         try {
             long startTime = 0;
 
             if (log.isDebugEnabled()) {
                 startTime = System.nanoTime();
 
-                log.debug("SQL client request received [reqId=" + req.requestId() + ", addr="
+
+                log.debug("Client request received [reqId=" + req.requestId() + ", addr="
+
                     ses.remoteAddress() + ", req=" + req + ']');
             }
 
@@ -140,7 +135,7 @@ public class SqlListenerNioListener extends GridNioServerListenerAdapter<byte[]>
             if (log.isDebugEnabled()) {
                 long dur = (System.nanoTime() - startTime) / 1000;
 
-                log.debug("SQL client request processed [reqId=" + req.requestId() + ", dur(mcs)="
+ dur  +
+                log.debug("Client request processed [reqId=" + req.requestId() + ", dur(mcs)="
+ dur  +
                     ", resp=" + resp.status() + ']');
             }
 
@@ -149,7 +144,7 @@ public class SqlListenerNioListener extends GridNioServerListenerAdapter<byte[]>
             ses.send(outMsg);
         }
         catch (Exception e) {
-            log.error("Failed to process SQL client request [req=" + req + ']', e);
+            log.error("Failed to process client request [req=" + req + ']', e);
 
             ses.send(parser.encode(handler.handleException(e)));
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/22b15786/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java
index 3c74752..5b1c5fb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java
@@ -20,24 +20,12 @@ package org.apache.ignite.internal.processors.odbc;
 /**
  * SQL listener command request.
  */
-public abstract class SqlListenerRequest {
+public interface SqlListenerRequest {
     /** Handshake request. */
     public static final int HANDSHAKE = 1;
 
-    /** Request ID. */
-    private long reqId;
-
     /**
      * @return Request ID.
      */
-    public long requestId() {
-        return reqId;
-    }
-
-    /**
-     * @param reqId Request ID.
-     */
-    public void requestId(long reqId) {
-        this.reqId = reqId;
-    }
+    public long requestId();
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/22b15786/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequestNoId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequestNoId.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequestNoId.java
new file mode 100644
index 0000000..68dbc5c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequestNoId.java
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+package org.apache.ignite.internal.processors.odbc;
+
+/**
+ * Client request with no ID.
+ */
+public abstract class SqlListenerRequestNoId implements SqlListenerRequest {
+    /** {@inheritDoc} */
+    @Override public long requestId() {
+        return 0;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/22b15786/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequest.java
index 4ef75f6..ab97dc5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequest.java
@@ -21,12 +21,12 @@ import org.apache.ignite.IgniteException;
 import org.apache.ignite.binary.BinaryObjectException;
 import org.apache.ignite.internal.binary.BinaryReaderExImpl;
 import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.processors.odbc.SqlListenerRequest;
+import org.apache.ignite.internal.processors.odbc.SqlListenerRequestNoId;
 
 /**
  * JDBC request.
  */
-public class JdbcRequest extends SqlListenerRequest implements JdbcRawBinarylizable {
+public class JdbcRequest extends SqlListenerRequestNoId implements JdbcRawBinarylizable {
     /** Execute sql query request. */
     static final byte QRY_EXEC = 2;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/22b15786/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequest.java
index 62c4de3..58ffad6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequest.java
@@ -17,12 +17,12 @@
 
 package org.apache.ignite.internal.processors.odbc.odbc;
 
-import org.apache.ignite.internal.processors.odbc.SqlListenerRequest;
+import org.apache.ignite.internal.processors.odbc.SqlListenerRequestNoId;
 
 /**
  * SQL listener command request.
  */
-public class OdbcRequest extends SqlListenerRequest {
+public class OdbcRequest extends SqlListenerRequestNoId {
     /** Execute sql query. */
     public static final int QRY_EXEC = 2;
 


Mime
View raw message