You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/09/02 14:04:25 UTC

[GitHub] [ignite-3] pavlukhin commented on a change in pull request #284: IGNITE-15186 Implement basic JDBC client: Statement, ResultSet

pavlukhin commented on a change in pull request #284:
URL: https://github.com/apache/ignite-3/pull/284#discussion_r701116454



##########
File path: modules/client-common/src/main/java/org/apache/ignite/client/proto/ClientMessageUnpacker.java
##########
@@ -584,6 +606,92 @@ public Object unpackObject(int dataType) {
         throw new IgniteException("Unknown client data type: " + dataType);
     }
 
+    /**
+     * Packs an object.
+     *
+     * @return Object array.
+     * @throws IllegalStateException in case of unexpected value type.
+     */
+    public Object[] unpackObjectArray() {
+        assert refCnt > 0 : "Unpacker is closed";
+
+        if (tryUnpackNil())
+            return null;
+
+        int size = unpackArrayHeader();
+
+        if (size == 0)
+            return ArrayUtils.OBJECT_EMPTY_ARRAY;
+
+        Object[] args = new Object[size];
+
+        for (int i = 0; i < size; i++) {
+            MessageFormat format = getNextFormat();
+
+            switch (format) {
+                case NIL:
+                    unpackNil();
+
+                    break;
+                case BOOLEAN:
+                    args[i] = unpackBoolean();
+
+                    break;
+                case FLOAT32:
+                    args[i] = unpackFloat();
+
+                    break;
+                case FLOAT64:
+                    args[i] = unpackDouble();
+
+                    break;
+                case POSFIXINT:
+                    args[i] = extractExtendedValue(unpackInt());

Review comment:
       I believe a wrong mention, is not it?




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org