ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-5896: Base thin client requests.
Date Wed, 13 Sep 2017 10:56:28 GMT
Repository: ignite
Updated Branches:
  refs/heads/master c105f03f8 -> 2b5224f5e


IGNITE-5896: Base thin client requests.


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

Branch: refs/heads/master
Commit: 2b5224f5e1a22f57595c8c2144e0e759b2454082
Parents: c105f03
Author: Pavel Tupitsyn <ptupitsyn@apache.org>
Authored: Wed Sep 13 13:56:18 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Wed Sep 13 13:56:18 2017 +0300

----------------------------------------------------------------------
 .../platform/client/ClientBooleanResponse.java  | 46 +++++++++++++++++
 .../platform/client/ClientObjectResponse.java   | 46 +++++++++++++++++
 .../platform/client/ClientRequest.java          | 53 ++++++++++++++++++++
 .../platform/client/ClientResponse.java         | 47 +++++++++++++++++
 4 files changed, 192 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2b5224f5/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientBooleanResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientBooleanResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientBooleanResponse.java
new file mode 100644
index 0000000..7ab3dc7
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientBooleanResponse.java
@@ -0,0 +1,46 @@
+/*
+ * 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.platform.client;
+
+import org.apache.ignite.binary.BinaryRawWriter;
+
+/**
+ * Boolean response.
+ */
+public class ClientBooleanResponse extends ClientResponse {
+    /** */
+    private final boolean val;
+
+    /**
+     * Constructor.
+     *
+     * @param reqId Request id.
+     */
+    public ClientBooleanResponse(long reqId, boolean val) {
+        super(reqId);
+
+        this.val = val;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void encode(BinaryRawWriter writer) {
+        super.encode(writer);
+
+        writer.writeBoolean(val);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/2b5224f5/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientObjectResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientObjectResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientObjectResponse.java
new file mode 100644
index 0000000..fc851a3
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientObjectResponse.java
@@ -0,0 +1,46 @@
+/*
+ * 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.platform.client;
+
+import org.apache.ignite.binary.BinaryRawWriter;
+
+/**
+ * Single object response.
+ */
+public class ClientObjectResponse extends ClientResponse {
+    /** */
+    private final Object val;
+
+    /**
+     * Constructor.
+     *
+     * @param reqId Request id.
+     */
+    public ClientObjectResponse(long reqId, Object val) {
+        super(reqId);
+
+        this.val = val;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void encode(BinaryRawWriter writer) {
+        super.encode(writer);
+
+        writer.writeObject(val);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/2b5224f5/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
new file mode 100644
index 0000000..c16d481
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
@@ -0,0 +1,53 @@
+/*
+ * 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.platform.client;
+
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.odbc.SqlListenerRequest;
+
+/**
+ * Thin client request.
+ */
+public class ClientRequest implements SqlListenerRequest {
+    /** Request id. */
+    private final long reqId;
+
+    /**
+     * Constructor.
+     *
+     * @param reader Reader.
+     */
+    public ClientRequest(BinaryRawReader reader) {
+        reqId = reader.readLong();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long requestId() {
+        return reqId;
+    }
+
+    /**
+     * Processes the request.
+     *
+     * @return Response.
+     */
+    public ClientResponse process(GridKernalContext ctx) {
+        return new ClientResponse(reqId);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/2b5224f5/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientResponse.java
new file mode 100644
index 0000000..6f2e8d6
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientResponse.java
@@ -0,0 +1,47 @@
+/*
+ * 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.platform.client;
+
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.internal.processors.odbc.SqlListenerResponse;
+
+/**
+ * Thin client response.
+ */
+public class ClientResponse extends SqlListenerResponse {
+    /** Request id. */
+    private final long reqId;
+
+    /**
+     * Constructor.
+     *
+     * @param reqId Request id.
+     */
+    public ClientResponse(long reqId) {
+        super(STATUS_SUCCESS, null);
+
+        this.reqId = reqId;
+    }
+
+    /**
+     * Encodes the response data.
+     */
+    public void encode(BinaryRawWriter writer) {
+        writer.writeLong(reqId);
+    }
+}


Mime
View raw message