ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [07/11] ignite git commit: IGNITE-4988 Cleanup and refactor VisorXxx tasks and DTO for ignite-2.0
Date Fri, 14 Apr 2017 13:54:35 GMT
http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorFileBlockArg.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorFileBlockArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorFileBlockArg.java
new file mode 100644
index 0000000..babb630
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorFileBlockArg.java
@@ -0,0 +1,114 @@
+/*
+ * 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.visor.file;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Arguments for {@link VisorFileBlockTask}
+ */
+public class VisorFileBlockArg extends VisorDataTransferObject {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Log file path. */
+    private String path;
+
+    /** Log file offset. */
+    private long off;
+
+    /** Block size. */
+    private int blockSz;
+
+    /** Log file last modified timestamp. */
+    private long lastModified;
+
+    /**
+     * Default constructor.
+     */
+    public VisorFileBlockArg() {
+        // No-op.
+    }
+
+    /**
+     * @param path Log file path.
+     * @param off Offset in file.
+     * @param blockSz Block size.
+     * @param lastModified Log file last modified timestamp.
+     */
+    public VisorFileBlockArg(String path, long off, int blockSz, long lastModified) {
+        this.path = path;
+        this.off = off;
+        this.blockSz = blockSz;
+        this.lastModified = lastModified;
+    }
+
+    /**
+     * @return Log file path.
+     */
+    public String getPath() {
+        return path;
+    }
+
+    /**
+     * @return Log file offset.
+     */
+    public long getOffset() {
+        return off;
+    }
+
+    /**
+     * @return Block size
+     */
+    public int getBlockSize() {
+        return blockSz;
+    }
+
+    /**
+     * @return Log file last modified timestamp.
+     */
+    public long getLastModified() {
+        return lastModified;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        U.writeString(out, path);
+        out.writeLong(off);
+        out.writeInt(blockSz);
+        out.writeLong(lastModified);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        path = U.readString(in);
+        off = in.readLong();
+        blockSz = in.readInt();
+        lastModified = in.readLong();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(VisorFileBlockArg.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorFileBlockTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorFileBlockTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorFileBlockTask.java
index 58a25ee..85a790b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorFileBlockTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorFileBlockTask.java
@@ -19,16 +19,15 @@ package org.apache.ignite.internal.visor.file;
 
 import java.io.File;
 import java.io.IOException;
-import java.io.Serializable;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.nio.file.NoSuchFileException;
 import org.apache.ignite.internal.processors.task.GridInternal;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorEither;
 import org.apache.ignite.internal.visor.VisorJob;
 import org.apache.ignite.internal.visor.VisorOneNodeTask;
-import org.apache.ignite.lang.IgniteBiTuple;
 
 import static org.apache.ignite.internal.visor.util.VisorTaskUtils.readBlock;
 
@@ -36,8 +35,7 @@ import static org.apache.ignite.internal.visor.util.VisorTaskUtils.readBlock;
  * Task to read file block.
  */
 @GridInternal
-public class VisorFileBlockTask extends VisorOneNodeTask<VisorFileBlockTask.VisorFileBlockArg,
-    IgniteBiTuple<? extends IOException, VisorFileBlock>> {
+public class VisorFileBlockTask extends VisorOneNodeTask<VisorFileBlockArg, VisorEither<VisorFileBlock>> {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -47,49 +45,10 @@ public class VisorFileBlockTask extends VisorOneNodeTask<VisorFileBlockTask.Viso
     }
 
     /**
-     * Arguments for {@link VisorFileBlockTask}
-     */
-    @SuppressWarnings("PublicInnerClass")
-    public static class VisorFileBlockArg implements Serializable {
-        /** */
-        private static final long serialVersionUID = 0L;
-
-        /** Log file path. */
-        private final String path;
-
-        /** Log file offset. */
-        private final long off;
-
-        /** Block size. */
-        private final int blockSz;
-
-        /** Log file last modified timestamp. */
-        private final long lastModified;
-
-        /**
-         * @param path Log file path.
-         * @param off Offset in file.
-         * @param blockSz Block size.
-         * @param lastModified Log file last modified timestamp.
-         */
-        public VisorFileBlockArg(String path, long off, int blockSz, long lastModified) {
-            this.path = path;
-            this.off = off;
-            this.blockSz = blockSz;
-            this.lastModified = lastModified;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(VisorFileBlockArg.class, this);
-        }
-    }
-
-    /**
      * Job that read file block on node.
      */
     private static class VisorFileBlockJob
-        extends VisorJob<VisorFileBlockArg, IgniteBiTuple<? extends IOException, VisorFileBlock>> {
+        extends VisorJob<VisorFileBlockArg, VisorEither<VisorFileBlock>> {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -102,22 +61,23 @@ public class VisorFileBlockTask extends VisorOneNodeTask<VisorFileBlockTask.Viso
         }
 
         /** {@inheritDoc} */
-        @Override protected IgniteBiTuple<? extends IOException, VisorFileBlock> run(VisorFileBlockArg arg) {
+        @Override protected VisorEither<VisorFileBlock> run(VisorFileBlockArg arg) {
             try {
-                URL url = U.resolveIgniteUrl(arg.path);
+                URL url = U.resolveIgniteUrl(arg.getPath());
 
                 if (url == null)
-                    return new IgniteBiTuple<>(new NoSuchFileException("File path not found: " + arg.path), null);
+                    return new VisorEither<>(new NoSuchFileException("File path not found: " + arg.getPath()));
 
-                VisorFileBlock block = readBlock(new File(url.toURI()), arg.off, arg.blockSz, arg.lastModified);
+                VisorFileBlock block = readBlock(
+                    new File(url.toURI()), arg.getOffset(), arg.getBlockSize(), arg.getLastModified());
 
-                return new IgniteBiTuple<>(null, block);
+                return new VisorEither<>(block);
             }
             catch (IOException e) {
-                return new IgniteBiTuple<>(e, null);
+                return new VisorEither<>(e);
             }
             catch (URISyntaxException ignored) {
-                return new IgniteBiTuple<>(new NoSuchFileException("File path not found: " + arg.path), null);
+                return new VisorEither<>(new NoSuchFileException("File path not found: " + arg.getPath()));
             }
         }
 
@@ -126,4 +86,4 @@ public class VisorFileBlockTask extends VisorOneNodeTask<VisorFileBlockTask.Viso
             return S.toString(VisorFileBlockJob.class, this);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorLatestTextFilesTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorLatestTextFilesTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorLatestTextFilesTask.java
index 55d358c..9ae0b26 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorLatestTextFilesTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorLatestTextFilesTask.java
@@ -28,7 +28,6 @@ import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.visor.VisorJob;
 import org.apache.ignite.internal.visor.VisorOneNodeTask;
 import org.apache.ignite.internal.visor.log.VisorLogFile;
-import org.apache.ignite.lang.IgniteBiTuple;
 import org.jetbrains.annotations.Nullable;
 
 import static org.apache.ignite.internal.visor.util.VisorTaskUtils.LOG_FILES_COUNT_LIMIT;
@@ -38,19 +37,19 @@ import static org.apache.ignite.internal.visor.util.VisorTaskUtils.matchedFiles;
  * Get list files matching filter.
  */
 @GridInternal
-public class VisorLatestTextFilesTask extends VisorOneNodeTask<IgniteBiTuple<String, String>, Collection<VisorLogFile>> {
+public class VisorLatestTextFilesTask extends VisorOneNodeTask<VisorLatestTextFilesTaskArg, Collection<VisorLogFile>> {
     /** */
     private static final long serialVersionUID = 0L;
 
     /** {@inheritDoc} */
-    @Override protected VisorLatestTextFilesJob job(IgniteBiTuple<String, String> arg) {
+    @Override protected VisorLatestTextFilesJob job(VisorLatestTextFilesTaskArg arg) {
         return new VisorLatestTextFilesJob(arg, debug);
     }
 
     /**
      * Job that gets list of files.
      */
-    private static class VisorLatestTextFilesJob extends VisorJob<IgniteBiTuple<String, String>, Collection<VisorLogFile>> {
+    private static class VisorLatestTextFilesJob extends VisorJob<VisorLatestTextFilesTaskArg, Collection<VisorLogFile>> {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -58,14 +57,14 @@ public class VisorLatestTextFilesTask extends VisorOneNodeTask<IgniteBiTuple<Str
          * @param arg Folder and regexp.
          * @param debug Debug flag.
          */
-        private VisorLatestTextFilesJob(IgniteBiTuple<String, String> arg, boolean debug) {
+        private VisorLatestTextFilesJob(VisorLatestTextFilesTaskArg arg, boolean debug) {
             super(arg, debug);
         }
 
         /** {@inheritDoc} */
-        @Nullable @Override protected Collection<VisorLogFile> run(final IgniteBiTuple<String, String> arg) {
-            String path = arg.get1();
-            String regexp = arg.get2();
+        @Nullable @Override protected Collection<VisorLogFile> run(final VisorLatestTextFilesTaskArg arg) {
+            String path = arg.getPath();
+            String regexp = arg.getRegexp();
 
             assert path != null;
             assert regexp != null;
@@ -98,4 +97,4 @@ public class VisorLatestTextFilesTask extends VisorOneNodeTask<IgniteBiTuple<Str
             return S.toString(VisorLatestTextFilesJob.class, this);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorLatestTextFilesTaskArg.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorLatestTextFilesTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorLatestTextFilesTaskArg.java
new file mode 100644
index 0000000..d0bc99d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/file/VisorLatestTextFilesTaskArg.java
@@ -0,0 +1,86 @@
+/*
+ * 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.visor.file;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Arguments for {@link VisorLatestTextFilesTask}
+ */
+public class VisorLatestTextFilesTaskArg extends VisorDataTransferObject {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Folder path to search files. */
+    private String path;
+
+    /** Pattern to match file names. */
+    private String regexp;
+
+    /**
+     * Default constructor.
+     */
+    public VisorLatestTextFilesTaskArg() {
+        // No-op.
+    }
+
+    /**
+     * @param path Folder path to search in files.
+     * @param regexp Pattern to match file names.
+     */
+    public VisorLatestTextFilesTaskArg(String path, String regexp) {
+        this.path = path;
+        this.regexp = regexp;
+    }
+
+    /**
+     * @return Folder path to search in files.
+     */
+    public String getPath() {
+        return path;
+    }
+
+    /**
+     * @return Pattern to match file names.
+     */
+    public String getRegexp() {
+        return regexp;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        U.writeString(out, path);
+        U.writeString(out, regexp);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        path = U.readString(in);
+        regexp = U.readString(in);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(VisorLatestTextFilesTaskArg.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfs.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfs.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfs.java
index 7369663..683eb91 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfs.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfs.java
@@ -17,45 +17,50 @@
 
 package org.apache.ignite.internal.visor.igfs;
 
-import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import org.apache.ignite.IgniteFileSystem;
 import org.apache.ignite.igfs.IgfsMode;
-import org.apache.ignite.internal.LessNamingBean;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
 
 /**
  * Data transfer object for {@link IgniteFileSystem}.
  */
-public class VisorIgfs implements Serializable, LessNamingBean {
+public class VisorIgfs extends VisorDataTransferObject {
     /** */
     private static final long serialVersionUID = 0L;
 
     /** IGFS instance name. */
-    private final String name;
+    private String name;
 
     /** IGFS instance working mode. */
-    private final IgfsMode mode;
+    private IgfsMode mode;
 
     /** IGFS metrics. */
-    private final VisorIgfsMetrics metrics;
+    private VisorIgfsMetrics metrics;
 
     /** Whether IGFS has configured secondary file system. */
-    private final boolean secondaryFsConfigured;
+    private boolean secondaryFsConfigured;
 
     /**
-     * Create data transfer object.
+     * Default constructor.
+     */
+    public VisorIgfs() {
+        // No-op.
+    }
+
+    /**
+     * Create IGFS configuration transfer object.
      *
-     * @param name IGFS name.
-     * @param mode IGFS mode.
+     * @param name IGFS instance name.
+     * @param mode IGFS instance working mode.
      * @param metrics IGFS metrics.
      * @param secondaryFsConfigured Whether IGFS has configured secondary file system.
      */
-    public VisorIgfs(
-        String name,
-        IgfsMode mode,
-        VisorIgfsMetrics metrics,
-        boolean secondaryFsConfigured
-    ) {
+    public VisorIgfs(String name, IgfsMode mode, VisorIgfsMetrics metrics, boolean secondaryFsConfigured) {
         this.name = name;
         this.mode = mode;
         this.metrics = metrics;
@@ -63,49 +68,64 @@ public class VisorIgfs implements Serializable, LessNamingBean {
     }
 
     /**
+     * Create data transfer object.
+     *
      * @param igfs Source IGFS.
-     * @return Data transfer object for given IGFS.
      */
-    public static VisorIgfs from(IgniteFileSystem igfs) {
+    public VisorIgfs(IgniteFileSystem igfs) {
         assert igfs != null;
 
-        return new VisorIgfs(
-            igfs.name(),
-            igfs.configuration().getDefaultMode(),
-            VisorIgfsMetrics.from(igfs),
-            igfs.configuration().getSecondaryFileSystem() != null
-        );
+        name = igfs.name();
+        mode = igfs.configuration().getDefaultMode();
+        metrics = new VisorIgfsMetrics(igfs);
+        secondaryFsConfigured = igfs.configuration().getSecondaryFileSystem() != null;
     }
 
     /**
      * @return IGFS instance name.
      */
-    public String name() {
+    public String getName() {
         return name;
     }
 
     /**
      * @return IGFS instance working mode.
      */
-    public IgfsMode mode() {
+    public IgfsMode getMode() {
         return mode;
     }
 
     /**
      * @return IGFS metrics.
      */
-    public VisorIgfsMetrics metrics() {
+    public VisorIgfsMetrics getMetrics() {
         return metrics;
     }
 
     /**
      * @return Whether IGFS has configured secondary file system.
      */
-    public boolean secondaryFileSystemConfigured() {
+    public boolean isSecondaryFileSystemConfigured() {
         return secondaryFsConfigured;
     }
 
     /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        U.writeString(out, name);
+        U.writeEnum(out, mode);
+        out.writeObject(metrics);
+        out.writeBoolean(secondaryFsConfigured);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        name = U.readString(in);
+        mode = IgfsMode.fromOrdinal(in.readByte());
+        metrics = (VisorIgfsMetrics)in.readObject();
+        secondaryFsConfigured = in.readBoolean();
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(VisorIgfs.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsEndpoint.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsEndpoint.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsEndpoint.java
index 8ddd883..784b970 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsEndpoint.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsEndpoint.java
@@ -17,43 +17,51 @@
 
 package org.apache.ignite.internal.visor.igfs;
 
-import java.io.Serializable;
-import org.apache.ignite.internal.LessNamingBean;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
 import org.jetbrains.annotations.Nullable;
 
 /**
  * IGFS endpoint descriptor.
  */
-public class VisorIgfsEndpoint implements Serializable, LessNamingBean {
+public class VisorIgfsEndpoint extends VisorDataTransferObject {
     /** */
     private static final long serialVersionUID = 0L;
 
     /** IGFS name. */
-    private final String igfsName;
+    private String igfsName;
 
-    /** Ignite instance name. */
-    private final String igniteInstanceName;
+    /** Grid name. */
+    private String gridName;
 
     /** Host address / name. */
-    private final String hostName;
+    private String hostName;
 
     /** Port number. */
-    private final int port;
+    private int port;
+
+    /**
+     * Default constructor.
+     */
+    public VisorIgfsEndpoint() {
+        // No-op.
+    }
 
     /**
      * Create IGFS endpoint descriptor with given parameters.
      *
      * @param igfsName IGFS name.
-     * @param igniteInstanceName Ignite instance name.
+     * @param gridName Grid name.
      * @param hostName Host address / name.
      * @param port Port number.
      */
-    public VisorIgfsEndpoint(
-        @Nullable String igfsName, String igniteInstanceName, @Nullable String hostName, int port
-    ) {
+    public VisorIgfsEndpoint(@Nullable String igfsName, String gridName, @Nullable String hostName, int port) {
         this.igfsName = igfsName;
-        this.igniteInstanceName = igniteInstanceName;
+        this.gridName = gridName;
         this.hostName = hostName;
         this.port = port;
     }
@@ -61,45 +69,61 @@ public class VisorIgfsEndpoint implements Serializable, LessNamingBean {
     /**
      * @return IGFS name.
      */
-    @Nullable public String igfsName() {
+    @Nullable public String getIgfsName() {
         return igfsName;
     }
 
     /**
-     * @return Ignite instance name.
+     * @return Grid name.
      */
-    public String igniteInstanceName() {
-        return igniteInstanceName;
+    public String getGridName() {
+        return gridName;
     }
 
     /**
      * @return Host address / name.
      */
-    @Nullable public String hostName() {
+    @Nullable public String getHostName() {
         return hostName;
     }
 
     /**
      * @return Port number.
      */
-    public int port() {
+    public int getPort() {
         return port;
     }
 
     /**
      * @return URI Authority
      */
-    public String authority() {
+    public String getAuthority() {
         String addr = hostName + ":" + port;
 
-        if (igfsName == null && igniteInstanceName == null)
+        if (igfsName == null && gridName == null)
             return addr;
         else if (igfsName == null)
-            return igniteInstanceName + "@" + addr;
-        else if (igniteInstanceName == null)
+            return gridName + "@" + addr;
+        else if (gridName == null)
             return igfsName + "@" + addr;
         else
-            return igfsName + ":" + igniteInstanceName + "@" + addr;
+            return igfsName + ":" + gridName + "@" + addr;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        U.writeString(out, igfsName);
+        U.writeString(out, gridName);
+        U.writeString(out, hostName);
+        out.writeInt(port);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        igfsName = U.readString(in);
+        gridName = U.readString(in);
+        hostName = U.readString(in);
+        port = in.readInt();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java
index 58acee1..6ce5d80 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsMetrics.java
@@ -17,16 +17,18 @@
 
 package org.apache.ignite.internal.visor.igfs;
 
-import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import org.apache.ignite.IgniteFileSystem;
 import org.apache.ignite.igfs.IgfsMetrics;
-import org.apache.ignite.internal.LessNamingBean;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
 
 /**
  * Data transfer object for {@link IgfsMetrics}.
  */
-public class VisorIgfsMetrics implements Serializable, LessNamingBean {
+public class VisorIgfsMetrics extends VisorDataTransferObject {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -73,32 +75,36 @@ public class VisorIgfsMetrics implements Serializable, LessNamingBean {
     private long bytesWrtTm;
 
     /**
+     * Create data transfer object for given IGFS metrics.
+     */
+    public VisorIgfsMetrics() {
+        // No-op.
+    }
+
+    /**
+     * Create data transfer object for given IGFS metrics.
+     *
      * @param igfs Source IGFS.
-     * @return Data transfer object for given IGFS metrics.
      */
-    public static VisorIgfsMetrics from(IgniteFileSystem igfs) {
+    public VisorIgfsMetrics(IgniteFileSystem igfs) {
         assert igfs != null;
 
         IgfsMetrics m = igfs.metrics();
 
-        VisorIgfsMetrics metrics = new VisorIgfsMetrics();
-
-        metrics.totalSpaceSz = igfs.configuration().getMaxSpaceSize();
-        metrics.usedSpaceSz = m.localSpaceSize();
-        metrics.foldersCnt = m.directoriesCount();
-        metrics.filesCnt = m.filesCount();
-        metrics.filesOpenedForRd = m.filesOpenedForRead();
-        metrics.filesOpenedForWrt = m.filesOpenedForWrite();
-        metrics.blocksRd = m.blocksReadTotal();
-        metrics.blocksRdRmt = m.blocksReadRemote();
-        metrics.blocksWrt = m.blocksWrittenTotal();
-        metrics.blocksWrtRmt = m.blocksWrittenRemote();
-        metrics.bytesRd = m.bytesRead();
-        metrics.bytesRdTm = m.bytesReadTime();
-        metrics.bytesWrt = m.bytesWritten();
-        metrics.bytesWrtTm = m.bytesWriteTime();
-
-        return metrics;
+        totalSpaceSz = igfs.configuration().getMaxSpaceSize();
+        usedSpaceSz = m.localSpaceSize();
+        foldersCnt = m.directoriesCount();
+        filesCnt = m.filesCount();
+        filesOpenedForRd = m.filesOpenedForRead();
+        filesOpenedForWrt = m.filesOpenedForWrite();
+        blocksRd = m.blocksReadTotal();
+        blocksRdRmt = m.blocksReadRemote();
+        blocksWrt = m.blocksWrittenTotal();
+        blocksWrtRmt = m.blocksWrittenRemote();
+        bytesRd = m.bytesRead();
+        bytesRdTm = m.bytesReadTime();
+        bytesWrt = m.bytesWritten();
+        bytesWrtTm = m.bytesWriteTime();
     }
 
     /**
@@ -146,109 +152,145 @@ public class VisorIgfsMetrics implements Serializable, LessNamingBean {
     /**
      * @return Maximum amount of data that can be stored on local node.
      */
-    public long totalSpaceSize() {
+    public long getTotalSpaceSize() {
         return totalSpaceSz;
     }
 
     /**
      * @return Local used space in bytes on local node.
      */
-    public long usedSpaceSize() {
+    public long getUsedSpaceSize() {
         return usedSpaceSz;
     }
 
     /**
      * @return Local free space in bytes on local node.
      */
-    public long freeSpaceSize() {
+    public long getFreeSpaceSize() {
         return totalSpaceSz - usedSpaceSz;
     }
 
     /**
      * @return Number of directories created in file system.
      */
-    public int foldersCount() {
+    public int getFoldersCount() {
         return foldersCnt;
     }
 
     /**
      * @return Number of files stored in file system.
      */
-    public int filesCount() {
+    public int getFilesCount() {
         return filesCnt;
     }
 
     /**
      * @return Number of files that are currently opened for reading on local node.
      */
-    public int filesOpenedForRead() {
+    public int getFilesOpenedForRead() {
         return filesOpenedForRd;
     }
 
     /**
      * @return Number of files that are currently opened for writing on local node.
      */
-    public int filesOpenedForWrite() {
+    public int getFilesOpenedForWrite() {
         return filesOpenedForWrt;
     }
 
     /**
      * @return Total blocks read, local and remote.
      */
-    public long blocksRead() {
+    public long getBlocksRead() {
         return blocksRd;
     }
 
     /**
      * @return Total remote blocks read.
      */
-    public long blocksReadRemote() {
+    public long getBlocksReadRemote() {
         return blocksRdRmt;
     }
 
     /**
      * @return Total blocks write, local and remote.
      */
-    public long blocksWritten() {
+    public long getBlocksWritten() {
         return blocksWrt;
     }
 
     /**
      * @return Total remote blocks write.
      */
-    public long blocksWrittenRemote() {
+    public long getBlocksWrittenRemote() {
         return blocksWrtRmt;
     }
 
     /**
      * @return Total bytes read.
      */
-    public long bytesRead() {
+    public long getBytesRead() {
         return bytesRd;
     }
 
     /**
      * @return Total bytes read time.
      */
-    public long bytesReadTime() {
+    public long getBytesReadTime() {
         return bytesRdTm;
     }
 
     /**
      * @return Total bytes write.
      */
-    public long bytesWritten() {
+    public long getBytesWritten() {
         return bytesWrt;
     }
 
     /**
      * @return Total bytes write time.
      */
-    public long bytesWriteTime() {
+    public long getBytesWriteTime() {
         return bytesWrtTm;
     }
 
     /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        out.writeLong(totalSpaceSz);
+        out.writeLong(usedSpaceSz);
+        out.writeInt(foldersCnt);
+        out.writeInt(filesCnt);
+        out.writeInt(filesOpenedForRd);
+        out.writeInt(filesOpenedForWrt);
+        out.writeLong(blocksRd);
+        out.writeLong(blocksRdRmt);
+        out.writeLong(blocksWrt);
+        out.writeLong(blocksWrtRmt);
+        out.writeLong(bytesRd);
+        out.writeLong(bytesRdTm);
+        out.writeLong(bytesWrt);
+        out.writeLong(bytesWrtTm);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        totalSpaceSz = in.readLong();
+        usedSpaceSz = in.readLong();
+        foldersCnt = in.readInt();
+        filesCnt = in.readInt();
+        filesOpenedForRd = in.readInt();
+        filesOpenedForWrt = in.readInt();
+        blocksRd = in.readLong();
+        blocksRdRmt = in.readLong();
+        blocksWrt = in.readLong();
+        blocksWrtRmt = in.readLong();
+        bytesRd = in.readLong();
+        bytesRdTm = in.readLong();
+        bytesWrt = in.readLong();
+        bytesWrtTm = in.readLong();
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(VisorIgfsMetrics.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
index 06460d5..e6b40fa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfiler.java
@@ -44,7 +44,7 @@ public class VisorIgfsProfiler {
         if (entries.size() == 1)
             return entries.get(0); // No need to aggregate.
         else {
-            String path = entries.get(0).path();
+            String path = entries.get(0).getPath();
 
             Collections.sort(entries, VisorIgfsProfilerEntry.ENTRY_TIMESTAMP_COMPARATOR);
 
@@ -61,23 +61,23 @@ public class VisorIgfsProfiler {
 
             for (VisorIgfsProfilerEntry entry : entries) {
                 // Take last timestamp.
-                ts = entry.timestamp();
+                ts = entry.getTimestamp();
 
                 // Take last size.
-                size = entry.size();
+                size = entry.getSize();
 
                 // Take last mode.
-                mode = entry.mode();
+                mode = entry.getMode();
 
                 // Aggregate metrics.
-                bytesRead += entry.bytesRead();
-                readTime += entry.readTime();
-                userReadTime += entry.userReadTime();
-                bytesWritten += entry.bytesWritten();
-                writeTime += entry.writeTime();
-                userWriteTime += entry.userWriteTime();
+                bytesRead += entry.getBytesRead();
+                readTime += entry.getReadTime();
+                userReadTime += entry.getUserReadTime();
+                bytesWritten += entry.getBytesWritten();
+                writeTime += entry.getWriteTime();
+                userWriteTime += entry.getUserWriteTime();
 
-                counters.aggregate(entry.counters());
+                counters.aggregate(entry.getCounters());
             }
 
             return new VisorIgfsProfilerEntry(path, ts, mode, size, bytesRead, readTime, userReadTime,
@@ -85,4 +85,4 @@ public class VisorIgfsProfiler {
         }
     }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTask.java
index ba805c1..b8bfe9e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTask.java
@@ -32,7 +32,6 @@ import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.visor.VisorJob;
 import org.apache.ignite.internal.visor.VisorOneNodeTask;
-import org.apache.ignite.lang.IgniteBiTuple;
 
 import static org.apache.ignite.internal.visor.util.VisorTaskUtils.resolveIgfsProfilerLogsDir;
 
@@ -40,14 +39,14 @@ import static org.apache.ignite.internal.visor.util.VisorTaskUtils.resolveIgfsPr
  * Remove all IGFS profiler logs.
  */
 @GridInternal
-public class VisorIgfsProfilerClearTask extends VisorOneNodeTask<String, IgniteBiTuple<Integer, Integer>> {
+public class VisorIgfsProfilerClearTask extends VisorOneNodeTask<String, VisorIgfsProfilerClearTaskResult> {
     /** */
     private static final long serialVersionUID = 0L;
 
     /**
      * Job to clear profiler logs.
      */
-    private static class VisorIgfsProfilerClearJob extends VisorJob<String, IgniteBiTuple<Integer, Integer>> {
+    private static class VisorIgfsProfilerClearJob extends VisorJob<String, VisorIgfsProfilerClearTaskResult> {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -62,7 +61,7 @@ public class VisorIgfsProfilerClearTask extends VisorOneNodeTask<String, IgniteB
         }
 
         /** {@inheritDoc} */
-        @Override protected IgniteBiTuple<Integer, Integer> run(String arg) {
+        @Override protected VisorIgfsProfilerClearTaskResult run(String arg) {
             int deleted = 0;
             int notDeleted = 0;
 
@@ -106,7 +105,7 @@ public class VisorIgfsProfilerClearTask extends VisorOneNodeTask<String, IgniteB
                 throw U.convertException(e);
             }
 
-            return new IgniteBiTuple<>(deleted, notDeleted);
+            return new VisorIgfsProfilerClearTaskResult(deleted, notDeleted);
         }
 
         /** {@inheritDoc} */
@@ -119,4 +118,4 @@ public class VisorIgfsProfilerClearTask extends VisorOneNodeTask<String, IgniteB
     @Override protected VisorIgfsProfilerClearJob job(String arg) {
         return new VisorIgfsProfilerClearJob(arg, debug);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTaskResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTaskResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTaskResult.java
new file mode 100644
index 0000000..4eafe53
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerClearTaskResult.java
@@ -0,0 +1,85 @@
+/*
+ * 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.visor.igfs;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Result for {@link VisorIgfsProfilerClearTask}.
+ */
+public class VisorIgfsProfilerClearTaskResult extends VisorDataTransferObject {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Count of deleted files. */
+    private Integer deleted;
+
+    /** Count of not deleted files. */
+    private Integer notDeleted;
+
+    /**
+     * Default constructor.
+     */
+    public VisorIgfsProfilerClearTaskResult() {
+        // No-op.
+    }
+
+    /**
+     * @param deleted Count of deleted files.
+     * @param notDeleted Count of not deleted files.
+     */
+    public VisorIgfsProfilerClearTaskResult(Integer deleted, Integer notDeleted) {
+        this.deleted = deleted;
+        this.notDeleted = notDeleted;
+    }
+
+    /**
+     * @return Count of deleted files.
+     */
+    public Integer getDeleted() {
+        return deleted;
+    }
+
+    /**
+     * @return Count of not deleted files.
+     */
+    public Integer getNotDeleted() {
+        return notDeleted;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        out.writeInt(deleted);
+        out.writeInt(notDeleted);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        deleted = in.readInt();
+        notDeleted = in.readInt();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(VisorIgfsProfilerClearTaskResult.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
index b157296..dd33806 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerEntry.java
@@ -17,16 +17,19 @@
 
 package org.apache.ignite.internal.visor.igfs;
 
-import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import java.util.Comparator;
 import org.apache.ignite.igfs.IgfsMode;
-import org.apache.ignite.internal.LessNamingBean;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
 
 /**
  * Visor IGFS profiler information about one file.
  */
-public class VisorIgfsProfilerEntry implements Serializable, LessNamingBean {
+public class VisorIgfsProfilerEntry extends VisorDataTransferObject {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -39,46 +42,53 @@ public class VisorIgfsProfilerEntry implements Serializable, LessNamingBean {
         };
 
     /** Path to file. */
-    private final String path;
+    private String path;
 
     /** Timestamp of last file operation. */
-    private final long ts;
+    private long ts;
 
     /** IGFS mode. */
-    private final IgfsMode mode;
+    private IgfsMode mode;
 
     /** File size. */
-    private final long size;
+    private long size;
 
     /** How many bytes were read. */
-    private final long bytesRead;
+    private long bytesRead;
 
     /** How long read take. */
-    private final long readTime;
+    private long readTime;
 
     /** User read time. */
-    private final long userReadTime;
+    private long userReadTime;
 
     /** How many bytes were written. */
-    private final long bytesWritten;
+    private long bytesWritten;
 
     /** How long write take. */
-    private final long writeTime;
+    private long writeTime;
 
     /** User write read time. */
-    private final long userWriteTime;
+    private long userWriteTime;
 
     /** Calculated uniformity. */
     private double uniformity = -1;
 
     /** Counters for uniformity calculation. */
-    private final VisorIgfsProfilerUniformityCounters counters;
+    private VisorIgfsProfilerUniformityCounters counters;
 
     /** Read speed in bytes per second or {@code -1} if speed not available. */
-    private final long readSpeed;
+    private long readSpeed;
 
     /** Write speed in bytes per second or {@code -1} if speed not available. */
-    private final long writeSpeed;
+    private long writeSpeed;
+
+    /**
+     * Default constructor.
+     */
+    public VisorIgfsProfilerEntry() {
+        // No-op.
+    }
 
     /** Create data transfer object with given parameters. */
     public VisorIgfsProfilerEntry(
@@ -133,77 +143,77 @@ public class VisorIgfsProfilerEntry implements Serializable, LessNamingBean {
     /**
      * @return Path to file.
      */
-    public String path() {
+    public String getPath() {
         return path;
     }
 
     /**
      * @return Timestamp of last file operation.
      */
-    public long timestamp() {
+    public long getTimestamp() {
         return ts;
     }
 
     /**
      * @return IGFS mode.
      */
-    public IgfsMode mode() {
+    public IgfsMode getMode() {
         return mode;
     }
 
     /**
      * @return File size.
      */
-    public long size() {
+    public long getSize() {
         return size;
     }
 
     /**
      * @return How many bytes were read.
      */
-    public long bytesRead() {
+    public long getBytesRead() {
         return bytesRead;
     }
 
     /**
      * @return How long read take.
      */
-    public long readTime() {
+    public long getReadTime() {
         return readTime;
     }
 
     /**
      * @return User read time.
      */
-    public long userReadTime() {
+    public long getUserReadTime() {
         return userReadTime;
     }
 
     /**
      * @return How many bytes were written.
      */
-    public long bytesWritten() {
+    public long getBytesWritten() {
         return bytesWritten;
     }
 
     /**
      * @return How long write take.
      */
-    public long writeTime() {
+    public long getWriteTime() {
         return writeTime;
     }
 
     /**
      * @return User write read time.
      */
-    public long userWriteTime() {
+    public long getUserWriteTime() {
         return userWriteTime;
     }
 
     /**
      * @return Calculated uniformity.
      */
-    public double uniformity() {
+    public double getUniformity() {
         if (uniformity < 0)
             uniformity = counters.calc();
 
@@ -213,25 +223,61 @@ public class VisorIgfsProfilerEntry implements Serializable, LessNamingBean {
     /**
      * @return Counters for uniformity calculation.
      */
-    public VisorIgfsProfilerUniformityCounters counters() {
+    public VisorIgfsProfilerUniformityCounters getCounters() {
         return counters;
     }
 
     /**
      * @return Read speed in bytes per second or {@code -1} if speed not available.
      */
-    public long readSpeed() {
+    public long getReadSpeed() {
         return readSpeed;
     }
 
     /**
      * @return Write speed in bytes per second or {@code -1} if speed not available.
      */
-    public long writeSpeed() {
+    public long getWriteSpeed() {
         return writeSpeed;
     }
 
     /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        U.writeString(out, path);
+        out.writeLong(ts);
+        U.writeEnum(out, mode);
+        out.writeLong(size);
+        out.writeLong(bytesRead);
+        out.writeLong(readTime);
+        out.writeLong(userReadTime);
+        out.writeLong(bytesWritten);
+        out.writeLong(writeTime);
+        out.writeLong(userWriteTime);
+        out.writeDouble(uniformity);
+        out.writeObject(counters);
+        out.writeLong(readSpeed);
+        out.writeLong(writeSpeed);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        path = U.readString(in);
+        ts = in.readLong();
+        mode = IgfsMode.fromOrdinal(in.readByte());
+        size = in.readLong();
+        bytesRead = in.readLong();
+        readTime = in.readLong();
+        userReadTime = in.readLong();
+        bytesWritten = in.readLong();
+        writeTime = in.readLong();
+        userWriteTime = in.readLong();
+        uniformity = in.readDouble();
+        counters = (VisorIgfsProfilerUniformityCounters)in.readObject();
+        readSpeed = in.readLong();
+        writeSpeed = in.readLong();
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(VisorIgfsProfilerEntry.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
index d57d7f9..be48a1d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerTask.java
@@ -27,7 +27,6 @@ import java.nio.file.NoSuchFileException;
 import java.nio.file.Path;
 import java.nio.file.PathMatcher;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -57,7 +56,7 @@ import static org.apache.ignite.internal.visor.util.VisorTaskUtils.resolveIgfsPr
  * Task that parse hadoop profiler logs.
  */
 @GridInternal
-public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<VisorIgfsProfilerEntry>> {
+public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, List<VisorIgfsProfilerEntry>> {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -143,7 +142,7 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<V
     /**
      * Job that do actual profiler work.
      */
-    private static class VisorIgfsProfilerJob extends VisorJob<String, Collection<VisorIgfsProfilerEntry>> {
+    private static class VisorIgfsProfilerJob extends VisorJob<String, List<VisorIgfsProfilerEntry>> {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -197,14 +196,14 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<V
         }
 
         /** {@inheritDoc} */
-        @Override protected Collection<VisorIgfsProfilerEntry> run(String arg) {
+        @Override protected List<VisorIgfsProfilerEntry> run(String arg) {
             try {
                 Path logsDir = resolveIgfsProfilerLogsDir(ignite.fileSystem(arg));
 
                 if (logsDir != null)
                     return parse(logsDir, arg);
-                else
-                    return Collections.emptyList();
+
+                return Collections.emptyList();
             }
             catch (IOException | IllegalArgumentException e) {
                 throw new IgniteException("Failed to parse profiler logs for IGFS: " + arg, e);
@@ -425,15 +424,15 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<V
          * @return Collection of parsed and aggregated entries.
          * @throws IOException if failed to read log file.
          */
-        private Collection<VisorIgfsProfilerEntry> parseFile(Path p) throws IOException {
-            Collection<VisorIgfsProfilerParsedLine> parsedLines = new ArrayList<>(512);
+        private List<VisorIgfsProfilerEntry> parseFile(Path p) throws IOException {
+            List<VisorIgfsProfilerParsedLine> parsedLines = new ArrayList<>(512);
 
             try (BufferedReader br = Files.newBufferedReader(p, Charset.forName("UTF-8"))) {
                 String line = br.readLine(); // Skip first line with columns header.
 
                 if (line != null) {
                     // Check file header.
-                    if (line.equalsIgnoreCase(HDR))
+                    if (HDR.equalsIgnoreCase(line))
                         line = br.readLine();
 
                     while (line != null) {
@@ -468,7 +467,7 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<V
             }
 
             // Aggregate each group.
-            Collection<VisorIgfsProfilerEntry> entries = new ArrayList<>(byStreamId.size());
+            List<VisorIgfsProfilerEntry> entries = new ArrayList<>(byStreamId.size());
 
             for (List<VisorIgfsProfilerParsedLine> lines : byStreamId.values()) {
                 VisorIgfsProfilerEntry entry = aggregateParsedLines(lines);
@@ -481,19 +480,19 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<V
             Map<String, List<VisorIgfsProfilerEntry>> byPath = new HashMap<>();
 
             for (VisorIgfsProfilerEntry entry : entries) {
-                List<VisorIgfsProfilerEntry> grp = byPath.get(entry.path());
+                List<VisorIgfsProfilerEntry> grp = byPath.get(entry.getPath());
 
                 if (grp == null) {
                     grp = new ArrayList<>();
 
-                    byPath.put(entry.path(), grp);
+                    byPath.put(entry.getPath(), grp);
                 }
 
                 grp.add(entry);
             }
 
             // Aggregate by files.
-            Collection<VisorIgfsProfilerEntry> res = new ArrayList<>(byPath.size());
+            List<VisorIgfsProfilerEntry> res = new ArrayList<>(byPath.size());
 
             for (List<VisorIgfsProfilerEntry> lst : byPath.values())
                 res.add(VisorIgfsProfiler.aggregateIgfsProfilerEntries(lst));
@@ -507,8 +506,8 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<V
          * @param logDir Folder were log files located.
          * @return List of line with aggregated information by files.
          */
-        private Collection<VisorIgfsProfilerEntry> parse(Path logDir, String igfsName) throws IOException {
-            Collection<VisorIgfsProfilerEntry> parsedFiles = new ArrayList<>(512);
+        private List<VisorIgfsProfilerEntry> parse(Path logDir, String igfsName) throws IOException {
+            List<VisorIgfsProfilerEntry> parsedFiles = new ArrayList<>(512);
 
             try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(logDir)) {
                 PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:igfs-log-" + igfsName + "-*.csv");
@@ -541,4 +540,4 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<V
     @Override protected VisorIgfsProfilerJob job(String arg) {
         return new VisorIgfsProfilerJob(arg, debug);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java
index 9184ce3..d1df3d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsProfilerUniformityCounters.java
@@ -17,10 +17,14 @@
 
 package org.apache.ignite.internal.visor.igfs;
 
-import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import java.util.ArrayList;
-import org.apache.ignite.internal.LessNamingBean;
 import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
 
 import static org.apache.ignite.internal.visor.igfs.VisorIgfsProfiler.UNIFORMITY_BLOCKS;
 import static org.apache.ignite.internal.visor.igfs.VisorIgfsProfiler.UNIFORMITY_DFLT_BLOCK_SIZE;
@@ -32,7 +36,7 @@ import static org.apache.ignite.internal.visor.igfs.VisorIgfsProfiler.UNIFORMITY
  * </p>
  * Count read frequency for each file and compare with ideal uniform distribution.
  */
-public class VisorIgfsProfilerUniformityCounters implements Serializable, LessNamingBean {
+public class VisorIgfsProfilerUniformityCounters extends VisorDataTransferObject {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -43,7 +47,14 @@ public class VisorIgfsProfilerUniformityCounters implements Serializable, LessNa
     private long blockSize = UNIFORMITY_DFLT_BLOCK_SIZE;
 
     /** Collection of calculated counters. */
-    private final ArrayList<Integer> counters = new ArrayList<>();
+    private ArrayList<Integer> counters = new ArrayList<>();
+
+    /**
+     * Default constructor.
+     */
+    public VisorIgfsProfilerUniformityCounters() {
+        // No-op.
+    }
 
     /**
      * Calculate block size.
@@ -199,4 +210,23 @@ public class VisorIgfsProfilerUniformityCounters implements Serializable, LessNa
             return 1.0 - sigma;
         }
     }
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        out.writeLong(fileSize);
+        out.writeLong(blockSize);
+        U.writeCollection(out, counters);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        fileSize = in.readLong();
+        blockSize = in.readLong();
+        counters = (ArrayList<Integer>)U.readIntList(in);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(VisorIgfsProfilerUniformityCounters.class, this);
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTask.java
index 62d93d4..7367492 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTask.java
@@ -25,20 +25,19 @@ import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.visor.VisorJob;
 import org.apache.ignite.internal.visor.VisorOneNodeTask;
-import org.apache.ignite.lang.IgniteBiTuple;
 
 /**
  * Task to set IGFS instance sampling state.
  */
 @GridInternal
-public class VisorIgfsSamplingStateTask extends VisorOneNodeTask<IgniteBiTuple<String, Boolean>, Void> {
+public class VisorIgfsSamplingStateTask extends VisorOneNodeTask<VisorIgfsSamplingStateTaskArg, Void> {
     /** */
     private static final long serialVersionUID = 0L;
 
     /**
      * Job that perform parsing of IGFS profiler logs.
      */
-    private static class VisorIgfsSamplingStateJob extends VisorJob<IgniteBiTuple<String, Boolean>, Void> {
+    private static class VisorIgfsSamplingStateJob extends VisorJob<VisorIgfsSamplingStateTaskArg, Void> {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -48,19 +47,19 @@ public class VisorIgfsSamplingStateTask extends VisorOneNodeTask<IgniteBiTuple<S
          * @param arg Job argument.
          * @param debug Debug flag.
          */
-        private VisorIgfsSamplingStateJob(IgniteBiTuple<String, Boolean> arg, boolean debug) {
+        private VisorIgfsSamplingStateJob(VisorIgfsSamplingStateTaskArg arg, boolean debug) {
             super(arg, debug);
         }
 
         /** {@inheritDoc} */
-        @Override protected Void run(IgniteBiTuple<String, Boolean> arg) {
+        @Override protected Void run(VisorIgfsSamplingStateTaskArg arg) {
             try {
-                ((IgfsEx)ignite.fileSystem(arg.get1())).globalSampling(arg.get2());
+                ((IgfsEx)ignite.fileSystem(arg.getName())).globalSampling(arg.isEnabled());
 
                 return null;
             }
             catch (IllegalArgumentException iae) {
-                throw new IgniteException("Failed to set sampling state for IGFS: " + arg.get1(), iae);
+                throw new IgniteException("Failed to set sampling state for IGFS: " + arg.getName(), iae);
             }
             catch (IgniteCheckedException e) {
                 throw U.convertException(e);
@@ -74,7 +73,7 @@ public class VisorIgfsSamplingStateTask extends VisorOneNodeTask<IgniteBiTuple<S
     }
 
     /** {@inheritDoc} */
-    @Override protected VisorIgfsSamplingStateJob job(IgniteBiTuple<String, Boolean> arg) {
+    @Override protected VisorIgfsSamplingStateJob job(VisorIgfsSamplingStateTaskArg arg) {
         return new VisorIgfsSamplingStateJob(arg, debug);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTaskArg.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTaskArg.java
new file mode 100644
index 0000000..219d943
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/igfs/VisorIgfsSamplingStateTaskArg.java
@@ -0,0 +1,86 @@
+/*
+ * 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.visor.igfs;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Argument for task returns changing of sampling state result.
+ */
+public class VisorIgfsSamplingStateTaskArg extends VisorDataTransferObject {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** IGFS name. */
+    private String name;
+
+    /** {@code True} to turn on sampling, {@code false} to turn it off, {@code null} to clear sampling state. */
+    private boolean enabled;
+
+    /**
+     * Default constructor.
+     */
+    public VisorIgfsSamplingStateTaskArg() {
+        // No-op.
+    }
+
+    /**
+     * @param name IGFS name.
+     * @param enabled {@code True} to turn on sampling, {@code false} to turn it off, {@code null} to clear sampling state.
+     */
+    public VisorIgfsSamplingStateTaskArg(String name, boolean enabled) {
+        this.name = name;
+        this.enabled = enabled;
+    }
+
+    /**
+     * @return IGFS name.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * @return {@code True} to turn on sampling, {@code false} to turn it off, {@code null} to clear sampling state.
+     */
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        U.writeString(out, name);
+        out.writeBoolean(enabled);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        name = U.readString(in);
+        enabled = in.readBoolean();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(VisorIgfsSamplingStateTaskArg.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogFile.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogFile.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogFile.java
index 211a171..2c2ac21 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogFile.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogFile.java
@@ -18,24 +18,35 @@
 package org.apache.ignite.internal.visor.log;
 
 import java.io.File;
-import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
 
 /**
  * Visor log file.
  */
-public class VisorLogFile implements Serializable {
+public class VisorLogFile extends VisorDataTransferObject {
     /** */
     private static final long serialVersionUID = 0L;
 
     /** File path. */
-    private final String path;
+    private String path;
 
     /** File size. */
-    private final long size;
+    private long size;
 
     /** File last modified timestamp. */
-    private final long lastModified;
+    private long lastModified;
+
+    /**
+     * Default constructor.
+     */
+    public VisorLogFile() {
+        // No-op.
+    }
 
     /**
      * Create log file for given file.
@@ -62,26 +73,40 @@ public class VisorLogFile implements Serializable {
     /**
      * @return File path.
      */
-    public String path() {
+    public String getPath() {
         return path;
     }
 
     /**
      * @return File size.
      */
-    public long size() {
+    public long getSize() {
         return size;
     }
 
     /**
      * @return File last modified timestamp.
      */
-    public long lastModified() {
+    public long getLastModified() {
         return lastModified;
     }
 
     /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        U.writeString(out, path);
+        out.writeLong(size);
+        out.writeLong(lastModified);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        path = U.readString(in);
+        size = in.readLong();
+        lastModified = in.readLong();
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(VisorLogFile.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchArg.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchArg.java
new file mode 100644
index 0000000..2a6b79b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchArg.java
@@ -0,0 +1,114 @@
+/*
+ * 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.visor.log;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Arguments for {@link VisorLogSearchTask}.
+ */
+public class VisorLogSearchArg extends VisorDataTransferObject {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Searched string. */
+    private String searchStr;
+
+    /** Folder. */
+    private String folder;
+
+    /** File name search pattern. */
+    private String filePtrn;
+
+    /** Max number of results. */
+    private int limit;
+
+    /**
+     * Default constructor.
+     */
+    public VisorLogSearchArg() {
+        // No-op.
+    }
+
+    /**
+     * @param searchStr Searched string.
+     * @param folder Folder.
+     * @param filePtrn File name search pattern.
+     * @param limit Max number of results.
+     */
+    public VisorLogSearchArg(String searchStr, String folder, String filePtrn, int limit) {
+        this.searchStr = searchStr;
+        this.folder = folder;
+        this.filePtrn = filePtrn;
+        this.limit = limit;
+    }
+
+    /**
+     * @return Searched string.
+     */
+    public String getSearchString() {
+        return searchStr;
+    }
+
+    /**
+     * @return Folder.
+     */
+    public String getFolder() {
+        return folder;
+    }
+
+    /**
+     * @return File name search pattern.
+     */
+    public String getFilePattern() {
+        return filePtrn;
+    }
+
+    /**
+     * @return Max number of results.
+     */
+    public int getLimit() {
+        return limit;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        U.writeString(out, searchStr);
+        U.writeString(out, folder);
+        U.writeString(out, filePtrn);
+        out.writeInt(limit);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        searchStr = U.readString(in);
+        folder = U.readString(in);
+        filePtrn = U.readString(in);
+        limit = in.readInt();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(VisorLogSearchArg.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchResult.java
index 35ace13..4eee458 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchResult.java
@@ -17,42 +17,54 @@
 
 package org.apache.ignite.internal.visor.log;
 
-import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Arrays;
+import java.util.List;
 import java.util.UUID;
-import org.apache.ignite.internal.LessNamingBean;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
 
 /**
  * Result for log search operation.
  * Contains found line and several lines before and after, plus other info.
  */
-public class VisorLogSearchResult implements Serializable, LessNamingBean {
+public class VisorLogSearchResult extends VisorDataTransferObject {
     /** */
     private static final long serialVersionUID = 0L;
 
     /** Node ID. */
-    private final UUID nid;
+    private UUID nid;
 
     /** File path relative to the search folder. */
-    private final String filePath;
+    private String filePath;
 
     /** File size. */
-    private final long fileSize;
+    private long fileSize;
 
     /** Timestamp of last modification of the file. */
-    private final long lastModified;
+    private long lastModified;
 
     /** Lines of text including found line and several lines before and after. */
-    private final String[] lines;
+    private List<String> lines;
 
     /** Line number in the file, 1 based. */
-    private final int lineNum;
+    private int lineNum;
 
     /** Lines count in the file. */
-    private final int lineCnt;
+    private int lineCnt;
 
     /** File content encoding. */
-    private final String encoding;
+    private String encoding;
+
+    /**
+     * Default constructor.
+     */
+    public VisorLogSearchResult() {
+        // No-op.
+    }
 
     /**
      * Create log search result with given parameters.
@@ -80,7 +92,7 @@ public class VisorLogSearchResult implements Serializable, LessNamingBean {
         this.filePath = filePath;
         this.fileSize = fileSize;
         this.lastModified = lastModified;
-        this.lines = lines;
+        this.lines = Arrays.asList(lines);
         this.lineNum = lineNum;
         this.lineCnt = lineCnt;
         this.encoding = encoding;
@@ -89,64 +101,88 @@ public class VisorLogSearchResult implements Serializable, LessNamingBean {
     /**
      * @return Node ID.
      */
-    public UUID nid() {
+    public UUID getNid() {
         return nid;
     }
 
     /**
      * @return File path relative to the search folder.
      */
-    public String filePath() {
+    public String getFilePath() {
         return filePath;
     }
 
     /**
      * @return File size.
      */
-    public long fileSize() {
+    public long getFileSize() {
         return fileSize;
     }
 
     /**
      * @return Timestamp of last modification of the file.
      */
-    public long lastModified() {
+    public long getLastModified() {
         return lastModified;
     }
 
     /**
      * @return Lines of text including found line and several lines before and after.
      */
-    public String[] lines() {
+    public List<String> getLines() {
         return lines;
     }
 
     /**
      * @return Line number in the file, 1 based.
      */
-    public int lineNumber() {
+    public int getLineNumber() {
         return lineNum;
     }
 
     /**
      * @return Lines count in the file.
      */
-    public int lineCount() {
+    public int getLineCount() {
         return lineCnt;
     }
 
     /**
      * @return File content encoding.
      */
-    public String encoding() {
+    public String getEncoding() {
         return encoding;
     }
 
     /**
      * @return Found line.
      */
-    public String line() {
-        return lines[lines.length / 2];
+    public String getLine() {
+        return lines.get(lines.size() / 2);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        U.writeUuid(out, nid);
+        U.writeString(out, filePath);
+        out.writeLong(fileSize);
+        out.writeLong(lastModified);
+        U.writeCollection(out, lines);
+        out.writeInt(lineNum);
+        out.writeInt(lineCnt);
+        U.writeString(out, encoding);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        nid = U.readUuid(in);
+        filePath = U.readString(in);
+        fileSize = in.readLong();
+        lastModified = in.readLong();
+        lines = U.readList(in);
+        lineNum = in.readInt();
+        lineCnt = in.readInt();
+        encoding = U.readString(in);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTask.java
index b6552b2..924c285 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTask.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.visor.log;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.io.Serializable;
 import java.net.URL;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
@@ -28,6 +27,7 @@ import java.util.Collection;
 import java.util.Deque;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.UUID;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.compute.ComputeJobResult;
@@ -38,7 +38,6 @@ import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.visor.VisorJob;
 import org.apache.ignite.internal.visor.VisorMultiNodeTask;
-import org.apache.ignite.lang.IgniteBiTuple;
 import org.jetbrains.annotations.Nullable;
 
 import static org.apache.ignite.internal.visor.util.VisorTaskUtils.decode;
@@ -49,8 +48,8 @@ import static org.apache.ignite.internal.visor.util.VisorTaskUtils.textFile;
  * Search text matching in logs
  */
 @GridInternal
-public class VisorLogSearchTask extends VisorMultiNodeTask<VisorLogSearchTask.VisorLogSearchArg,
-    IgniteBiTuple<Iterable<IgniteBiTuple<Exception, UUID>>, Iterable<VisorLogSearchResult>>,
+public class VisorLogSearchTask extends VisorMultiNodeTask<VisorLogSearchArg,
+    VisorLogSearchTaskResult,
     Collection<VisorLogSearchResult>> {
     /** */
     private static final long serialVersionUID = 0L;
@@ -67,15 +66,14 @@ public class VisorLogSearchTask extends VisorMultiNodeTask<VisorLogSearchTask.Vi
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override protected IgniteBiTuple<Iterable<IgniteBiTuple<Exception, UUID>>,
-        Iterable<VisorLogSearchResult>> reduce0(List<ComputeJobResult> results) {
-        Collection<VisorLogSearchResult> searchRes = new ArrayList<>();
-        Collection<IgniteBiTuple<Exception, UUID>> exRes = new ArrayList<>();
+    @Nullable @Override protected VisorLogSearchTaskResult reduce0(List<ComputeJobResult> results) {
+        List<VisorLogSearchResult> searchRes = new ArrayList<>();
+        Map<Exception, UUID> exRes = U.newHashMap(0);
 
         // Separate successfully executed results and exceptions.
         for (ComputeJobResult result : results) {
             if (result.getException() != null)
-                exRes.add(new IgniteBiTuple<Exception, UUID>(result.getException(), result.getNode().id()));
+                exRes.put(result.getException(), result.getNode().id());
             else if (result.getData() != null) {
                 Collection<VisorLogSearchResult> data = result.getData();
 
@@ -83,47 +81,7 @@ public class VisorLogSearchTask extends VisorMultiNodeTask<VisorLogSearchTask.Vi
             }
         }
 
-        return new IgniteBiTuple<Iterable<IgniteBiTuple<Exception, UUID>>, Iterable<VisorLogSearchResult>>
-            (exRes.isEmpty() ? null : exRes, searchRes.isEmpty() ? null : searchRes);
-    }
-
-    /**
-     * Arguments for {@link VisorLogSearchTask}.
-     */
-    @SuppressWarnings("PublicInnerClass")
-    public static class VisorLogSearchArg implements Serializable {
-        /** */
-        private static final long serialVersionUID = 0L;
-
-        /** Searched string. */
-        private final String searchStr;
-
-        /** Folder. */
-        private final String folder;
-
-        /** File name search pattern. */
-        private final String filePtrn;
-
-        /** Max number of results. */
-        private final int limit;
-
-        /**
-         * @param searchStr Searched string.
-         * @param folder Folder.
-         * @param filePtrn File name search pattern.
-         * @param limit Max number of results.
-         */
-        public VisorLogSearchArg(String searchStr, String folder, String filePtrn, int limit) {
-            this.searchStr = searchStr;
-            this.folder = folder;
-            this.filePtrn = filePtrn;
-            this.limit = limit;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(VisorLogSearchArg.class, this);
-        }
+        return new VisorLogSearchTaskResult(exRes.isEmpty() ? null : exRes, searchRes.isEmpty() ? null : searchRes);
     }
 
     /**
@@ -216,15 +174,15 @@ public class VisorLogSearchTask extends VisorMultiNodeTask<VisorLogSearchTask.Vi
 
         /** {@inheritDoc} */
         @Override protected Collection<VisorLogSearchResult> run(VisorLogSearchArg arg) {
-            URL url = U.resolveIgniteUrl(arg.folder);
+            URL url = U.resolveIgniteUrl(arg.getFolder());
 
             if (url == null)
-                throw new IgniteException(new FileNotFoundException("Log folder not found: " + arg.folder));
+                throw new IgniteException(new FileNotFoundException("Log folder not found: " + arg.getFolder()));
 
             UUID uuid = ignite.localNode().id();
             String nid = uuid.toString().toLowerCase();
 
-            String filePtrn = arg.filePtrn.replace("@nid8", nid.substring(0, 8)).replace("@nid", nid);
+            String filePtrn = arg.getFilePattern().replace("@nid8", nid.substring(0, 8)).replace("@nid", nid);
 
             try {
                 File fld = new File(url.toURI());
@@ -232,22 +190,22 @@ public class VisorLogSearchTask extends VisorMultiNodeTask<VisorLogSearchTask.Vi
 
                 List<VisorLogFile> matchingFiles = matchedFiles(fld, filePtrn);
 
-                Collection<VisorLogSearchResult> results = new ArrayList<>(arg.limit);
+                Collection<VisorLogSearchResult> results = new ArrayList<>(arg.getLimit());
 
                 int resCnt = 0;
 
                 for (VisorLogFile logFile : matchingFiles) {
                     try {
-                        File f = new File(logFile.path());
+                        File f = new File(logFile.getPath());
 
                         if (textFile(f, false)) {
                             Charset charset = decode(f);
 
-                            if (resCnt == arg.limit)
+                            if (resCnt == arg.getLimit())
                                 break;
 
                             List<GridTuple3<String[], Integer, Integer>> searched =
-                                searchInFile(f, charset, arg.searchStr, arg.limit - resCnt);
+                                searchInFile(f, charset, arg.getSearchString(), arg.getLimit() - resCnt);
 
                             resCnt += searched.size();
 
@@ -276,4 +234,4 @@ public class VisorLogSearchTask extends VisorMultiNodeTask<VisorLogSearchTask.Vi
             return S.toString(VisorLogSearchJob.class, this);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/12dfe9e8/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTaskResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTaskResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTaskResult.java
new file mode 100644
index 0000000..3104c3a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/log/VisorLogSearchTaskResult.java
@@ -0,0 +1,92 @@
+/*
+ * 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.visor.log;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Result for log search operation.
+ * Contains found line and several lines before and after, plus other info.
+ */
+public class VisorLogSearchTaskResult extends VisorDataTransferObject {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** List of exceptions by node ID. */
+    private Map<Exception, UUID> exceptions;
+
+    /** List of log search results. */
+    private List<VisorLogSearchResult> results;
+
+    /**
+     * Default constructor.
+     */
+    public VisorLogSearchTaskResult() {
+        // No-op.
+    }
+
+    /**
+     * Create log search result with given parameters.
+     *
+     * @param exceptions List of exceptions by node ID.
+     * @param results List of log search results.
+     */
+    public VisorLogSearchTaskResult(Map<Exception, UUID> exceptions, List<VisorLogSearchResult> results) {
+        this.exceptions = exceptions;
+        this.results = results;
+    }
+
+    /**
+     * @return List of exceptions by node ID.
+     */
+    public Map<Exception, UUID> getExceptions() {
+        return exceptions;
+    }
+
+    /**
+     * @return List of log search results.
+     */
+    public List<VisorLogSearchResult> getResults() {
+        return results;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        U.writeMap(out, exceptions);
+        U.writeCollection(out, results);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        exceptions = U.readMap(in);
+        results = U.readList(in);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(VisorLogSearchTaskResult.class, this);
+    }
+}


Mime
View raw message