ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [07/14] ignite git commit: Simplified ctor.
Date Tue, 07 Jun 2016 07:56:10 GMT
Simplified ctor.


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

Branch: refs/heads/ignite-3264
Commit: 04e311b8cef3dd8e3dd1c27f8f4d5816bcc916db
Parents: a76b349
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Jun 6 12:07:05 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Jun 6 12:07:05 2016 +0300

----------------------------------------------------------------------
 .../processors/igfs/IgfsOutputStreamImpl.java   | 25 +++++++-------------
 1 file changed, 9 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/04e311b8/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsOutputStreamImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsOutputStreamImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsOutputStreamImpl.java
index 8c93aad..13808ea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsOutputStreamImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsOutputStreamImpl.java
@@ -119,33 +119,26 @@ class IgfsOutputStreamImpl extends IgfsOutputStream {
      */
     IgfsOutputStreamImpl(IgfsContext igfsCtx, IgfsPath path, IgfsEntryInfo fileInfo, int
bufSize, IgfsMode mode,
         @Nullable IgfsFileWorkerBatch batch) {
+        assert fileInfo != null && fileInfo.isFile() : "Unexpected file info: " +
fileInfo;
+        assert mode != null && mode != PROXY && (mode == PRIMARY &&
batch == null || batch != null);
+
+        // File hasn't been locked.
+        if (fileInfo.lockId() == null)
+            throw new IgfsException("Failed to acquire file lock (concurrently modified?):
" + path);
+
         synchronized (mux) {
             this.path = path;
             this.bufSize = optimizeBufferSize(bufSize, fileInfo);
-
-            assert fileInfo != null;
-            assert fileInfo.isFile() : "Unexpected file info: " + fileInfo;
-            assert mode != null && mode != PROXY;
-            assert mode == PRIMARY && batch == null || batch != null;
-
-            // File hasn't been locked.
-            if (fileInfo.lockId() == null)
-                throw new IgfsException("Failed to acquire file lock (concurrently modified?):
" + path);
-
-            assert !IgfsUtils.DELETE_LOCK_ID.equals(fileInfo.lockId());
-
             this.igfsCtx = igfsCtx;
-
             this.fileInfo = fileInfo;
             this.mode = mode;
             this.batch = batch;
 
             streamRange = initialStreamRange(fileInfo);
-
             writeCompletionFut = igfsCtx.data().writeStart(fileInfo);
-
-            igfsCtx.igfs().localMetrics().incrementFilesOpenedForWrite();
         }
+
+        igfsCtx.igfs().localMetrics().incrementFilesOpenedForWrite();
     }
 
     /** {@inheritDoc} */


Mime
View raw message