ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/2] ignite git commit: IGNITE-2813: Refactoring is in progress.
Date Wed, 16 Mar 2016 13:28:38 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2813 [created] bf86a2d63


IGNITE-2813: Refactoring is in progress.


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

Branch: refs/heads/ignite-2813
Commit: 237bbefff4da865c5f62f6a5ddfa11faa10a2b3b
Parents: 69d1f4b
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Mar 16 16:09:55 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Mar 16 16:09:55 2016 +0300

----------------------------------------------------------------------
 .../processors/igfs/IgfsDataManager.java        |   2 +-
 .../internal/processors/igfs/IgfsFileInfo.java  | 332 ++++++++-----------
 .../igfs/IgfsFragmentizerManager.java           |   8 +-
 .../processors/igfs/IgfsIpcHandler.java         |   5 +-
 .../processors/igfs/IgfsMetaManager.java        |  76 ++---
 .../igfs/IgfsDataManagerSelfTest.java           |  25 +-
 .../processors/igfs/IgfsFileInfoSelfTest.java   |  21 +-
 .../igfs/IgfsMetaManagerSelfTest.java           |   3 +-
 .../processors/igfs/IgfsSizeSelfTest.java       |   6 +-
 .../fs/IgniteHadoopIgfsSecondaryFileSystem.java |  14 +-
 .../IgniteHadoopFileSystemLoggerSelfTest.java   |  12 -
 11 files changed, 204 insertions(+), 300 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/237bbeff/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
index 125d728..ae2cb69 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
@@ -1632,7 +1632,7 @@ public class IgfsDataManager extends IgfsManager {
      */
     private class AsyncDeleteWorker extends GridWorker {
         /** File info for stop request. */
-        private final IgfsFileInfo stopInfo = new IgfsFileInfo();
+        private final IgfsFileInfo stopInfo = IgfsFileInfo.createDirectory(IgniteUuid.randomUuid());
 
         /** Delete requests queue. */
         private BlockingQueue<IgniteBiTuple<GridFutureAdapter<Object>, IgfsFileInfo>> delReqs =

http://git-wip-us.apache.org/repos/asf/ignite/blob/237bbeff/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
index 13c54ff..3afeb0f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
@@ -23,7 +23,6 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.Collections;
 import java.util.Map;
-import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.util.GridLeanMap;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
@@ -40,9 +39,6 @@ public final class IgfsFileInfo implements Externalizable {
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** Special access time value, indicating that the modification time value should be taken. */
-    private static final long ACCESS_TIME_TAKE_MODIFICATION_TIME = -1L;
-
     /** Info ID. */
     private IgniteUuid id;
 
@@ -77,66 +73,67 @@ public final class IgfsFileInfo implements Externalizable {
     /** Whether data blocks of this entry should never be excluded. */
     private boolean evictExclude;
 
-    /**
-     * Original file path. This is a helper field used only in some
-     * operations like delete.
-     */
+    /** Original file path. This is a helper field used only during real file delete. */
     private IgfsPath path;
 
     /**
      * {@link Externalizable} support.
      */
     public IgfsFileInfo() {
-        this(IgfsUtils.ROOT_ID);
+        // No-op.
     }
 
     /**
-     * Constructs directory file info with the given ID.
+     * Create empty directory with the given ID.
      *
      * @param id ID.
+     * @return File info.
      */
-    IgfsFileInfo(IgniteUuid id) {
-        this(true, id, 0, 0, null, null, null, null, false, ACCESS_TIME_TAKE_MODIFICATION_TIME,
-            System.currentTimeMillis(), false);
+    public static IgfsFileInfo createDirectory(IgniteUuid id) {
+        return createDirectory(id, null, null);
     }
 
     /**
-     * Constructs directory or file info with
-     * {@link org.apache.ignite.configuration.FileSystemConfiguration#DFLT_BLOCK_SIZE default} block size.
-     *
-     * @param isDir Constructs directory info if {@code true} or file info if {@code false}.
-     * @param props Meta properties to set.
-     * @param accessTime The access time.
-     * @param modificationTime The modification time.
-     */
-    public IgfsFileInfo(boolean isDir, @Nullable Map<String, String> props, long accessTime, long modificationTime) {
-        this(isDir, null, isDir ? 0 : FileSystemConfiguration.DFLT_BLOCK_SIZE, 0, null, null, props, null, false,
-            accessTime, modificationTime, false);
-    }
-
-    /**
-     * Consturcts directory with random ID and provided listing.
+     * Create directory.
      *
+     * @param id ID.
      * @param listing Listing.
+     * @param props Properties.
+     * @return File info.
      */
-    IgfsFileInfo(Map<String, IgfsListingEntry> listing) {
-        this(listing, (Map<String,String>)null);
+    public static IgfsFileInfo createDirectory(
+        IgniteUuid id,
+        @Nullable Map<String, IgfsListingEntry> listing,
+        @Nullable Map<String,String> props) {
+        long time = System.currentTimeMillis();
+
+        return createDirectory(id, listing, props, time, time);
     }
 
     /**
-     * Consturcts directory with random ID, provided listing and properties.
+     * Craete directory.
      *
+     * @param id ID.
      * @param listing Listing.
-     * @param props The properties to set for the new directory.
+     * @param props Properties.
+     * @param createTime Create time.
+     * @param modificationTime Modification time.
+     * @return File info.
      */
-    IgfsFileInfo(@Nullable Map<String, IgfsListingEntry> listing, @Nullable Map<String,String> props) {
-        this(true/*dir*/, null, 0, 0, null, listing, props, null, false, ACCESS_TIME_TAKE_MODIFICATION_TIME,
-            System.currentTimeMillis(), false);
+    public static IgfsFileInfo createDirectory(
+        IgniteUuid id,
+        @Nullable Map<String, IgfsListingEntry> listing,
+        @Nullable Map<String,String> props,
+        long createTime,
+        long modificationTime) {
+        return new IgfsFileInfo(true, id, 0, 0, null, listing, props, null, null, false,
+            createTime, modificationTime, false);
     }
 
     /**
      * Constructs file info.
      *
+     * @param id File ID.
      * @param blockSize Block size.
      * @param len Length.
      * @param affKey Affinity key.
@@ -146,106 +143,139 @@ public final class IgfsFileInfo implements Externalizable {
      * @param accessTime The access time.
      * @param modificationTime The modification time.
      */
-    public IgfsFileInfo(int blockSize, long len, @Nullable IgniteUuid affKey, @Nullable IgniteUuid lockId,
-        boolean evictExclude, @Nullable Map<String, String> props, long accessTime, long modificationTime) {
-        this(false, null, blockSize, len, affKey, null, props, lockId, true, accessTime, modificationTime,
+    public IgfsFileInfo(IgniteUuid id, int blockSize, long len, @Nullable IgniteUuid affKey,
+        @Nullable IgniteUuid lockId, boolean evictExclude, @Nullable Map<String, String> props, long accessTime,
+        long modificationTime) {
+        this(false, id, blockSize, len, affKey, null, props, null, lockId, true, accessTime, modificationTime,
             evictExclude);
     }
 
     /**
-     * Constructs file information.
+     * Update length.
      *
-     * @param info File information to copy data from.
-     * @param len Size of a file.
+     * @param len New length.
+     * @return Updated file info.
      */
-    IgfsFileInfo(IgfsFileInfo info, long len) {
-        this(info.isDirectory(), info.id, info.blockSize, len, info.affKey, info.listing, info.props, info.fileMap(),
-            info.lockId, true, info.accessTime, info.modificationTime, info.evictExclude());
+    public IgfsFileInfo length(long len) {
+        IgfsFileInfo res = copy();
+
+        res.len = len;
+
+        return res;
     }
 
     /**
-     * Constructs file info.
+     * Update properties.
      *
-     * @param info File info.
-     * @param accessTime Last access time.
-     * @param modificationTime Last modification time.
+     * @param props Properties.
+     * @return Updated file info.
      */
-    IgfsFileInfo(IgfsFileInfo info, long accessTime, long modificationTime) {
-        this(info.isDirectory(), info.id, info.blockSize, info.len, info.affKey, info.listing, info.props,
-            info.fileMap(), info.lockId, false, accessTime, modificationTime, info.evictExclude());
+    public IgfsFileInfo properties(@Nullable Map<String, String> props) {
+        IgfsFileInfo res = copy();
+
+        res.props = props;
+
+        return res;
     }
 
     /**
-     * Constructs file information.
+     * Update path.
      *
-     * @param info File information to copy data from.
-     * @param props File properties to set.
+     * @param path Path.
+     * @return Updated file info.
      */
-    IgfsFileInfo(IgfsFileInfo info, @Nullable Map<String, String> props) {
-        this(info.isDirectory(), info.id, info.blockSize, info.len, info.affKey, info.listing, props,
-            info.fileMap(), info.lockId, true, info.accessTime, info.modificationTime, info.evictExclude());
+    public IgfsFileInfo path(IgfsPath path) {
+        IgfsFileInfo res = copy();
+
+        res.path = path;
+
+        return res;
     }
 
     /**
-     * Constructs file info.
+     * Update listing.
      *
-     * @param blockSize Block size,
-     * @param len Size of a file.
-     * @param props File properties to set.
-     * @param evictExclude Evict exclude flag.
-     * @param accessTime The access time.
-     * @param modificationTime The modification time.
+     * @param listing Listing.
+     * @return Updated file info.
      */
-    IgfsFileInfo(int blockSize, long len, boolean evictExclude, @Nullable Map<String, String> props,
-        long accessTime, long modificationTime) {
-        this(blockSize == 0, // NB The contract is: (blockSize == 0) <=> isDirectory()
-            null, blockSize, len, null, null, props, null, true, accessTime, modificationTime, evictExclude);
+    public IgfsFileInfo listing(@Nullable Map<String, IgfsListingEntry> listing) {
+        IgfsFileInfo res = copy();
+
+        res.listing = listing;
+
+        return res;
     }
 
     /**
-     * Constructs file information.
+     * Update access and modification time.
+     *
+     * @param accessTime Access time.
+     * @param modificationTime Modification time.
+     * @return Updated file info.
+     */
+    public IgfsFileInfo accessModificationTime(long accessTime, long modificationTime) {
+        IgfsFileInfo res = copy();
+
+        res.accessTime = accessTime;
+        res.modificationTime = modificationTime;
+
+        return res;
+    }
+
+    /**
+     * Lock file.
      *
-     * @param info File information to copy data from.
      * @param lockId Lock ID.
-     * @param modificationTime Last modification time.
+     * @return Update file info.
      */
-    IgfsFileInfo(IgfsFileInfo info, @Nullable IgniteUuid lockId, long modificationTime) {
-        this(info.isDirectory(), info.id, info.blockSize, info.len, info.affKey, info.listing, info.props,
-            info.fileMap(), lockId, true, info.accessTime, modificationTime, info.evictExclude());
+    public IgfsFileInfo lock(IgniteUuid lockId) {
+        assert lockId != null;
+        assert this.lockId == null;
+
+        IgfsFileInfo res = copy();
+
+        res.lockId = lockId;
+
+        return res;
     }
 
     /**
-     * Constructs file info.
+     * Unlock file.
      *
-     * @param listing New directory listing.
-     * @param old Old file info.
+     * @param modificationTime Modification time.
+     * @return Updated file info.
      */
-    IgfsFileInfo(@Nullable Map<String, IgfsListingEntry> listing, IgfsFileInfo old) {
-        this(old.isDirectory(), old.id, old.blockSize, old.len, old.affKey, listing, old.props, old.fileMap(),
-            old.lockId, false, old.accessTime, old.modificationTime, old.evictExclude());
+    public IgfsFileInfo unlock(long modificationTime) {
+        IgfsFileInfo res = copy();
+
+        res.lockId = null;
+        res.modificationTime = modificationTime;
+
+        return res;
     }
 
     /**
-     * Constructs file info.
+     * Update file map.
      *
-     * @param isDir Constructs directory info if {@code true} or file info if {@code false}.
-     * @param id ID or {@code null} to generate it automatically.
-     * @param blockSize Block size.
-     * @param len Size of a file.
-     * @param affKey Affinity key for data blocks.
-     * @param listing Directory listing.
-     * @param props File properties.
-     * @param lockId Lock ID.
-     * @param cpProps Flag to copy properties map.
-     * @param accessTime The access time.
-     * @param modificationTime Last modification time.
-     * @param evictExclude Evict exclude flag.
+     * @param fileMap File affinity map.
+     * @return Updated file info.
      */
-    private IgfsFileInfo(boolean isDir, @Nullable IgniteUuid id, int blockSize, long len, @Nullable IgniteUuid affKey,
-        @Nullable Map<String, IgfsListingEntry> listing, @Nullable Map<String, String> props,
-        @Nullable IgniteUuid lockId, boolean cpProps, long accessTime, long modificationTime, boolean evictExclude) {
-        this(isDir, id, blockSize, len, affKey, listing, props, null, lockId, cpProps, accessTime,
-            modificationTime, evictExclude);
+    public IgfsFileInfo fileMap(IgfsFileMap fileMap) {
+        IgfsFileInfo res = copy();
+
+        this.fileMap = fileMap;
+
+        return res;
+    }
+
+    /**
+     * Copy file info.
+     *
+     * @return Copy.
+     */
+    private IgfsFileInfo copy() {
+        return new IgfsFileInfo(isDirectory(), id, blockSize, len, affKey, listing, props,
+            fileMap(), lockId, true, accessTime, modificationTime, evictExclude);
     }
 
     /**
@@ -265,10 +295,11 @@ public final class IgfsFileInfo implements Externalizable {
      * @param modificationTime Last modification time.
      * @param evictExclude Evict exclude flag.
      */
-    private IgfsFileInfo(boolean isDir, @Nullable IgniteUuid id, int blockSize, long len, @Nullable IgniteUuid affKey,
+    private IgfsFileInfo(boolean isDir, IgniteUuid id, int blockSize, long len, @Nullable IgniteUuid affKey,
         @Nullable Map<String, IgfsListingEntry> listing, @Nullable Map<String, String> props,
         @Nullable IgfsFileMap fileMap, @Nullable IgniteUuid lockId, boolean cpProps, long accessTime,
         long modificationTime, boolean evictExclude) {
+        assert id != null;
         assert F.isEmpty(listing) || isDir;
 
         if (isDir) {
@@ -280,7 +311,7 @@ public final class IgfsFileInfo implements Externalizable {
             assert blockSize > 0 : "File block size should be positive: " + blockSize;
         }
 
-        this.id = id == null ? IgniteUuid.randomUuid() : id;
+        this.id = id;
         this.len = isDir ? 0 : len;
         this.blockSize = isDir ? 0 : blockSize;
         this.affKey = affKey;
@@ -290,7 +321,7 @@ public final class IgfsFileInfo implements Externalizable {
             fileMap = new IgfsFileMap();
 
         this.fileMap = fileMap;
-        this.accessTime = accessTime == ACCESS_TIME_TAKE_MODIFICATION_TIME ? modificationTime : accessTime;
+        this.accessTime = accessTime;
         this.modificationTime = modificationTime;
 
         // Always make a copy of passed properties collection to escape concurrent modifications.
@@ -302,40 +333,6 @@ public final class IgfsFileInfo implements Externalizable {
     }
 
     /**
-     * A copy constructor, which takes all data from the specified
-     * object field-by-field.
-     *
-     * @param info An object to copy data info.
-     */
-    public IgfsFileInfo(IgfsFileInfo info) {
-        this(info.isDirectory(), info.id, info.blockSize, info.len, info.affKey, info.listing, info.props,
-            info.fileMap(), info.lockId, true, info.accessTime, info.modificationTime, info.evictExclude());
-    }
-
-    /**
-     * Creates a builder for the new instance of file info.
-     *
-     * @return A builder to construct a new unmodifiable instance
-     *         of this class.
-     */
-    public static Builder builder() {
-        return new Builder(new IgfsFileInfo());
-    }
-
-    /**
-     * Creates a builder for the new instance of file info,
-     * based on the specified origin.
-     *
-     * @param origin An origin for new instance, from which
-     *               the data will be copied.
-     * @return A builder to construct a new unmodifiable instance
-     *         of this class.
-     */
-    public static Builder builder(IgfsFileInfo origin) {
-        return new Builder(new IgfsFileInfo(origin));
-    }
-
-    /**
      * Gets this item ID.
      *
      * @return This item ID.
@@ -345,19 +342,6 @@ public final class IgfsFileInfo implements Externalizable {
     }
 
     /**
-     * Temporal hack to change ID before saving entry to cache. Currently we have too much constructors and adding
-     * more will make things even worse. Instead, we use this method until directories and files are split into
-     * separate entities.
-     *
-     * @param id ID.
-     * @deprecated Use only on not-yet-saved entries.
-     */
-    @Deprecated
-    public void id(IgniteUuid id) {
-        this.id = id;
-    }
-
-    /**
      * @return {@code True} if this is a file.
      */
     public boolean isFile() {
@@ -463,13 +447,6 @@ public final class IgfsFileInfo implements Externalizable {
     }
 
     /**
-     * @param affKey Affinity key used for single-node file collocation.
-     */
-    public void affinityKey(IgniteUuid affKey) {
-        this.affKey = affKey;
-    }
-
-    /**
      * @return File affinity map.
      */
     public IgfsFileMap fileMap() {
@@ -477,13 +454,6 @@ public final class IgfsFileInfo implements Externalizable {
     }
 
     /**
-     * @param fileMap File affinity map.
-     */
-    public void fileMap(IgfsFileMap fileMap) {
-        this.fileMap = fileMap;
-    }
-
-    /**
      * Get properties of the file.
      *
      * @return Properties of the file.
@@ -575,42 +545,4 @@ public final class IgfsFileInfo implements Externalizable {
     @Override public String toString() {
         return S.toString(IgfsFileInfo.class, this);
     }
-
-    /**
-     * Builder for {@link IgfsFileInfo}.
-     */
-    @SuppressWarnings("PublicInnerClass")
-    public static class Builder {
-        /** Instance to build. */
-        private final IgfsFileInfo info;
-
-        /**
-         * Private constructor.
-         *
-         * @param info Instance to build.
-         */
-        private Builder(IgfsFileInfo info) {
-            this.info = info;
-        }
-
-        /**
-         * @param path A new path value.
-         * @return This builder instance (for chaining).
-         */
-        public Builder path(IgfsPath path) {
-            info.path = path;
-
-            return this;
-        }
-
-        /**
-         * Finishes instance construction and returns a resulting
-         * unmodifiable instance.
-         *
-         * @return A constructed instance.
-         */
-        public IgfsFileInfo build() {
-            return info;
-        }
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/237bbeff/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
index 7cc5cb6..39202d4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
@@ -383,9 +383,7 @@ public class IgfsFragmentizerManager extends IgfsManager {
 
             newMap.updateRangeStatus(range, status);
 
-            IgfsFileInfo newInfo = new IgfsFileInfo(oldInfo, oldInfo.length());
-
-            newInfo.fileMap(newMap);
+            IgfsFileInfo newInfo = oldInfo.fileMap(newMap);
 
             entry.setValue(newInfo);
 
@@ -446,9 +444,7 @@ public class IgfsFragmentizerManager extends IgfsManager {
 
             newMap.deleteRange(range);
 
-            IgfsFileInfo newInfo = new IgfsFileInfo(oldInfo, oldInfo.length());
-
-            newInfo.fileMap(newMap);
+            IgfsFileInfo newInfo = oldInfo.fileMap(newMap);
 
             entry.setValue(newInfo);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/237bbeff/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
index 0ed7c0d..1789392 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
@@ -342,10 +342,7 @@ class IgfsIpcHandler implements IgfsServerHandler {
                                 log.debug("Opened IGFS input stream for file read [igfsName=" + igfs.name() + ", path=" +
                                     req.path() + ", streamId=" + streamId + ", ses=" + ses + ']');
 
-                            IgfsFileInfo info = new IgfsFileInfo(igfsIn.fileInfo(), null,
-                                igfsIn.fileInfo().modificationTime());
-
-                            res.response(new IgfsInputStreamDescriptor(streamId, info.length()));
+                            res.response(new IgfsInputStreamDescriptor(streamId, igfsIn.fileInfo().length()));
 
                             break;
                         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/237bbeff/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index b4774f2..564e597 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -89,7 +89,6 @@ import static org.apache.ignite.events.EventType.EVT_IGFS_DIR_RENAMED;
 import static org.apache.ignite.events.EventType.EVT_IGFS_FILE_CREATED;
 import static org.apache.ignite.events.EventType.EVT_IGFS_FILE_RENAMED;
 import static org.apache.ignite.events.EventType.EVT_IGFS_FILE_OPENED_WRITE;
-import static org.apache.ignite.internal.processors.igfs.IgfsFileInfo.builder;
 import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
 import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
 
@@ -410,7 +409,7 @@ public class IgfsMetaManager extends IgfsManager {
 
                 // Force root ID always exist in cache.
                 if (info == null && IgfsUtils.ROOT_ID.equals(fileId))
-                    info = createSystemEntryIfAbsent(fileId);
+                    info = createSystemDirectoryIfAbsent(fileId);
 
                 return info;
             }
@@ -445,7 +444,7 @@ public class IgfsMetaManager extends IgfsManager {
                 if (fileIds.contains(IgfsUtils.ROOT_ID) && !map.containsKey(IgfsUtils.ROOT_ID)) {
                     map = new GridLeanMap<>(map);
 
-                    map.put(IgfsUtils.ROOT_ID, createSystemEntryIfAbsent(IgfsUtils.ROOT_ID));
+                    map.put(IgfsUtils.ROOT_ID, createSystemDirectoryIfAbsent(IgfsUtils.ROOT_ID));
                 }
 
                 return map;
@@ -644,7 +643,7 @@ public class IgfsMetaManager extends IgfsManager {
         for (IgniteUuid fileId : fileIds) {
             if (IgfsUtils.isRootOrTrashId(fileId)) {
                 if (!map.containsKey(fileId))
-                    map.put(fileId, createSystemEntryIfAbsent(fileId));
+                    map.put(fileId, createSystemDirectoryIfAbsent(fileId));
             }
         }
 
@@ -659,11 +658,11 @@ public class IgfsMetaManager extends IgfsManager {
      * @return Value of created or existing system entry.
      * @throws IgniteCheckedException On error.
      */
-    private IgfsFileInfo createSystemEntryIfAbsent(IgniteUuid id)
+    private IgfsFileInfo createSystemDirectoryIfAbsent(IgniteUuid id)
         throws IgniteCheckedException {
         assert IgfsUtils.isRootOrTrashId(id);
 
-        IgfsFileInfo info = new IgfsFileInfo(id);
+        IgfsFileInfo info = IgfsFileInfo.createDirectory(id);
 
         IgfsFileInfo oldInfo = id2InfoPrj.getAndPutIfAbsent(id, info);
 
@@ -923,7 +922,7 @@ public class IgfsMetaManager extends IgfsManager {
                     IgfsFileInfo moved = allInfos.get(srcPathIds.get(srcPathIds.size() - 1));
 
                     // Set the new path to the info to simplify event creation:
-                    return IgfsFileInfo.builder(moved).path(realNewPath).build();
+                    return moved.path(realNewPath);
                 }
                 finally {
                     tx.close();
@@ -1077,13 +1076,14 @@ public class IgfsMetaManager extends IgfsManager {
                     // Construct new info and move locked entries from root to it.
                     Map<String, IgfsListingEntry> transferListing = new HashMap<>(rootListingMap);
 
-                    IgfsFileInfo newInfo = new IgfsFileInfo(transferListing);
+                    IgfsFileInfo newInfo = IgfsFileInfo.createDirectory(IgniteUuid.randomUuid(), transferListing,
+                        (Map<String,String>)null);
 
                     createNewEntry(newInfo, trashId, newInfo.id().toString());
 
                     // Remove listing entries from root.
                     // Note that root directory properties and other attributes are preserved:
-                    id2InfoPrj.put(IgfsUtils.ROOT_ID, new IgfsFileInfo(null/*listing*/, rootInfo));
+                    id2InfoPrj.put(IgfsUtils.ROOT_ID, rootInfo.listing(null));
 
                     tx.commit();
 
@@ -1231,7 +1231,7 @@ public class IgfsMetaManager extends IgfsManager {
                 return null; // Root was never created.
 
             // Ensure trash directory existence.
-            createSystemEntryIfAbsent(trashId);
+            createSystemDirectoryIfAbsent(trashId);
 
             Map<String, IgfsListingEntry> rootListing = rootInfo.listing();
 
@@ -1251,7 +1251,8 @@ public class IgfsMetaManager extends IgfsManager {
 
                 transferListing.putAll(rootListing);
 
-                IgfsFileInfo newInfo = new IgfsFileInfo(transferListing);
+                IgfsFileInfo newInfo = IgfsFileInfo.createDirectory(IgniteUuid.randomUuid(), transferListing,
+                    (Map<String,String>)null);
 
                 createNewEntry(newInfo, trashId, newInfo.id().toString());
 
@@ -1266,7 +1267,7 @@ public class IgfsMetaManager extends IgfsManager {
         }
         else {
             // Ensure trash directory existence.
-            createSystemEntryIfAbsent(trashId);
+            createSystemDirectoryIfAbsent(trashId);
 
             moveNonTx(id, name, parentId, id.toString(), trashId);
 
@@ -1349,7 +1350,7 @@ public class IgfsMetaManager extends IgfsManager {
                         }
 
                         // Update parent listing.
-                        id2InfoPrj.put(parentId, new IgfsFileInfo(newListing, parentInfo));
+                        id2InfoPrj.put(parentId, parentInfo.listing(newListing));
                     }
 
                     tx.commit();
@@ -1983,8 +1984,9 @@ public class IgfsMetaManager extends IgfsManager {
                                 throw fsException("Failed to open output stream to the file created in " +
                                     "the secondary file system because the path points to a directory: " + path);
 
-                            IgfsFileInfo newInfo = new IgfsFileInfo(status.blockSize(), status.length(), affKey,
-                                createFileLockId(false), igfsCtx.igfs().evictExclude(path, false), status.properties(),
+                            IgfsFileInfo newInfo = new IgfsFileInfo(IgniteUuid.randomUuid(), status.blockSize(),
+                                status.length(), affKey, createFileLockId(false),
+                                igfsCtx.igfs().evictExclude(path, false), status.properties(),
                                 status.accessTime(), status.modificationTime());
 
                             // Add new file info to the listing optionally removing the previous one.
@@ -2606,9 +2608,10 @@ public class IgfsMetaManager extends IgfsManager {
 
                 // Recreate the path locally.
                 IgfsFileInfo curInfo = status.isDirectory() ?
-                    new IgfsFileInfo(true, status.properties(), status.accessTime(), status.modificationTime()) :
-                    new IgfsFileInfo(igfsCtx.configuration().getBlockSize(), status.length(),
-                        igfsCtx.igfs().evictExclude(curPath, false), status.properties(),
+                    IgfsFileInfo.createDirectory(IgniteUuid.randomUuid(), null, status.properties(),
+                        status.accessTime(), status.modificationTime()) :
+                    new IgfsFileInfo(IgniteUuid.randomUuid(), igfsCtx.configuration().getBlockSize(), status.length(),
+                        null, null, igfsCtx.igfs().evictExclude(curPath, false), status.properties(),
                         status.accessTime(), status.modificationTime());
 
                 IgniteUuid oldId = putIfAbsentNonTx(parentInfo.id(), components.get(i), curInfo);
@@ -3144,7 +3147,7 @@ public class IgfsMetaManager extends IgfsManager {
             // Modify listing in-place.
             listing.remove(fileName);
 
-            e.setValue(new IgfsFileInfo(listing, fileInfo));
+            e.setValue(fileInfo.listing(listing));
 
             return null;
         }
@@ -3216,7 +3219,7 @@ public class IgfsMetaManager extends IgfsManager {
                     " [listing=" + listing + ", fileName=" + fileName + ", entry=" + entry +
                     ", oldEntry=" + oldEntry + ']');
 
-            e.setValue(new IgfsFileInfo(listing, fileInfo));
+            e.setValue(fileInfo.listing(listing));
 
             return null;
         }
@@ -3269,7 +3272,9 @@ public class IgfsMetaManager extends IgfsManager {
         @Override public Void process(MutableEntry<IgniteUuid, IgfsFileInfo> e, Object... args) {
             IgfsFileInfo info = e.getValue();
 
-            e.setValue(builder(info).path(path).build());
+            IgfsFileInfo newInfo = info.path(path);
+
+            e.setValue(newInfo);
 
             return null;
         }
@@ -3404,8 +3409,9 @@ public class IgfsMetaManager extends IgfsManager {
                                         // Make a new locked info:
                                         long t = System.currentTimeMillis();
 
-                                        final IgfsFileInfo newFileInfo = new IgfsFileInfo(cfg.getBlockSize(), 0L,
-                                            affKey, createFileLockId(false), evictExclude, fileProps, t, t);
+                                        final IgfsFileInfo newFileInfo = new IgfsFileInfo(IgniteUuid.randomUuid(),
+                                            cfg.getBlockSize(), 0L, affKey, createFileLockId(false), evictExclude,
+                                            fileProps, t, t);
 
                                         assert newFileInfo.lockId() != null; // locked info should be created.
 
@@ -3740,10 +3746,8 @@ public class IgfsMetaManager extends IgfsManager {
         /** {@inheritDoc} */
         @Override public IgfsFileInfo process(MutableEntry<IgniteUuid, IgfsFileInfo> entry, Object... args)
             throws EntryProcessorException {
-            IgfsFileInfo info = new IgfsFileInfo(blockSize, 0L, affKey, lockId, evictExclude, props,
-                createTime, createTime);
-
-            info.id(entry.getKey());
+            IgfsFileInfo info = new IgfsFileInfo(entry.getKey(), blockSize, 0L, affKey, lockId, evictExclude,
+                props, createTime, createTime);
 
             entry.setValue(info);
 
@@ -3828,12 +3832,10 @@ public class IgfsMetaManager extends IgfsManager {
         @Override public IgfsFileInfo process(MutableEntry<IgniteUuid, IgfsFileInfo> entry, Object... args)
             throws EntryProcessorException {
 
-            IgfsFileInfo info = new IgfsFileInfo(true, props, createTime, createTime);
+            IgfsFileInfo info = IgfsFileInfo.createDirectory(entry.getKey(), null, props, createTime, createTime);
 
             if (childName != null)
-                info = new IgfsFileInfo(Collections.singletonMap(childName, childEntry), info);
-
-            info.id(entry.getKey());
+                info = info.listing(Collections.singletonMap(childName, childEntry));
 
             entry.setValue(info);
 
@@ -3899,7 +3901,7 @@ public class IgfsMetaManager extends IgfsManager {
             throws EntryProcessorException {
             IgfsFileInfo oldInfo = entry.getValue();
 
-            IgfsFileInfo newInfo =  new IgfsFileInfo(oldInfo, lockId, oldInfo.modificationTime());
+            IgfsFileInfo newInfo = oldInfo.lock(lockId);
 
             entry.setValue(newInfo);
 
@@ -3949,7 +3951,7 @@ public class IgfsMetaManager extends IgfsManager {
             throws EntryProcessorException {
             IgfsFileInfo old = entry.getValue();
 
-            entry.setValue(new IgfsFileInfo(old, null, modificationTime));
+            entry.setValue(old.unlock(modificationTime));
 
             return null;
         }
@@ -4006,9 +4008,7 @@ public class IgfsMetaManager extends IgfsManager {
 
             newMap.addRange(affRange);
 
-            IgfsFileInfo newInfo = new IgfsFileInfo(oldInfo, oldInfo.length() + space);
-
-            newInfo.fileMap(newMap);
+            IgfsFileInfo newInfo = oldInfo.length(oldInfo.length() + space).fileMap(newMap);
 
             entry.setValue(newInfo);
 
@@ -4073,7 +4073,7 @@ public class IgfsMetaManager extends IgfsManager {
                     tmp.put(e.getKey(), e.getValue());
             }
 
-            IgfsFileInfo newInfo = new IgfsFileInfo(oldInfo, tmp);
+            IgfsFileInfo newInfo = oldInfo.properties(tmp);
 
             entry.setValue(newInfo);
 
@@ -4129,7 +4129,7 @@ public class IgfsMetaManager extends IgfsManager {
 
             IgfsFileInfo oldInfo = entry.getValue();
 
-            entry.setValue(new IgfsFileInfo(oldInfo, accessTime, modificationTime));
+            entry.setValue(oldInfo.accessModificationTime(accessTime, modificationTime));
 
             return null;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/237bbeff/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
index 06ae40b..d28fb38 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
@@ -168,7 +168,7 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
 
             long t = System.currentTimeMillis();
 
-            IgfsFileInfo info = new IgfsFileInfo(200, 0L, null, IgfsUtils.DELETE_LOCK_ID,
+            IgfsFileInfo info = new IgfsFileInfo(IgniteUuid.randomUuid(), 200, 0L, null, IgfsUtils.DELETE_LOCK_ID,
                     false, null, t, t);
 
             assertNull(mgr.dataBlock(info, path, 0, null).get());
@@ -181,11 +181,11 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
 
             expectsStoreFail(info, data, "Not enough space reserved to store data");
 
-            info = new IgfsFileInfo(info, info.length() + data.length - 3);
+            info = info.length(info.length() + data.length - 3);
 
             expectsStoreFail(info, data, "Not enough space reserved to store data");
 
-            info = new IgfsFileInfo(info, info.length() + 3);
+            info = info.length(info.length() + 3);
 
             IgfsFileAffinityRange range = new IgfsFileAffinityRange();
 
@@ -253,7 +253,7 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
 
             long t = System.currentTimeMillis();
 
-            IgfsFileInfo info = new IgfsFileInfo(blockSize, 0L, null, IgfsUtils.DELETE_LOCK_ID,
+            IgfsFileInfo info = new IgfsFileInfo(IgniteUuid.randomUuid(), blockSize, 0L, null, IgfsUtils.DELETE_LOCK_ID,
                 false, null, t, t);
 
             assertNull(mgr.dataBlock(info, path, 0, null).get());
@@ -266,7 +266,7 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
 
             rnd.nextBytes(remainder);
 
-            info = new IgfsFileInfo(info, info.length() + data.length + remainder.length);
+            info = info.length(info.length() + data.length + remainder.length);
 
             IgniteInternalFuture<Boolean> fut = mgr.writeStart(info);
 
@@ -279,7 +279,7 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
 
             byte[] remainder2 = new byte[blockSize / 2];
 
-            info = new IgfsFileInfo(info, info.length() + remainder2.length);
+            info = info.length(info.length() + remainder2.length);
 
             byte[] left2 = mgr.storeDataBlocks(info, info.length(), left, left.length, ByteBuffer.wrap(remainder2),
                 false, range, null);
@@ -345,7 +345,7 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
             long t = System.currentTimeMillis();
 
             IgfsFileInfo info =
-                new IgfsFileInfo(blockSize, 0L, null, IgfsUtils.DELETE_LOCK_ID,
+                new IgfsFileInfo(IgniteUuid.randomUuid(), blockSize, 0L, null, IgfsUtils.DELETE_LOCK_ID,
                     false, null, t, t);
 
             IgfsFileAffinityRange range = new IgfsFileAffinityRange();
@@ -356,7 +356,7 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
 
             byte[] data = new byte[chunkSize];
 
-            info = new IgfsFileInfo(info, info.length() + data.length * writesCnt);
+            info = info.length(info.length() + data.length * writesCnt);
 
             IgniteInternalFuture<Boolean> fut = mgr.writeStart(info);
 
@@ -416,7 +416,8 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
         long t = System.currentTimeMillis();
 
         //IgfsFileInfo info = new IgfsFileInfo(blockSize, 0);
-        IgfsFileInfo info = new IgfsFileInfo(blockSize, 1024 * 1024, null, null, false, null, t, t);
+        IgfsFileInfo info = new IgfsFileInfo(IgniteUuid.randomUuid(), blockSize, 1024 * 1024, null, null, false, null,
+            t, t);
 
         for (int pos = 0; pos < 5 * grpSize; pos++) {
             assertEquals("Expects no affinity for zero length.", Collections.<IgfsBlockLocation>emptyList(),
@@ -466,7 +467,8 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
 
         long t = System.currentTimeMillis();
 
-        IgfsFileInfo info = new IgfsFileInfo(blockSize, 1024 * 1024, null, null, false, null, t, t);
+        IgfsFileInfo info = new IgfsFileInfo(IgniteUuid.randomUuid(), blockSize, 1024 * 1024, null, null, false, null,
+            t, t);
 
         Collection<IgfsBlockLocation> affinity = mgr.affinity(info, 0, info.length());
 
@@ -499,7 +501,8 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
 
         long t = System.currentTimeMillis();
 
-        IgfsFileInfo info = new IgfsFileInfo(blockSize, 1024 * 1024, null, null, false, null, t, t);
+        IgfsFileInfo info = new IgfsFileInfo(IgniteUuid.randomUuid(), blockSize, 1024 * 1024, null, null, false, null,
+            t, t);
 
         IgniteUuid affKey = IgniteUuid.randomUuid();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/237bbeff/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfoSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfoSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfoSelfTest.java
index feccdb5..5124776 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfoSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfoSelfTest.java
@@ -21,7 +21,7 @@ import java.io.Externalizable;
 import java.util.Random;
 import java.util.concurrent.Callable;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.marshaller.Marshaller;
 import org.apache.ignite.marshaller.MarshallerContextTestImpl;
 import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
@@ -49,23 +49,10 @@ public class IgfsFileInfoSelfTest extends IgfsCommonAbstractTest {
 
             @SuppressWarnings("deprecation") // Suppress due to default constructor should never be used directly.
             @Nullable @Override public Object call() throws IgniteCheckedException {
-                for (int i = 0; i < 10000; i++) {
-                    testSerialization(new IgfsFileInfo());
-                    testSerialization(new IgfsFileInfo());
+                long a = System.currentTimeMillis();
+                long m = a + 1;
 
-                    long a = System.currentTimeMillis();
-                    long m = a + 1;
-
-                    testSerialization(new IgfsFileInfo(true, null, a, m));
-                    testSerialization(new IgfsFileInfo(false, null, a, m));
-
-                    IgfsFileInfo rndInfo =
-                        new IgfsFileInfo(rnd.nextInt(max), 0, false, null, a, m);
-
-                    testSerialization(rndInfo);
-                    testSerialization(new IgfsFileInfo(rndInfo, rnd.nextInt(max)));
-                    testSerialization(new IgfsFileInfo(rndInfo, F.asMap("desc", String.valueOf(rnd.nextLong()))));
-                }
+                testSerialization(IgfsFileInfo.createDirectory(IgniteUuid.randomUuid(), null, null, a, m));
 
                 return null;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/237bbeff/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
index 19a91ad..dc790e2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
@@ -29,7 +29,6 @@ import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.igfs.IgfsException;
 import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper;
 import org.apache.ignite.igfs.IgfsPath;
-import org.apache.ignite.internal.util.typedef.C1;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteUuid;
@@ -228,7 +227,7 @@ public class IgfsMetaManagerSelfTest extends IgfsCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testStructure() throws Exception {
-        IgfsFileInfo rootInfo = new IgfsFileInfo();
+        IgfsFileInfo rootInfo = IgfsFileInfo.createDirectory(ROOT_ID);
 
         // Test empty structure.
         assertEmpty(mgr.directoryListing(ROOT_ID));

http://git-wip-us.apache.org/repos/asf/ignite/blob/237bbeff/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
index fcf4b3b..395296e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
@@ -543,15 +543,15 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
                     new IgfsListingEntry(info));
 
                 // Clear root listing.
-                metaCache.put(IgfsUtils.ROOT_ID, new IgfsFileInfo(IgfsUtils.ROOT_ID));
+                metaCache.put(IgfsUtils.ROOT_ID, IgfsFileInfo.createDirectory(IgfsUtils.ROOT_ID));
 
                 // Add file to trash listing.
                 IgfsFileInfo trashInfo = metaCache.get(trashId);
 
                 if (trashInfo == null)
-                    metaCache.put(trashId, new IgfsFileInfo(listing, new IgfsFileInfo(trashId)));
+                    metaCache.put(trashId, IgfsFileInfo.createDirectory(trashId).listing(listing));
                 else
-                    metaCache.put(trashId, new IgfsFileInfo(listing, trashInfo));
+                    metaCache.put(trashId, trashInfo.listing(listing));
 
                 tx.commit();
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/237bbeff/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
index 672b912..a3d4d26 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
@@ -46,6 +46,7 @@ import org.apache.ignite.internal.processors.igfs.IgfsFileInfo;
 import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.lang.IgniteOutClosure;
+import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.lifecycle.LifecycleAware;
 import org.jetbrains.annotations.Nullable;
 
@@ -350,13 +351,14 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
 
             Collection<IgfsFile> res = new ArrayList<>(statuses.length);
 
-            for (FileStatus status : statuses) {
-                IgfsFileInfo fsInfo = status.isDirectory() ?
-                    new IgfsFileInfo(true, properties(status), status.getAccessTime(), status.getModificationTime()) :
-                    new IgfsFileInfo((int)status.getBlockSize(), status.getLen(), null, null, false, properties(status),
-                        status.getAccessTime(), status.getModificationTime());
+            for (FileStatus s : statuses) {
+                IgfsFileInfo fsInfo = s.isDirectory() ?
+                    IgfsFileInfo.createDirectory(IgniteUuid.randomUuid(), null, properties(s),
+                        s.getAccessTime(), s.getModificationTime()) :
+                    new IgfsFileInfo(IgniteUuid.randomUuid(), (int)s.getBlockSize(), s.getLen(), null, null, false,
+                        properties(s), s.getAccessTime(), s.getModificationTime());
 
-                res.add(new IgfsFileImpl(new IgfsPath(path, status.getPath().getName()), fsInfo, 1));
+                res.add(new IgfsFileImpl(new IgfsPath(path, s.getPath().getName()), fsInfo, 1));
             }
 
             return res;

http://git-wip-us.apache.org/repos/asf/ignite/blob/237bbeff/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemLoggerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemLoggerSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemLoggerSelfTest.java
index e89d651..69c4883 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemLoggerSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemLoggerSelfTest.java
@@ -26,8 +26,6 @@ import java.util.ArrayList;
 import java.util.List;
 import org.apache.ignite.internal.igfs.common.IgfsLogger;
 import org.apache.ignite.internal.processors.igfs.IgfsCommonAbstractTest;
-import org.apache.ignite.internal.processors.igfs.IgfsFileImpl;
-import org.apache.ignite.internal.processors.igfs.IgfsFileInfo;
 import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
 
@@ -244,16 +242,6 @@ public class IgniteHadoopFileSystemLoggerSelfTest extends IgfsCommonAbstractTest
     }
 
     /**
-     * Create IGFS file with the given path.
-     *
-     * @param path File path.
-     * @return IGFS file instance.
-     */
-    private IgfsFile file(String path) {
-        return new IgfsFileImpl(new IgfsPath(path), new IgfsFileInfo(), 64 * 1024 * 1024);
-    }
-
-    /**
      * Ensure that log file has only the following lines.
      *
      * @param lines Expected lines.


Mime
View raw message