WIP. Implemented message write logic.

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

Branch: refs/heads/ignite-3553
Commit: 72b4eb581541163ed4b98ac97e5e26878f52ae89
Parents: 6917ec4
Author: vozerov-gridgain <voze...@gridgain.com>
Authored: Tue Jul 26 11:05:58 2016 +0300
Committer: vozerov-gridgain <voze...@gridgain.com>
Committed: Tue Jul 26 11:05:58 2016 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/GridTopic.java   |   5 +-
 .../communication/GridIoMessageFactory.java     |  12 ++
 .../internal/processors/igfs/IgfsManager.java   |   8 +-
 .../igfs/client/IgfsClientAbstractCallable.java |  51 +++++++
 .../igfs/client/IgfsClientAffinityCallable.java |  22 +++
 .../igfs/client/IgfsClientClosureManager.java   |  94 ++++++++++++
 .../igfs/client/IgfsClientClosureRequest.java   | 144 +++++++++++++++++++
 .../igfs/client/IgfsClientClosureResponse.java  |  32 +++++
 .../igfs/client/IgfsClientDeleteCallable.java   |  13 ++
 .../igfs/client/IgfsClientMkdirsCallable.java   |  14 ++
 .../igfs/client/IgfsClientRenameCallable.java   |  14 ++
 .../igfs/client/IgfsClientSetTimesCallable.java |  19 +++
 .../igfs/client/IgfsClientSizeCallable.java     |   1 -
 .../igfs/client/IgfsClientUpdateCallable.java   |  14 ++
 14 files changed, 437 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java 
b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
index 248f75b..e5d47c0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java
@@ -94,7 +94,10 @@ public enum GridTopic {
     TOPIC_QUERY,
 
     /** */
-    TOPIC_TX;
+    TOPIC_TX,
+
+    /** Topic to handle IGFS closures. */
+    TOPIC_IGFS_CLO;
 
     /** Enum values. */
     private static final GridTopic[] VALS = values();

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
index 5f60215..b0f75dc 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
@@ -120,6 +120,8 @@ import 
org.apache.ignite.internal.processors.igfs.IgfsFileAffinityRange;
 import org.apache.ignite.internal.processors.igfs.IgfsFragmentizerRequest;
 import org.apache.ignite.internal.processors.igfs.IgfsFragmentizerResponse;
 import org.apache.ignite.internal.processors.igfs.IgfsSyncMessage;
+import 
org.apache.ignite.internal.processors.igfs.client.IgfsClientClosureRequest;
+import 
org.apache.ignite.internal.processors.igfs.client.IgfsClientClosureResponse;
 import 
org.apache.ignite.internal.processors.query.h2.twostep.messages.GridQueryCancelRequest;
 import 
org.apache.ignite.internal.processors.query.h2.twostep.messages.GridQueryFailResponse;
 import 
org.apache.ignite.internal.processors.query.h2.twostep.messages.GridQueryNextPageRequest;
@@ -160,6 +162,16 @@ public class GridIoMessageFactory implements 
MessageFactory {
         Message msg = null;
 
         switch (type) {
+            case -28:
+                msg = new IgfsClientClosureResponse();
+
+                break;
+
+            case -27:
+                msg = new IgfsClientClosureRequest();
+
+                break;
+
             case -26:
                 msg = new TxLockList();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsManager.java
index 1217d0b..cdd277b 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsManager.java
@@ -129,27 +129,27 @@ public abstract class IgfsManager {
      * @return Start info.
      */
     protected String startInfo() {
-        return "Cache manager started: " + getClass().getSimpleName();
+        return "IGFS manager started: " + getClass().getSimpleName();
     }
 
     /**
      * @return Stop info.
      */
     protected String stopInfo() {
-        return "Cache manager stopped: " + getClass().getSimpleName();
+        return "IGFS manager stopped: " + getClass().getSimpleName();
     }
 
     /**
      * @return Start info.
      */
     protected String kernalStartInfo() {
-        return "Cache manager received onKernalStart() callback: " + 
getClass().getSimpleName();
+        return "IGFS manager received onKernalStart() callback: " + 
getClass().getSimpleName();
     }
 
     /**
      * @return Stop info.
      */
     protected String kernalStopInfo() {
-        return "Cache manager received onKernalStop() callback: " + 
getClass().getSimpleName();
+        return "IGFS manager received onKernalStop() callback: " + 
getClass().getSimpleName();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
index d9c3456..85d4aea 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
@@ -29,6 +29,7 @@ import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.processors.igfs.IgfsEx;
 import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 import org.apache.ignite.resources.IgniteInstanceResource;
 import org.jetbrains.annotations.Nullable;
 
@@ -39,6 +40,9 @@ public abstract class IgfsClientAbstractCallable<T> 
implements IgniteCallable<T>
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Base fields count. */
+    private static final byte BASE_FIELDS_CNT = 2;
+
     /** IGFS name. */
     protected String igfsName;
 
@@ -122,4 +126,51 @@ public abstract class IgfsClientAbstractCallable<T> 
implements IgniteCallable<T>
     protected void readBinary0(BinaryRawReader rawReader) {
         // No-op.
     }
+
+    /**
+     * @return Fields count.
+     */
+    public final byte fieldsCount() {
+        return (byte)(BASE_FIELDS_CNT + fieldsCount0());
+    }
+
+    /**
+     * @return Additional fields count of concrete class.
+     */
+    protected byte fieldsCount0() {
+        return 0;
+    }
+
+    /**
+     * Write callable to writer.
+     *
+     * @param writer Writer.
+     * @param fieldId Field ID.
+     * @return Result.
+     */
+    public final boolean writeTo(MessageWriter writer, int fieldId) {
+        switch (fieldId) {
+            case 0:
+                return writer.writeString("igfsName", igfsName);
+
+            case 1:
+                return writer.writeString("path", path.toString());
+
+            default:
+                return writeTo0(writer, fieldId - BASE_FIELDS_CNT);
+        }
+    }
+
+    /**
+     * Write callable to writer (for child classes).
+     *
+     * @param writer Writer.
+     * @param fieldId Field ID.
+     * @return Result.
+     */
+    protected boolean writeTo0(MessageWriter writer, int fieldId) {
+        assert false : "Should not be called.";
+
+        return true;
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
index 1668f36..3a63b77 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
@@ -24,6 +24,7 @@ import org.apache.ignite.igfs.IgfsBlockLocation;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.Collection;
@@ -88,6 +89,27 @@ public class IgfsClientAffinityCallable extends 
IgfsClientAbstractCallable<Colle
     }
 
     /** {@inheritDoc} */
+    @Override protected byte fieldsCount0() {
+        return 3;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean writeTo0(MessageWriter writer, int fieldId) {
+        switch (fieldId) {
+            case 0:
+                return writer.writeLong("start", start);
+
+            case 1:
+                return writer.writeLong("len", len);
+
+            default:
+                assert fieldId == 2;
+
+                return writer.writeLong("maxLen", maxLen);
+        }
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientAffinityCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureManager.java
new file mode 100644
index 0000000..7230cf2
--- /dev/null
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureManager.java
@@ -0,0 +1,94 @@
+/*
+ * 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.igfs.client;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.configuration.FileSystemConfiguration;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
+import org.apache.ignite.internal.processors.igfs.IgfsManager;
+import org.apache.ignite.internal.util.GridStripedSpinBusyLock;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.marshaller.Marshaller;
+
+import java.util.concurrent.ConcurrentLinkedDeque;
+
+/**
+ * Manager to handle IGFS client closures.
+ */
+public class IgfsClientClosureManager extends IgfsManager {
+    /** Busy lock. */
+    private final GridStripedSpinBusyLock busyLock = new 
GridStripedSpinBusyLock();
+
+    /** Pending closures received when manager is not started yet. */
+    private final ConcurrentLinkedDeque startupClos = new 
ConcurrentLinkedDeque();
+
+    /** Kernal context. */
+    private GridKernalContext ctx;
+
+    /** IGFS configuration. */
+    private FileSystemConfiguration igfsCfg;
+
+    /** Marshaller. */
+    private Marshaller marsh;
+
+    /** {@inheritDoc} */
+    @Override protected void start0() throws IgniteCheckedException {
+        ctx = igfsCtx.kernalContext();
+
+        igfsCfg = igfsCtx.configuration();
+
+        marsh = ctx.config().getMarshaller();
+
+        ctx.discovery().setCustomEventListener();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void onKernalStart0() throws IgniteCheckedException {
+        // TODO
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void onKernalStop0(boolean cancel) {
+        // TODO
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void stop0(boolean cancel) {
+        // TODO
+    }
+
+    /**
+     * Execute callable.
+     *
+     * @param clo Closure.
+     * @return Result.
+     */
+    public <T> T execute(IgfsClientAbstractCallable<T> clo) {
+
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgfsClientClosureManager.class, this);
+    }
+
+    private class DiscoveryListener implements GridLocalEventListener {
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureRequest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureRequest.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureRequest.java
new file mode 100644
index 0000000..a0bc3f4
--- /dev/null
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureRequest.java
@@ -0,0 +1,144 @@
+/*
+ * 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.igfs.client;
+
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.plugin.extensions.communication.MessageReader;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
+
+import java.nio.ByteBuffer;
+import java.util.UUID;
+
+/**
+ * IGFS client closure execute request.
+ */
+public class IgfsClientClosureRequest implements Message {
+    /** Base fields (all except of target) count. */
+    private static final byte BASE_FIELDS_CNT = 2;
+
+    /** Originating node ID. */
+    private UUID nodeId;
+
+    /** Message ID. */
+    private long msgId;
+
+    /** Target callable. */
+    private IgfsClientAbstractCallable target;
+
+    /**
+     * Default constructor.
+     */
+    public IgfsClientClosureRequest() {
+        // No-op.
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param nodeId Originating node ID.
+     * @param msgId Message ID.
+     * @param target Target callable.
+     */
+    public IgfsClientClosureRequest(UUID nodeId, long msgId, 
IgfsClientAbstractCallable target) {
+        assert nodeId != null;
+        assert target != null;
+
+        this.nodeId = nodeId;
+        this.msgId = msgId;
+        this.target = target;
+    }
+
+    /**
+     * @return Node ID.
+     */
+    public UUID nodeId() {
+        return nodeId;
+    }
+
+    /**
+     * @return Message ID.
+     */
+    public long messageId() {
+        return msgId;
+    }
+
+    /**
+     * @return Target callable.
+     */
+    public IgfsClientAbstractCallable target() {
+        return target;
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte directType() {
+        return -27;
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte fieldsCount() {
+        return (byte)(BASE_FIELDS_CNT + target.fieldsCount());
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onAckReceived() {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
+        byte fieldsCount = fieldsCount();
+
+        writer.setBuffer(buf);
+
+        if (!writer.isHeaderWritten()) {
+            if (!writer.writeHeader(directType(), fieldsCount))
+                return false;
+
+            writer.onHeaderWritten();
+        }
+
+        switch (writer.state()) {
+            case 0:
+                if (!writer.writeUuid("nodeId", nodeId))
+                    return false;
+
+                writer.incrementState();
+
+            case 1:
+                if (!writer.writeLong("msgId", msgId))
+                    return false;
+
+                writer.incrementState();
+
+            default:
+                while (writer.state() < fieldsCount) {
+                    if (!target.writeTo(writer, writer.state() - 
BASE_FIELDS_CNT))
+                        return false;
+
+                    writer.incrementState();
+                }
+        }
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureResponse.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureResponse.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureResponse.java
new file mode 100644
index 0000000..3a7694a
--- /dev/null
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientClosureResponse.java
@@ -0,0 +1,32 @@
+/*
+ * 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.igfs.client;
+
+import org.apache.ignite.plugin.extensions.communication.Message;
+
+/**
+ * CIGFS client closure execute response.
+ */
+public class IgfsClientClosureResponse implements Message {
+    /**
+     * Default constructor.
+     */
+    public IgfsClientClosureResponse() {
+        // No-op.
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
index c1b8be8..9f12ea9 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
@@ -23,6 +23,7 @@ import org.apache.ignite.binary.BinaryRawWriter;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -71,6 +72,18 @@ public class IgfsClientDeleteCallable extends 
IgfsClientAbstractCallable<Boolean
     }
 
     /** {@inheritDoc} */
+    @Override protected byte fieldsCount0() {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean writeTo0(MessageWriter writer, int fieldId) {
+        assert fieldId == 0;
+
+        return writer.writeBoolean("recursive", recursive);
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientDeleteCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
index 944da6f..e8ca351 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
@@ -24,6 +24,8 @@ import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import 
org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.Map;
@@ -76,6 +78,18 @@ public class IgfsClientMkdirsCallable extends 
IgfsClientAbstractCallable<Void> {
     }
 
     /** {@inheritDoc} */
+    @Override protected byte fieldsCount0() {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean writeTo0(MessageWriter writer, int fieldId) {
+        assert fieldId == 0;
+
+        return writer.writeMap("props", props, 
MessageCollectionItemType.STRING, MessageCollectionItemType.STRING);
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientMkdirsCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
index 55afb83..e9cc947 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
@@ -24,6 +24,8 @@ import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import 
org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -74,6 +76,18 @@ public class IgfsClientRenameCallable extends 
IgfsClientAbstractCallable<Void> {
     }
 
     /** {@inheritDoc} */
+    @Override protected byte fieldsCount0() {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean writeTo0(MessageWriter writer, int fieldId) {
+        assert fieldId == 0;
+
+        return writer.writeString("destPath", destPath.toString());
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientRenameCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
index 277effc..f1beb54 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
@@ -23,6 +23,7 @@ import org.apache.ignite.binary.BinaryRawWriter;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -81,6 +82,24 @@ public class IgfsClientSetTimesCallable extends 
IgfsClientAbstractCallable<Void>
     }
 
     /** {@inheritDoc} */
+    @Override protected byte fieldsCount0() {
+        return 2;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean writeTo0(MessageWriter writer, int fieldId) {
+        switch (fieldId) {
+            case 0:
+                return writer.writeLong("accessTime", accessTime);
+
+            default:
+                assert fieldId == 1;
+
+                return writer.writeLong("modificationTime", modificationTime);
+        }
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientSetTimesCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
index 474a940..928d65d 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
@@ -17,7 +17,6 @@
 
 package org.apache.ignite.internal.processors.igfs.client;
 
-import org.apache.ignite.igfs.IgfsFile;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.util.typedef.internal.S;

http://git-wip-us.apache.org/repos/asf/ignite/blob/72b4eb58/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
index 4acf4eb..a03c7e6 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
@@ -25,6 +25,8 @@ import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import 
org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.Map;
@@ -75,6 +77,18 @@ public class IgfsClientUpdateCallable extends 
IgfsClientAbstractCallable<IgfsFil
     }
 
     /** {@inheritDoc} */
+    @Override protected byte fieldsCount0() {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean writeTo0(MessageWriter writer, int fieldId) {
+        assert fieldId == 0;
+
+        return writer.writeMap("props", props, 
MessageCollectionItemType.STRING, MessageCollectionItemType.STRING);
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientUpdateCallable.class, this);
     }

Reply via email to