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 8E3C0200C44 for ; Mon, 27 Mar 2017 16:57:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8CC9F160B99; Mon, 27 Mar 2017 14:57:45 +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 AF169160B5D for ; Mon, 27 Mar 2017 16:57:44 +0200 (CEST) Received: (qmail 22801 invoked by uid 500); 27 Mar 2017 14:57:43 -0000 Mailing-List: contact commits-help@carbondata.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@carbondata.incubator.apache.org Delivered-To: mailing list commits@carbondata.incubator.apache.org Received: (qmail 22792 invoked by uid 99); 27 Mar 2017 14:57:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Mar 2017 14:57:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 89BA2180993 for ; Mon, 27 Mar 2017 14:57:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.222 X-Spam-Level: X-Spam-Status: No, score=-4.222 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id z9eB1gYtTdRp for ; Mon, 27 Mar 2017 14:57:41 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 84C5B5FB40 for ; Mon, 27 Mar 2017 14:57:40 +0000 (UTC) Received: (qmail 22261 invoked by uid 99); 27 Mar 2017 14:57:39 -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; Mon, 27 Mar 2017 14:57:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7AB91DFFD7; Mon, 27 Mar 2017 14:57:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jackylk@apache.org To: commits@carbondata.incubator.apache.org Date: Mon, 27 Mar 2017 14:57:42 -0000 Message-Id: <317e9a4b672c41d2a8421fae3d9143b7@git.apache.org> In-Reply-To: <0de18a2d4d6e4d50bc6e6cafb3e5461d@git.apache.org> References: <0de18a2d4d6e4d50bc6e6cafb3e5461d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/6] incubator-carbondata git commit: Rename fileName to carbonDataFileTempPath. archived-at: Mon, 27 Mar 2017 14:57:45 -0000 Rename fileName to carbonDataFileTempPath. Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/d17f58f1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/d17f58f1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/d17f58f1 Branch: refs/heads/master Commit: d17f58f18ede87aef53e92973bd6e319fa2e31ad Parents: 84477cc Author: Yadong Qi Authored: Mon Mar 27 18:48:31 2017 +0800 Committer: Yadong Qi Committed: Mon Mar 27 18:48:31 2017 +0800 ---------------------------------------------------------------------- .../processing/mdkeygen/file/FileData.java | 2 +- .../store/writer/AbstractFactDataWriter.java | 27 +++++++++++--------- .../writer/v3/CarbonFactDataWriterImplV3.java | 4 +-- 3 files changed, 18 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/d17f58f1/processing/src/main/java/org/apache/carbondata/processing/mdkeygen/file/FileData.java ---------------------------------------------------------------------- diff --git a/processing/src/main/java/org/apache/carbondata/processing/mdkeygen/file/FileData.java b/processing/src/main/java/org/apache/carbondata/processing/mdkeygen/file/FileData.java index 340a2ab..024a0b9 100644 --- a/processing/src/main/java/org/apache/carbondata/processing/mdkeygen/file/FileData.java +++ b/processing/src/main/java/org/apache/carbondata/processing/mdkeygen/file/FileData.java @@ -37,7 +37,7 @@ public class FileData extends FileManager { } /** - * @return Returns the fileName. + * @return Returns the carbonDataFileTempPath. */ public String getFileName() { return fileName; http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/d17f58f1/processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java ---------------------------------------------------------------------- diff --git a/processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java b/processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java index a7dc534..90eab6f 100644 --- a/processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java +++ b/processing/src/main/java/org/apache/carbondata/processing/store/writer/AbstractFactDataWriter.java @@ -95,9 +95,9 @@ public abstract class AbstractFactDataWriter implements CarbonFactDataWriter< protected List blockletInfoList; protected boolean[] isNoDictionary; /** - * file name + * The temp path of carbonData file used on executor */ - protected String fileName; + protected String carbonDataFileTempPath; /** * The name of carbonData file @@ -261,10 +261,10 @@ public abstract class AbstractFactDataWriter implements CarbonFactDataWriter< protected void updateBlockletFileChannel(long blockletDataSize) throws CarbonDataWriterException { if ((currentFileSize + blockletDataSize) >= dataBlockSize && currentFileSize != 0) { // set the current file size to zero - LOGGER.info("Writing data to file as max file size reached for file: " + fileName + LOGGER.info("Writing data to file as max file size reached for file: " + carbonDataFileTempPath + " .Data block size: " + currentFileSize); // write meta data to end of the existing file - writeBlockletInfoToFile(fileChannel, fileName); + writeBlockletInfoToFile(fileChannel, carbonDataFileTempPath); this.currentFileSize = 0; blockletInfoList = new ArrayList(CarbonCommonConstants.CONSTANT_SIZE_TEN); @@ -276,7 +276,8 @@ public abstract class AbstractFactDataWriter implements CarbonFactDataWriter< // rename carbon data file from in progress status to actual renameCarbonDataFile(); executorServiceSubmitList.add(executorService - .submit(new CopyThread(this.fileName.substring(0, this.fileName.lastIndexOf('.'))))); + .submit(new CopyThread(this.carbonDataFileTempPath + .substring(0, this.carbonDataFileTempPath.lastIndexOf('.'))))); // initialize the new channel initializeWriter(); } @@ -299,12 +300,12 @@ public abstract class AbstractFactDataWriter implements CarbonFactDataWriter< String actualFileNameVal = carbonDataFileName + CarbonCommonConstants.FILE_INPROGRESS_STATUS; FileData fileData = new FileData(actualFileNameVal, dataWriterVo.getStoreLocation()); dataWriterVo.getFileManager().add(fileData); - this.fileName = dataWriterVo.getStoreLocation() + File.separator + carbonDataFileName - + CarbonCommonConstants.FILE_INPROGRESS_STATUS; + this.carbonDataFileTempPath = dataWriterVo.getStoreLocation() + File.separator + + carbonDataFileName + CarbonCommonConstants.FILE_INPROGRESS_STATUS; this.fileCount++; try { // open channel for new data file - fileOutputStream = new FileOutputStream(this.fileName, true); + fileOutputStream = new FileOutputStream(this.carbonDataFileTempPath, true); this.fileChannel = fileOutputStream.getChannel(); } catch (FileNotFoundException fileNotFoundException) { throw new CarbonDataWriterException("Problem while getting the FileChannel for Leaf File", @@ -420,7 +421,8 @@ public abstract class AbstractFactDataWriter implements CarbonFactDataWriter< if (this.blockletInfoList.size() > 0) { renameCarbonDataFile(); copyCarbonDataFileToCarbonStorePath( - this.fileName.substring(0, this.fileName.lastIndexOf('.'))); + this.carbonDataFileTempPath + .substring(0, this.carbonDataFileTempPath.lastIndexOf('.'))); try { writeIndexFile(); } catch (IOException e) { @@ -490,8 +492,9 @@ public abstract class AbstractFactDataWriter implements CarbonFactDataWriter< * @throws CarbonDataWriterException */ protected void renameCarbonDataFile() throws CarbonDataWriterException { - File origFile = new File(this.fileName.substring(0, this.fileName.lastIndexOf('.'))); - File curFile = new File(this.fileName); + File origFile = new File(this.carbonDataFileTempPath + .substring(0, this.carbonDataFileTempPath.lastIndexOf('.'))); + File curFile = new File(this.carbonDataFileTempPath); if (!curFile.renameTo(origFile)) { throw new CarbonDataWriterException("Problem while renaming the file"); } @@ -559,7 +562,7 @@ public abstract class AbstractFactDataWriter implements CarbonFactDataWriter< */ @Override public void writeBlockletInfoToFile() throws CarbonDataWriterException { if (this.blockletInfoList.size() > 0) { - writeBlockletInfoToFile(fileChannel, fileName); + writeBlockletInfoToFile(fileChannel, carbonDataFileTempPath); } } http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/d17f58f1/processing/src/main/java/org/apache/carbondata/processing/store/writer/v3/CarbonFactDataWriterImplV3.java ---------------------------------------------------------------------- diff --git a/processing/src/main/java/org/apache/carbondata/processing/store/writer/v3/CarbonFactDataWriterImplV3.java b/processing/src/main/java/org/apache/carbondata/processing/store/writer/v3/CarbonFactDataWriterImplV3.java index 668d0d8..3b7c763 100644 --- a/processing/src/main/java/org/apache/carbondata/processing/store/writer/v3/CarbonFactDataWriterImplV3.java +++ b/processing/src/main/java/org/apache/carbondata/processing/store/writer/v3/CarbonFactDataWriterImplV3.java @@ -540,11 +540,11 @@ public class CarbonFactDataWriterImplV3 extends AbstractFactDataWriter public void closeWriter() throws CarbonDataWriterException { if (dataWriterHolder.getNodeHolder().size() > 0) { writeDataToFile(fileChannel); - writeBlockletInfoToFile(fileChannel, fileName); + writeBlockletInfoToFile(fileChannel, carbonDataFileTempPath); CarbonUtil.closeStreams(this.fileOutputStream, this.fileChannel); renameCarbonDataFile(); copyCarbonDataFileToCarbonStorePath( - this.fileName.substring(0, this.fileName.lastIndexOf('.'))); + this.carbonDataFileTempPath.substring(0, this.carbonDataFileTempPath.lastIndexOf('.'))); try { writeIndexFile(); } catch (IOException e) {