ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [47/50] ignite git commit: Revert "IGNITE-3332: IGFS: Implemented unlock task for client nodes."
Date Mon, 20 Jun 2016 12:53:27 GMT
Revert "IGNITE-3332: IGFS: Implemented unlock task for client nodes."

This reverts commit df60f650e06f1b0782dd76277ae6415f3bc708e1.


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

Branch: refs/heads/ignite-3341
Commit: 04af846d86d400cb8887d23fea55392e1f625bdf
Parents: bf9de9d
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Fri Jun 17 17:39:31 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Jun 17 17:39:31 2016 +0300

----------------------------------------------------------------------
 .../processors/igfs/IgfsMetaManager.java        |  17 +--
 .../igfs/client/IgfsClientAbstractCallable.java |  14 +-
 .../igfs/client/IgfsClientAffinityCallable.java |   5 +
 .../igfs/client/IgfsClientDeleteCallable.java   |   6 +-
 .../igfs/client/IgfsClientExistsCallable.java   |   5 +
 .../igfs/client/IgfsClientInfoCallable.java     |   5 +
 .../client/IgfsClientListFilesCallable.java     |   5 +
 .../client/IgfsClientListPathsCallable.java     |   5 +
 .../igfs/client/IgfsClientMkdirsCallable.java   |   5 +-
 .../igfs/client/IgfsClientRenameCallable.java   |   5 +-
 .../igfs/client/IgfsClientSetTimesCallable.java |   6 +-
 .../igfs/client/IgfsClientSizeCallable.java     |   5 +
 .../igfs/client/IgfsClientSummaryCallable.java  |   5 +
 .../igfs/client/IgfsClientUpdateCallable.java   |   5 +-
 .../meta/IgfsClientMetaFileUnlockCallable.java  | 130 -------------------
 .../meta/IgfsClientMetaIdsForPathCallable.java  |   5 +
 .../meta/IgfsClientMetaInfoForPathCallable.java |   5 +
 17 files changed, 58 insertions(+), 175 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/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 8f1bb69..30c7d10 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
@@ -48,7 +48,6 @@ import org.apache.ignite.internal.processors.cache.GridCacheInternal;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
 import org.apache.ignite.internal.processors.igfs.client.IgfsClientAbstractCallable;
-import org.apache.ignite.internal.processors.igfs.client.meta.IgfsClientMetaFileUnlockCallable;
 import org.apache.ignite.internal.processors.igfs.client.meta.IgfsClientMetaIdsForPathCallable;
 import org.apache.ignite.internal.processors.igfs.client.meta.IgfsClientMetaInfoForPathCallable;
 import org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryCreateProcessor;
@@ -252,14 +251,9 @@ public class IgfsMetaManager extends IgfsManager {
      */
     <T> T runClientTask(IgfsClientAbstractCallable<T> task) {
         try {
-            if (task.isAffinityBased() && cfg.isColocateMetadata()) {
+            if (!task.isReadOnly() && cfg.isColocateMetadata())
                 // If task mutates state and co-location is enabled, we route request to
primary node.
-                IgniteUuid affKey = task.affinityKey();
-
-                assert affKey != null;
-
-                return compute().affinityCall(cfg.getMetaCacheName(), affKey, task);
-            }
+                return compute().affinityCall(cfg.getMetaCacheName(), IgfsUtils.ROOT_ID,
task);
             else
                 // Otherwise we route to any available data node.
                 return metaCompute().call(task);
@@ -679,13 +673,6 @@ public class IgfsMetaManager extends IgfsManager {
     public void unlock(final IgniteUuid fileId, final IgniteUuid lockId, final long modificationTime,
         final boolean updateSpace, final long space, @Nullable final IgfsFileAffinityRange
affRange)
         throws IgniteCheckedException {
-        if (isClient()) {
-            runClientTask(new IgfsClientMetaFileUnlockCallable(cfg.getName(), fileId, lockId,
modificationTime,
-                updateSpace, space, affRange));
-
-            return;
-        }
-
         validTxState(false);
 
         if (busyLock.enterBusy()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
index a41418f..c06619f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
@@ -29,7 +29,6 @@ import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.processors.igfs.IgfsEx;
 import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.lang.IgniteCallable;
-import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.resources.IgniteInstanceResource;
 import org.jetbrains.annotations.Nullable;
 
@@ -89,18 +88,7 @@ public abstract class IgfsClientAbstractCallable<T> implements IgniteCallable<T>
     /**
      * @return {@code True} if task is read-only and does not change metadata.
      */
-    @Nullable public IgniteUuid affinityKey() {
-        return null;
-    }
-
-    /**
-     * Whether this callable is affinity-based.
-     *
-     * @return {@code True} if affinity based.
-     */
-    public boolean isAffinityBased() {
-        return affinityKey() != null;
-    }
+    public abstract boolean isReadOnly();
 
     /** {@inheritDoc} */
     @Override public final void writeBinary(BinaryWriter writer) throws BinaryObjectException
{

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
index 1668f36..6e2748d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
@@ -74,6 +74,11 @@ public class IgfsClientAffinityCallable extends IgfsClientAbstractCallable<Colle
     }
 
     /** {@inheritDoc} */
+    @Override public boolean isReadOnly() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
     @Override public void writeBinary0(BinaryRawWriter writer) throws BinaryObjectException
{
         writer.writeLong(start);
         writer.writeLong(len);

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
index 31c158b..21f8c46 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
@@ -22,9 +22,7 @@ import org.apache.ignite.binary.BinaryRawReader;
 import org.apache.ignite.binary.BinaryRawWriter;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
-import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteUuid;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -63,8 +61,8 @@ public class IgfsClientDeleteCallable extends IgfsClientAbstractCallable<Boolean
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public IgniteUuid affinityKey() {
-        return IgfsUtils.ROOT_ID;
+    @Override public boolean isReadOnly() {
+        return false;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientExistsCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientExistsCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientExistsCallable.java
index 04b63d8..536cdc8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientExistsCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientExistsCallable.java
@@ -52,6 +52,11 @@ public class IgfsClientExistsCallable extends IgfsClientAbstractCallable<Boolean
     }
 
     /** {@inheritDoc} */
+    @Override public boolean isReadOnly() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientExistsCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientInfoCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientInfoCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientInfoCallable.java
index f97c3c4..6bab8b8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientInfoCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientInfoCallable.java
@@ -53,6 +53,11 @@ public class IgfsClientInfoCallable extends IgfsClientAbstractCallable<IgfsFile>
     }
 
     /** {@inheritDoc} */
+    @Override public boolean isReadOnly() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientInfoCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListFilesCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListFilesCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListFilesCallable.java
index 325e714..deb8836 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListFilesCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListFilesCallable.java
@@ -55,6 +55,11 @@ public class IgfsClientListFilesCallable extends IgfsClientAbstractCallable<Coll
     }
 
     /** {@inheritDoc} */
+    @Override public boolean isReadOnly() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientListFilesCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListPathsCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListPathsCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListPathsCallable.java
index 78b4c84..ad6c858 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListPathsCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListPathsCallable.java
@@ -54,6 +54,11 @@ public class IgfsClientListPathsCallable extends IgfsClientAbstractCallable<Coll
     }
 
     /** {@inheritDoc} */
+    @Override public boolean isReadOnly() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientListPathsCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
index 5c2a6ca..6ecb6ea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
@@ -24,7 +24,6 @@ import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteUuid;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.Map;
@@ -67,8 +66,8 @@ public class IgfsClientMkdirsCallable extends IgfsClientAbstractCallable<Void>
{
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public IgniteUuid affinityKey() {
-        return IgfsUtils.ROOT_ID;
+    @Override public boolean isReadOnly() {
+        return false;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
index 126b290..142af47 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
@@ -24,7 +24,6 @@ import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteUuid;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -65,8 +64,8 @@ public class IgfsClientRenameCallable extends IgfsClientAbstractCallable<Void>
{
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public IgniteUuid affinityKey() {
-        return IgfsUtils.ROOT_ID;
+    @Override public boolean isReadOnly() {
+        return false;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
index 1e18690..8c302bc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
@@ -22,9 +22,7 @@ import org.apache.ignite.binary.BinaryRawReader;
 import org.apache.ignite.binary.BinaryRawWriter;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
-import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteUuid;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -71,8 +69,8 @@ public class IgfsClientSetTimesCallable extends IgfsClientAbstractCallable<Void>
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public IgniteUuid affinityKey() {
-        return IgfsUtils.ROOT_ID;
+    @Override public boolean isReadOnly() {
+        return false;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
index 474a940..29a7b7a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
@@ -53,6 +53,11 @@ public class IgfsClientSizeCallable extends IgfsClientAbstractCallable<Long>
{
     }
 
     /** {@inheritDoc} */
+    @Override public boolean isReadOnly() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientSizeCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSummaryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSummaryCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSummaryCallable.java
index 7e29029..1e2795c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSummaryCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSummaryCallable.java
@@ -53,6 +53,11 @@ public class IgfsClientSummaryCallable extends IgfsClientAbstractCallable<IgfsPa
     }
 
     /** {@inheritDoc} */
+    @Override public boolean isReadOnly() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientSummaryCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
index d9ffe56..82d6e8d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
@@ -25,7 +25,6 @@ import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.igfs.IgfsContext;
 import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteUuid;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.Map;
@@ -66,8 +65,8 @@ public class IgfsClientUpdateCallable extends IgfsClientAbstractCallable<IgfsFil
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public IgniteUuid affinityKey() {
-        return IgfsUtils.ROOT_ID;
+    @Override public boolean isReadOnly() {
+        return false;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaFileUnlockCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaFileUnlockCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaFileUnlockCallable.java
deleted file mode 100644
index 22e512a..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaFileUnlockCallable.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.igfs.client.meta;
-
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinaryRawReader;
-import org.apache.ignite.binary.BinaryRawWriter;
-import org.apache.ignite.internal.binary.BinaryUtils;
-import org.apache.ignite.internal.processors.igfs.IgfsContext;
-import org.apache.ignite.internal.processors.igfs.IgfsFileAffinityRange;
-import org.apache.ignite.internal.processors.igfs.client.IgfsClientAbstractCallable;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.lang.IgniteUuid;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Callable to unlock file info.
- */
-public class IgfsClientMetaFileUnlockCallable extends IgfsClientAbstractCallable<Void>
{
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** File ID. */
-    private IgniteUuid fileId;
-
-    /** Lock ID. */
-    private IgniteUuid lockId;
-
-    /** Modification time. */
-    private long modificationTime;
-
-    /** Whether to update space. */
-    private boolean updateSpace;
-
-    /** Space. */
-    private long space;
-
-    /** Affinity range. */
-    private IgfsFileAffinityRange affRange;
-
-    /**
-     * Default constructor.
-     */
-    public IgfsClientMetaFileUnlockCallable() {
-        // NO-op.
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param igfsName IGFS name.
-     * @param fileId File ID.
-     * @param lockId Lock ID.
-     * @param modificationTime Modification time.
-     */
-    public IgfsClientMetaFileUnlockCallable(@Nullable String igfsName, IgniteUuid fileId,
IgniteUuid lockId,
-        long modificationTime, boolean updateSpace, long space, @Nullable IgfsFileAffinityRange
affRange) {
-        super(igfsName, null);
-
-        this.fileId = fileId;
-        this.lockId = lockId;
-        this.modificationTime = modificationTime;
-        this.updateSpace = updateSpace;
-        this.space = space;
-        this.affRange = affRange;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected Void call0(IgfsContext ctx) throws Exception {
-        ctx.meta().unlock(fileId, lockId, modificationTime, updateSpace, space, affRange);
-
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteUuid affinityKey() {
-        return fileId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeBinary0(BinaryRawWriter writer) throws BinaryObjectException
{
-        BinaryUtils.writeIgniteUuid(writer, fileId);
-        BinaryUtils.writeIgniteUuid(writer, lockId);
-
-        writer.writeLong(modificationTime);
-
-        if (updateSpace) {
-            writer.writeBoolean(true);
-            writer.writeLong(space);
-            writer.writeObject(affRange);
-        }
-        else
-            writer.writeBoolean(false);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readBinary0(BinaryRawReader reader) throws BinaryObjectException
{
-        fileId = BinaryUtils.readIgniteUuid(reader);
-        lockId = BinaryUtils.readIgniteUuid(reader);
-
-        modificationTime = reader.readLong();
-
-        if (reader.readBoolean()) {
-            updateSpace = true;
-
-            space = reader.readLong();
-            affRange = reader.readObject();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgfsClientMetaFileUnlockCallable.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaIdsForPathCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaIdsForPathCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaIdsForPathCallable.java
index 7b3d142..b07a0cb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaIdsForPathCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaIdsForPathCallable.java
@@ -59,6 +59,11 @@ public class IgfsClientMetaIdsForPathCallable extends IgfsClientAbstractCallable
     }
 
     /** {@inheritDoc} */
+    @Override public boolean isReadOnly() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientMetaIdsForPathCallable.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/04af846d/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaInfoForPathCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaInfoForPathCallable.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaInfoForPathCallable.java
index cb31663..e7e0164 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaInfoForPathCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaInfoForPathCallable.java
@@ -57,6 +57,11 @@ public class IgfsClientMetaInfoForPathCallable extends IgfsClientAbstractCallabl
     }
 
     /** {@inheritDoc} */
+    @Override public boolean isReadOnly() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgfsClientMetaInfoForPathCallable.class, this);
     }


Mime
View raw message