Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AE9BF200B2A for ; Fri, 10 Jun 2016 12:02:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AD820160A04; Fri, 10 Jun 2016 10:02:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D3308160A38 for ; Fri, 10 Jun 2016 12:02:07 +0200 (CEST) Received: (qmail 69790 invoked by uid 500); 10 Jun 2016 10:02:07 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 69781 invoked by uid 99); 10 Jun 2016 10:02:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2016 10:02:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CB1A1DFB38; Fri, 10 Jun 2016 10:02:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Fri, 10 Jun 2016 10:02:07 -0000 Message-Id: <5fa5524dd6d1412f92bcc46b08e702e9@git.apache.org> In-Reply-To: <73857c52e2e841c0a33f9ec14325481f@git.apache.org> References: <73857c52e2e841c0a33f9ec14325481f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] ignite git commit: IGNITE-3294: Prepared file processor. archived-at: Fri, 10 Jun 2016 10:02:08 -0000 IGNITE-3294: Prepared file processor. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/dfaefc4b Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dfaefc4b Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dfaefc4b Branch: refs/heads/ignite-3294 Commit: dfaefc4b7f87ebde04a51c19ef13aadca821d1db Parents: 670bad6 Author: vozerov-gridgain Authored: Fri Jun 10 13:01:38 2016 +0300 Committer: vozerov-gridgain Committed: Fri Jun 10 13:01:38 2016 +0300 ---------------------------------------------------------------------- .../processors/igfs/IgfsMetaManager.java | 25 +++++----------- .../igfs/meta/IgfsMetaFileCreateProcessor.java | 30 +++++++++++++++++--- 2 files changed, 33 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/dfaefc4b/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 20500e8..5bc314d 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 @@ -2931,35 +2931,23 @@ 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); - IgfsEntryInfo newInfo2 = IgfsUtils.createFile( - overwriteId, - secondaryFile.blockSize(), - secondaryFile.length(), - affKey, - newLockId, - evictExclude, - secondaryFile.properties(), - secondaryFile.accessTime(), - secondaryFile.modificationTime() - ); - newAccessTime = secondaryFile.accessTime(); newModificationTime = secondaryFile.modificationTime(); newProps = secondaryFile.properties(); newLen = secondaryFile.length(); - newBlockSize = (int)secondaryFile.length(); + newBlockSize = secondaryFile.blockSize(); } else { newAccessTime = System.currentTimeMillis(); newModificationTime = newAccessTime; newProps = fileProps; - newLen = 0; + newLen = 0L; newBlockSize = blockSize; } IgfsEntryInfo newInfo = invokeAndGet(overwriteId, - new IgfsMetaFileCreateProcessor(newAccessTime, newProps, newBlockSize, affKey, - newLockId, evictExclude)); + new IgfsMetaFileCreateProcessor(newAccessTime, newModificationTime, newProps, + newBlockSize, affKey, newLockId, evictExclude, newLen)); // Prepare result and commit. tx.commit(); @@ -2969,6 +2957,7 @@ public class IgfsMetaManager extends IgfsManager { return new IgfsCreateResult(newInfo, secondaryOut); } else { + // TODO: Handle this part. // Create file and parent folders. IgfsPathsCreateResult res = createFile(pathIds, lockInfos, dirProps, fileProps, blockSize, affKey, evictExclude); @@ -3110,8 +3099,8 @@ public class IgfsMetaManager extends IgfsManager { if (dir) info = invokeAndGet(curId, new IgfsMetaDirectoryCreateProcessor(createTime, dirProps)); else - info = invokeAndGet(curId, new IgfsMetaFileCreateProcessor(createTime, fileProps, - blockSize, affKey, createFileLockId(false), evictExclude)); + info = invokeAndGet(curId, new IgfsMetaFileCreateProcessor(createTime, createTime, fileProps, + blockSize, affKey, createFileLockId(false), evictExclude, 0L)); createdPaths.add(pathIds.path()); http://git-wip-us.apache.org/repos/asf/ignite/blob/dfaefc4b/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 8c4c296..6c2bfa5 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 @@ -51,6 +51,9 @@ public class IgfsMetaFileCreateProcessor implements EntryProcessor props; @@ -66,6 +69,9 @@ public class IgfsMetaFileCreateProcessor implements EntryProcessor props, int blockSize, - @Nullable IgniteUuid affKey, IgniteUuid lockId, boolean evictExclude) { + public IgfsMetaFileCreateProcessor(long createTime, long modificationTime, Map props, + int blockSize, @Nullable IgniteUuid affKey, IgniteUuid lockId, boolean evictExclude, long len) { this.createTime = createTime; + this.modificationTime = modificationTime; this.props = props; this.blockSize = blockSize; this.affKey = affKey; this.lockId = lockId; this.evictExclude = evictExclude; + this.len = len; } /** {@inheritDoc} */ @@ -99,13 +109,13 @@ public class IgfsMetaFileCreateProcessor implements EntryProcessor