ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/5] ignite git commit: WIP on flle open.
Date Sun, 05 Jun 2016 17:29:02 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3248 [created] 932637f86


WIP on flle open.


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

Branch: refs/heads/ignite-3248
Commit: e86f094e6ba6a07ece3613f9ac5d678040e1c44d
Parents: 14cf63f
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Sun Jun 5 19:33:03 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Sun Jun 5 19:33:03 2016 +0300

----------------------------------------------------------------------
 .../processors/igfs/IgfsInputStreamImpl.java    |  2 +-
 .../processors/igfs/IgfsMetaManager.java        |  4 +-
 .../meta/IgfsClientMetaInfoForPathCallable.java | 63 ++++++++++++++++++++
 3 files changed, 67 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e86f094e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java
index 447be93..de7071a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java
@@ -319,7 +319,7 @@ public class IgfsInputStreamImpl extends IgfsInputStreamAdapter {
                 }
 
                 // Safety to ensure no orphaned data blocks exist in case file was concurrently
deleted.
-               if (!meta.exists(fileInfo.id()))
+                if (!meta.exists(fileInfo.id()))
                     data.delete(fileInfo);
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e86f094e/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 35e77c4..83a3b0a 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
@@ -49,6 +49,7 @@ 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.IgfsClientMetaInfoForPathCallable;
 import org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryCreateProcessor;
 import org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileCreateProcessor;
 import org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileLockProcessor;
@@ -2114,7 +2115,8 @@ public class IgfsMetaManager extends IgfsManager {
                 assert path != null;
 
                 // First, try getting file info without any transactions and synchronization.
-                IgfsEntryInfo info = info(fileId(path));
+                IgfsEntryInfo info = client ?
+                    runClientTask(new IgfsClientMetaInfoForPathCallable(cfg.getName(), path))
: info(fileId(path));
 
                 if (info != null) {
                     if (!info.isFile())

http://git-wip-us.apache.org/repos/asf/ignite/blob/e86f094e/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
new file mode 100644
index 0000000..1ce6843
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaInfoForPathCallable.java
@@ -0,0 +1,63 @@
+/*
+ * 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.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.processors.igfs.IgfsEntryInfo;
+import org.apache.ignite.internal.processors.igfs.IgfsMetaManager;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientAbstractCallable;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Get entry info for the given path.
+ */
+public class IgfsClientMetaInfoForPathCallable extends IgfsClientAbstractCallable<IgfsEntryInfo>
{
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * Default constructor.
+     */
+    public IgfsClientMetaInfoForPathCallable() {
+        // NO-op.
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param igfsName IGFS name.
+     * @param path Path.
+     */
+    public IgfsClientMetaInfoForPathCallable(@Nullable String igfsName, IgfsPath path) {
+        super(igfsName, path);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgfsEntryInfo call0(IgfsContext ctx) throws Exception {
+        IgfsMetaManager meta =  ctx.meta();
+
+        return meta.info(meta.fileId(path));
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgfsClientMetaInfoForPathCallable.class, this);
+    }
+}


Mime
View raw message