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-2878: IGFS: Optimzied serialization of IgfsListingEntry and properties map.
Date Thu, 24 Mar 2016 07:35:59 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 3bf5f46b1 -> 90a5bbec4


IGNITE-2878: IGFS: Optimzied serialization of IgfsListingEntry and properties map.


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

Branch: refs/heads/master
Commit: 29806af4ec2a0a9ab6b19f9a08c1fd17ea7a0694
Parents: 2f64ab0
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Thu Mar 24 10:35:43 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Mar 24 10:35:43 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/binary/BinaryContext.java   |   2 +
 .../internal/processors/igfs/IgfsBlockKey.java  |  30 ++++-
 .../processors/igfs/IgfsDirectoryInfo.java      |  33 ++++-
 .../internal/processors/igfs/IgfsEntryInfo.java |   8 +-
 .../internal/processors/igfs/IgfsUtils.java     | 127 +++++++++++++++++++
 .../meta/IgfsMetaDirectoryCreateProcessor.java  |  24 ++--
 .../IgfsMetaDirectoryListingAddProcessor.java   |   6 +-
 ...gfsMetaDirectoryListingReplaceProcessor.java |   4 +-
 .../igfs/meta/IgfsMetaFileCreateProcessor.java  |  16 ++-
 .../meta/IgfsMetaUpdatePropertiesProcessor.java |   5 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   |  11 ++
 .../IgfsPrimaryOptimziedMarshallerSelfTest.java |  28 ++++
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |   2 +
 13 files changed, 261 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
index b357345..4d8c293 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
@@ -65,6 +65,7 @@ import org.apache.ignite.internal.processors.cache.binary.BinaryMetadataKey;
 import org.apache.ignite.internal.processors.closure.GridClosureProcessor;
 import org.apache.ignite.internal.processors.datastructures.CollocatedQueueItemKey;
 import org.apache.ignite.internal.processors.datastructures.CollocatedSetItemKey;
+import org.apache.ignite.internal.processors.igfs.IgfsBlockKey;
 import org.apache.ignite.internal.processors.igfs.IgfsDirectoryInfo;
 import org.apache.ignite.internal.processors.igfs.IgfsFileAffinityRange;
 import org.apache.ignite.internal.processors.igfs.IgfsFileInfo;
@@ -118,6 +119,7 @@ public class BinaryContext {
         // IGFS classes.
         sysClss.add(IgfsPath.class.getName());
 
+        sysClss.add(IgfsBlockKey.class.getName());
         sysClss.add(IgfsDirectoryInfo.class.getName());
         sysClss.add(IgfsFileAffinityRange.class.getName());
         sysClss.add(IgfsFileInfo.class.getName());

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
index 06a2e1c..c366ae3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
@@ -22,6 +22,14 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.nio.ByteBuffer;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.internal.binary.BinaryUtils;
 import org.apache.ignite.internal.processors.task.GridInternal;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -37,7 +45,7 @@ import org.jetbrains.annotations.Nullable;
  * File's binary data block key.
  */
 @GridInternal
-public final class IgfsBlockKey implements Message, Externalizable, Comparable<IgfsBlockKey>
{
+public final class IgfsBlockKey implements Message, Externalizable, Binarylizable, Comparable<IgfsBlockKey>
{
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -150,6 +158,26 @@ public final class IgfsBlockKey implements Message, Externalizable, Comparable<I
     }
 
     /** {@inheritDoc} */
+    @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+        BinaryRawWriter out = writer.rawWriter();
+
+        BinaryUtils.writeIgniteUuid(out, fileId);
+        BinaryUtils.writeIgniteUuid(out, affKey);
+        out.writeBoolean(evictExclude);
+        out.writeLong(blockId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+        BinaryRawReader in = reader.rawReader();
+
+        fileId = BinaryUtils.readIgniteUuid(in);
+        affKey = BinaryUtils.readIgniteUuid(in);
+        evictExclude = in.readBoolean();
+        blockId = in.readLong();
+    }
+
+    /** {@inheritDoc} */
     @Override public int hashCode() {
         return fileId.hashCode() + (int)(blockId ^ (blockId >>> 32));
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDirectoryInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDirectoryInfo.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDirectoryInfo.java
index a426e8c..269098b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDirectoryInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDirectoryInfo.java
@@ -26,6 +26,7 @@ import org.apache.ignite.binary.Binarylizable;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 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.lang.IgniteUuid;
 import org.jetbrains.annotations.Nullable;
 
@@ -181,7 +182,19 @@ public class IgfsDirectoryInfo extends IgfsEntryInfo implements Binarylizable
{
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         super.writeExternal(out);
 
-        out.writeObject(listing);
+        if (listing != null) {
+            out.writeBoolean(true);
+
+            out.writeInt(listing.size());
+
+            for (Map.Entry<String, IgfsListingEntry> entry : listing.entrySet()) {
+                U.writeString(out, entry.getKey());
+
+                IgfsUtils.writeListingEntry(out, entry.getValue());
+            }
+        }
+        else
+            out.writeBoolean(false);
     }
 
     /** {@inheritDoc} */
@@ -189,7 +202,19 @@ public class IgfsDirectoryInfo extends IgfsEntryInfo implements Binarylizable
{
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
         super.readExternal(in);
 
-        listing = (Map<String, IgfsListingEntry>)in.readObject();
+        if (in.readBoolean()) {
+            int listingSize = in.readInt();
+
+            listing = new HashMap<>(listingSize);
+
+            for (int i = 0; i < listingSize; i++) {
+                String key = U.readString(in);
+
+                IgfsListingEntry val = IgfsUtils.readListingEntry(in);
+
+                listing.put(key, val);
+            }
+        }
     }
 
     /** {@inheritDoc} */
@@ -211,8 +236,6 @@ public class IgfsDirectoryInfo extends IgfsEntryInfo implements Binarylizable
{
         }
         else
             out.writeBoolean(false);
-
-        out.writeMap(listing);
     }
 
     /** {@inheritDoc} */
@@ -234,8 +257,6 @@ public class IgfsDirectoryInfo extends IgfsEntryInfo implements Binarylizable
{
                 listing.put(key, val);
             }
         }
-
-        listing = in.readMap();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEntryInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEntryInfo.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEntryInfo.java
index 9ff65da..4df8b34 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEntryInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEntryInfo.java
@@ -267,7 +267,9 @@ public abstract class IgfsEntryInfo implements Externalizable {
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         U.writeGridUuid(out, id);
-        U.writeStringMap(out, props);
+
+        IgfsUtils.writeProperties(out, props);
+
         out.writeLong(accessTime);
         out.writeLong(modificationTime);
     }
@@ -275,7 +277,9 @@ public abstract class IgfsEntryInfo implements Externalizable {
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
         id = U.readGridUuid(in);
-        props = U.readStringMap(in);
+
+        props = IgfsUtils.readProperties(in);
+
         accessTime = in.readLong();
         modificationTime = in.readLong();
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
index c6b7ad3..1b97565 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
@@ -36,6 +36,7 @@ import org.apache.ignite.internal.binary.BinaryUtils;
 import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException;
 import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
+import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.internal.util.future.IgniteFutureImpl;
 import org.apache.ignite.internal.util.lang.IgniteOutClosureX;
 import org.apache.ignite.internal.util.typedef.F;
@@ -45,6 +46,9 @@ import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.transactions.Transaction;
 import org.jetbrains.annotations.Nullable;
 
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
 import java.lang.reflect.Constructor;
 import java.util.HashMap;
 import java.util.Map;
@@ -471,6 +475,42 @@ public class IgfsUtils {
     }
 
     /**
+     * Write listing entry.
+     *
+     * @param out Writer.
+     * @param entry Entry.
+     * @throws IOException If failed.
+     */
+    public static void writeListingEntry(DataOutput out, @Nullable IgfsListingEntry entry)
throws IOException {
+        if (entry != null) {
+            out.writeBoolean(true);
+
+            IgniteUtils.writeGridUuid(out, entry.fileId());
+
+            out.writeBoolean(entry.isDirectory());
+        }
+        else
+            out.writeBoolean(false);
+    }
+
+    /**
+     * Read listing entry.
+     *
+     * @param in Reader.
+     * @return Entry.
+     */
+    @Nullable public static IgfsListingEntry readListingEntry(DataInput in) throws IOException
{
+        if (in.readBoolean()) {
+            IgniteUuid id = IgniteUtils.readGridUuid(in);
+            boolean dir = in.readBoolean();
+
+            return new IgfsListingEntry(id, dir);
+        }
+        else
+            return null;
+    }
+
+    /**
      * Write entry properties. Rely on reference equality for well-known properties.
      *
      * @param out Writer.
@@ -554,4 +594,91 @@ public class IgfsUtils {
         else
             return null;
     }
+
+    /**
+     * Write entry properties. Rely on reference equality for well-known properties.
+     *
+     * @param out Writer.
+     * @param props Properties.
+     * @throws IOException If failed.
+     */
+    @SuppressWarnings("StringEquality")
+    public static void writeProperties(DataOutput out, @Nullable Map<String, String>
props) throws IOException {
+        if (props != null) {
+            out.writeInt(props.size());
+
+            for (Map.Entry<String, String> entry : props.entrySet()) {
+                String key = entry.getKey();
+
+                if (key == PROP_PERMISSION)
+                    out.writeByte(PROP_PERMISSION_IDX);
+                else if (key == PROP_PREFER_LOCAL_WRITES)
+                    out.writeByte(PROP_PREFER_LOCAL_WRITES_IDX);
+                else if (key == PROP_USER_NAME)
+                    out.writeByte(PROP_USER_NAME_IDX);
+                else if (key == PROP_GROUP_NAME)
+                    out.writeByte(PROP_GROUP_NAME_IDX);
+                else {
+                    out.writeByte(PROP_IDX);
+                    U.writeString(out, key);
+                }
+
+                U.writeString(out, entry.getValue());
+            }
+        }
+        else
+            out.writeInt(-1);
+    }
+
+    /**
+     * Read entry properties.
+     *
+     * @param in Reader.
+     * @return Properties.
+     * @throws IOException If failed.
+     */
+    @Nullable public static Map<String, String> readProperties(DataInput in) throws
IOException {
+        int size = in.readInt();
+
+        if (size >= 0) {
+            Map<String, String> props = new HashMap<>(size);
+
+            for (int i = 0; i < size; i++) {
+                byte idx = in.readByte();
+
+                String key;
+
+                switch (idx) {
+                    case PROP_PERMISSION_IDX:
+                        key = PROP_PERMISSION;
+
+                        break;
+
+                    case PROP_PREFER_LOCAL_WRITES_IDX:
+                        key = PROP_PREFER_LOCAL_WRITES;
+
+                        break;
+
+                    case PROP_USER_NAME_IDX:
+                        key = PROP_USER_NAME;
+
+                        break;
+
+                    case PROP_GROUP_NAME_IDX:
+                        key = PROP_GROUP_NAME;
+
+                        break;
+
+                    default:
+                        key = U.readString(in);
+                }
+
+                props.put(key, U.readString(in));
+            }
+
+            return props;
+        }
+        else
+            return null;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryCreateProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryCreateProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryCreateProcessor.java
index 5f4fe73..eee9300 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryCreateProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryCreateProcessor.java
@@ -116,27 +116,25 @@ public class IgfsMetaDirectoryCreateProcessor implements EntryProcessor<IgniteUu
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         out.writeLong(createTime);
-        U.writeStringMap(out, props);
 
-        if (childName != null) {
-            out.writeBoolean(true);
+        IgfsUtils.writeProperties(out, props);
+
+        U.writeString(out, childName);
 
-            U.writeString(out, childName);
-            out.writeObject(childEntry);
-        }
-        else
-            out.writeBoolean(false);
+        if (childName != null)
+            IgfsUtils.writeListingEntry(out, childEntry);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
         createTime = in.readLong();
-        props = U.readStringMap(in);
 
-        if (in.readBoolean()) {
-            childName = U.readString(in);
-            childEntry = (IgfsListingEntry)in.readObject();
-        }
+        props = IgfsUtils.readProperties(in);
+
+        childName = U.readString(in);
+
+        if (childName != null)
+            childEntry = IgfsUtils.readListingEntry(in);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
index e9fa867..380d997 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
@@ -100,13 +100,15 @@ public final class IgfsMetaDirectoryListingAddProcessor implements EntryProcesso
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         U.writeString(out, fileName);
-        out.writeObject(entry);
+
+        IgfsUtils.writeListingEntry(out, entry);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
         fileName = U.readString(in);
-        entry = (IgfsListingEntry)in.readObject();
+
+        entry = IgfsUtils.readListingEntry(in);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingReplaceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingReplaceProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingReplaceProcessor.java
index dfc9bfc..e230f05 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingReplaceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingReplaceProcessor.java
@@ -98,13 +98,13 @@ public final class IgfsMetaDirectoryListingReplaceProcessor implements
EntryProc
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         U.writeString(out, name);
-        out.writeObject(id);
+        U.writeGridUuid(out, id);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
         name = U.readString(in);
-        id = (IgniteUuid)in.readObject();
+        id = U.readGridUuid(in);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileCreateProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileCreateProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileCreateProcessor.java
index 9fd16aa..8c4c296 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileCreateProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileCreateProcessor.java
@@ -116,20 +116,24 @@ public class IgfsMetaFileCreateProcessor implements EntryProcessor<IgniteUuid,
I
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         out.writeLong(createTime);
-        U.writeStringMap(out, props);
+
+        IgfsUtils.writeProperties(out, props);
+
         out.writeInt(blockSize);
-        out.writeObject(affKey);
-        out.writeObject(lockId);
+        U.writeGridUuid(out, affKey);
+        U.writeGridUuid(out, lockId);
         out.writeBoolean(evictExclude);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
         createTime = in.readLong();
-        props = U.readStringMap(in);
+
+        props = IgfsUtils.readProperties(in);
+
         blockSize = in.readInt();
-        affKey = (IgniteUuid)in.readObject();
-        lockId = (IgniteUuid)in.readObject();
+        affKey = U.readGridUuid(in);
+        lockId = U.readGridUuid(in);
         evictExclude = in.readBoolean();
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaUpdatePropertiesProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaUpdatePropertiesProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaUpdatePropertiesProcessor.java
index e0d5b8b..af79332 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaUpdatePropertiesProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaUpdatePropertiesProcessor.java
@@ -27,7 +27,6 @@ import org.apache.ignite.internal.processors.igfs.IgfsEntryInfo;
 import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.util.GridLeanMap;
 import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteUuid;
 
 import javax.cache.processor.EntryProcessor;
@@ -93,12 +92,12 @@ public class IgfsMetaUpdatePropertiesProcessor implements EntryProcessor<IgniteU
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
-        U.writeStringMap(out, props);
+        IgfsUtils.writeProperties(out, props);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        props = U.readStringMap(in);
+        props = IgfsUtils.readProperties(in);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
index ec3878c..2f6c7bf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
@@ -53,6 +53,7 @@ import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteUuid;
+import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
@@ -232,6 +233,13 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest
{
     }
 
     /**
+     * @return Use optimzied marshaller flag.
+     */
+    protected boolean useOptimizedMarshaller() {
+        return false;
+    }
+
+    /**
      * Data chunk.
      *
      * @param len Length.
@@ -332,6 +340,9 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest
{
 
         IgniteConfiguration cfg = new IgniteConfiguration();
 
+        if (useOptimizedMarshaller())
+            cfg.setMarshaller(new OptimizedMarshaller());
+
         cfg.setGridName(gridName);
 
         TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryOptimziedMarshallerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryOptimziedMarshallerSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryOptimziedMarshallerSelfTest.java
new file mode 100644
index 0000000..e4ad1f4
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryOptimziedMarshallerSelfTest.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.igfs;
+
+/**
+ * Tests for PRIMARY mode with optimized marshaller.
+ */
+public class IgfsPrimaryOptimziedMarshallerSelfTest extends IgfsPrimarySelfTest {
+    /** {@inheritDoc} */
+    @Override protected boolean useOptimizedMarshaller() {
+        return true;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/29806af4/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
index 038cb54..aff3ad7 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
@@ -40,6 +40,7 @@ import org.apache.ignite.internal.processors.igfs.IgfsModesSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsOneClientNodeTest;
 import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOffheapTieredSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOffheapValuesSelfTest;
+import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOptimziedMarshallerSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsPrimaryRelaxedSelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsPrimarySelfTest;
 import org.apache.ignite.internal.processors.igfs.IgfsProcessorSelfTest;
@@ -69,6 +70,7 @@ public class IgniteIgfsTestSuite extends TestSuite {
 
         suite.addTest(new TestSuite(IgfsPrimarySelfTest.class));
         suite.addTest(new TestSuite(IgfsPrimaryRelaxedSelfTest.class));
+        suite.addTest(new TestSuite(IgfsPrimaryOptimziedMarshallerSelfTest.class));
         suite.addTest(new TestSuite(IgfsPrimaryOffheapTieredSelfTest.class));
         suite.addTest(new TestSuite(IgfsPrimaryOffheapValuesSelfTest.class));
         suite.addTest(new TestSuite(IgfsDualSyncSelfTest.class));


Mime
View raw message