This is an automated email from the ASF dual-hosted git repository. qiaojialin pushed a commit to branch cherry_pick_rel in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit 368fedf9d33353b86986df87a97d2fd22e9d8790 Author: Jialin Qiao <[email protected]> AuthorDate: Mon Jul 22 17:25:34 2019 +0800 Release folder (#282) * generate sbin,conf,lib,tools in root folder when packaging * add license to RELEASE_NOTES.md --- RELEASE_NOTES.md | 21 ++++++ iotdb-cli/cli/{bin => sbin}/start-client.bat | 0 iotdb-cli/cli/{bin => sbin}/start-client.sh | 0 iotdb-cli/cli/{bin => tools}/export-csv.bat | 0 iotdb-cli/cli/{bin => tools}/export-csv.sh | 0 iotdb-cli/cli/{bin => tools}/import-csv.bat | 0 iotdb-cli/cli/{bin => tools}/import-csv.sh | 0 iotdb-cli/pom.xml | 33 +++++++++ .../iotdb/cli/client/StartClientScriptIT.java | 4 +- .../org/apache/iotdb/cli/tool/ExportCsvTestIT.java | 4 +- .../org/apache/iotdb/cli/tool/ImportCsvTestIT.java | 4 +- iotdb/pom.xml | 83 ++++++++++------------ .../apache/iotdb/db/service/IoTDBShutdownHook.java | 6 +- .../apache/iotdb/tsfile/utils/FileGenerator.java | 14 +--- .../org/apache/iotdb/tsfile/write/PerfTest.java | 18 ----- 15 files changed, 102 insertions(+), 85 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 3ad31c3..1633085 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,24 @@ +<!-- + + 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. + +--> + # Apache IoTDB (incubating) 0.8.0 This is the first official release of Apache IoTDB after joining the Incubator. diff --git a/iotdb-cli/cli/bin/start-client.bat b/iotdb-cli/cli/sbin/start-client.bat similarity index 100% rename from iotdb-cli/cli/bin/start-client.bat rename to iotdb-cli/cli/sbin/start-client.bat diff --git a/iotdb-cli/cli/bin/start-client.sh b/iotdb-cli/cli/sbin/start-client.sh similarity index 100% rename from iotdb-cli/cli/bin/start-client.sh rename to iotdb-cli/cli/sbin/start-client.sh diff --git a/iotdb-cli/cli/bin/export-csv.bat b/iotdb-cli/cli/tools/export-csv.bat similarity index 100% rename from iotdb-cli/cli/bin/export-csv.bat rename to iotdb-cli/cli/tools/export-csv.bat diff --git a/iotdb-cli/cli/bin/export-csv.sh b/iotdb-cli/cli/tools/export-csv.sh similarity index 100% rename from iotdb-cli/cli/bin/export-csv.sh rename to iotdb-cli/cli/tools/export-csv.sh diff --git a/iotdb-cli/cli/bin/import-csv.bat b/iotdb-cli/cli/tools/import-csv.bat similarity index 100% rename from iotdb-cli/cli/bin/import-csv.bat rename to iotdb-cli/cli/tools/import-csv.bat diff --git a/iotdb-cli/cli/bin/import-csv.sh b/iotdb-cli/cli/tools/import-csv.sh similarity index 100% rename from iotdb-cli/cli/bin/import-csv.sh rename to iotdb-cli/cli/tools/import-csv.sh diff --git a/iotdb-cli/pom.xml b/iotdb-cli/pom.xml index 2276380..663dbc4 100644 --- a/iotdb-cli/pom.xml +++ b/iotdb-cli/pom.xml @@ -103,6 +103,39 @@ <outputDirectory>${project.basedir}/cli/lib</outputDirectory> </configuration> </plugin> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.8</version> + <executions> + <execution> + <id>copy</id> + <phase>package</phase> + <configuration> + <target> + <echo>ANT TASK - copying client files....</echo> + <copy todir="${maven.multiModuleProjectDirectory}/lib/" overwrite="true" flatten="true"> + <fileset dir="${project.basedir}/cli/lib" includes="*.jar"> + <include name="*.jar"/> + </fileset> + </copy> + <copy todir="${maven.multiModuleProjectDirectory}/sbin/" overwrite="true" flatten="true"> + <fileset dir="${project.basedir}/cli/sbin" includes="*"> + <include name="*"/> + </fileset> + </copy> + <copy todir="${maven.multiModuleProjectDirectory}/tools/" overwrite="true" flatten="true"> + <fileset dir="${project.basedir}/cli/tools" includes="*"> + <include name="*"/> + </fileset> + </copy> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> <!--using `mvn test` to run UT, `mvn verify` to run ITs Reference: https://antoniogoncalves.org/2012/12/13/lets-turn-integration-tests-with-maven-to-a-first-class-citizen/--> <plugin> diff --git a/iotdb-cli/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java b/iotdb-cli/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java index faec221..55033a2 100644 --- a/iotdb-cli/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java +++ b/iotdb-cli/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java @@ -52,7 +52,7 @@ public class StartClientScriptIT extends AbstractScript { "IoTDB> Connection Error, please check whether the network is available or the server has started. Host is 127.0.0.1, port is 6668."}; String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%"); ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c", - dir + File.separator + "cli" + File.separator + "bin" + File.separator + "start-client.bat", + dir + File.separator + "cli" + File.separator + "sbin" + File.separator + "start-client.bat", "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root"); testOutput(builder, output); @@ -65,7 +65,7 @@ public class StartClientScriptIT extends AbstractScript { "IoTDB> Connection Error, please check whether the network is available or the server has started. Host is 127.0.0.1, port is 6668."}; String dir = getCurrentPath("pwd"); ProcessBuilder builder = new ProcessBuilder("sh", - dir + File.separator + "cli" + File.separator + "bin" + File.separator + "start-client.sh", + dir + File.separator + "cli" + File.separator + "sbin" + File.separator + "start-client.sh", "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root"); testOutput(builder, output); diff --git a/iotdb-cli/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java b/iotdb-cli/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java index fc33fed..1836df0 100644 --- a/iotdb-cli/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java +++ b/iotdb-cli/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java @@ -54,7 +54,7 @@ public class ExportCsvTestIT extends AbstractScript{ + "please check whether the network is available or the server has started."}; String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%"); ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c", - dir + File.separator + "cli" + File.separator + "bin" + File.separator + "export-csv.bat", + dir + File.separator + "cli" + File.separator + "tools" + File.separator + "export-csv.bat", "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root", "-td", "./"); testOutput(builder, output); } @@ -68,7 +68,7 @@ public class ExportCsvTestIT extends AbstractScript{ + "please check whether the network is available or the server has started."}; String dir = getCurrentPath("pwd"); ProcessBuilder builder = new ProcessBuilder("sh", - dir + File.separator + "cli" + File.separator + "bin" + File.separator + "export-csv.sh", + dir + File.separator + "cli" + File.separator + "tools" + File.separator + "export-csv.sh", "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root", "-td", "./"); testOutput(builder, output); } diff --git a/iotdb-cli/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java b/iotdb-cli/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java index 57812c4..755c8df 100644 --- a/iotdb-cli/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java +++ b/iotdb-cli/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java @@ -54,7 +54,7 @@ public class ImportCsvTestIT extends AbstractScript { + "the network is available or the server has started."}; String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%"); ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c", - dir + File.separator + "cli" + File.separator + "bin" + File.separator + "import-csv.bat", + dir + File.separator + "cli" + File.separator + "tools" + File.separator + "import-csv.bat", "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root", "-f", "./"); testOutput(builder, output); } @@ -68,7 +68,7 @@ public class ImportCsvTestIT extends AbstractScript { + "the network is available or the server has started."}; String dir = getCurrentPath("pwd"); ProcessBuilder builder = new ProcessBuilder("sh", - dir + File.separator + "cli" + File.separator + "bin" + File.separator + "import-csv.sh", + dir + File.separator + "cli" + File.separator + "tools" + File.separator + "import-csv.sh", "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root", "-f", "./"); testOutput(builder, output); diff --git a/iotdb/pom.xml b/iotdb/pom.xml index 25ff02b..17568f1 100644 --- a/iotdb/pom.xml +++ b/iotdb/pom.xml @@ -159,6 +159,44 @@ <outputDirectory>${project.basedir}/iotdb/lib</outputDirectory> </configuration> </plugin> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.8</version> + <executions> + <execution> + <id>copy</id> + <phase>package</phase> + <configuration> + <target> + <echo>ANT TASK - copying server files....</echo> + <copy todir="${maven.multiModuleProjectDirectory}/conf/" overwrite="true" flatten="true"> + <fileset dir="${project.basedir}/iotdb/conf" includes="*"> + <include name="*"/> + </fileset> + </copy> + <copy todir="${maven.multiModuleProjectDirectory}/lib/" overwrite="true" flatten="true"> + <fileset dir="${project.basedir}/iotdb/lib" includes="*.jar"> + <include name="*.jar"/> + </fileset> + </copy> + <copy todir="${maven.multiModuleProjectDirectory}/sbin/" overwrite="true" flatten="true"> + <fileset dir="${project.basedir}/iotdb/sbin" includes="*"> + <include name="*"/> + </fileset> + </copy> + <copy todir="${maven.multiModuleProjectDirectory}/tools/" overwrite="true" flatten="true"> + <fileset dir="${project.basedir}/iotdb/tools" includes="*"> + <include name="*"/> + </fileset> + </copy> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> <!--using `mvn test` to run UT, `mvn verify` to run ITs Reference: https://antoniogoncalves.org/2012/12/13/lets-turn-integration-tests-with-maven-to-a-first-class-citizen/--> <plugin> @@ -186,51 +224,6 @@ <skipITs>${iotdb.it.skip}</skipITs> </configuration> </plugin> - <!-- for TsFile Checker --> - <!--<plugin>--> - <!--<groupId>org.apache.maven.plugins</groupId>--> - <!--<artifactId>maven-assembly-plugin</artifactId>--> - <!--<version>2.5.5</version>--> - <!--<configuration>--> - <!--<archive>--> - <!--<manifest>--> - <!--<addClasspath>true</addClasspath>--> - <!--<mainClass>org.apache.iotdb.db.tools.TsFileChecker</mainClass>--> - <!--</manifest>--> - <!--</archive>--> - <!--<descriptorRefs>--> - <!--<descriptorRef>jar-with-dependencies</descriptorRef>--> - <!--</descriptorRefs>--> - <!--</configuration>--> - <!--<executions>--> - <!--<execution>--> - <!--<id>make-assembly</id>--> - <!--<phase>package</phase>--> - <!--<goals>--> - <!--<goal>single</goal>--> - <!--</goals>--> - <!--</execution>--> - <!--</executions>--> - <!--</plugin>--> - <!-- Might require this in Eclipse --> - <!--plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <version>3.0.0</version> - <executions> - <execution> - <phase>generate-sources</phase> - <goals> - <goal>add-source</goal> - </goals> - <configuration> - <sources> - <source>${project.basedir}/target/generated-sources/antlr3</source> - </sources> - </configuration> - </execution> - </executions> -</plugin--> </plugins> </build> <profiles> diff --git a/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDBShutdownHook.java b/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDBShutdownHook.java index 1ad304b..2b8dd07 100644 --- a/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDBShutdownHook.java +++ b/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDBShutdownHook.java @@ -29,10 +29,8 @@ public class IoTDBShutdownHook extends Thread{ @Override public void run() { if(logger.isInfoEnabled()) { - logger.info("IoTDB exits..."); - logger.info("Jvm memory usage: {}", - MemUtils.bytesCntToStr(Runtime.getRuntime().totalMemory() - - Runtime.getRuntime().freeMemory())); + logger.info("IoTDB exits. Jvm memory usage: {}", MemUtils.bytesCntToStr( + Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())); } } } diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/utils/FileGenerator.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/utils/FileGenerator.java index 245a663..f0059f7 100755 --- a/tsfile/src/test/java/org/apache/iotdb/tsfile/utils/FileGenerator.java +++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/utils/FileGenerator.java @@ -147,7 +147,7 @@ public class FileGenerator { fw.close(); } - static public void write() throws IOException, InterruptedException, WriteProcessException { + static public void write() throws IOException { File file = new File(outputDataFile); File errorFile = new File(errorOutputDataFile); if (file.exists()) { @@ -157,9 +157,6 @@ public class FileGenerator { errorFile.delete(); } - - // TSFileDescriptor.conf.chunkGroupSize = 2000; - // TSFileDescriptor.conf.pageSizeInByte = 100; innerWriter = new TsFileWriter(file, schema, TSFileDescriptor.getInstance().getConfig()); // write @@ -184,7 +181,7 @@ public class FileGenerator { } static public void writeToFile(FileSchema schema) - throws InterruptedException, IOException, WriteProcessException { + throws IOException, WriteProcessException { Scanner in = getDataFile(inputDataFile); long lineCount = 0; long startTime = System.currentTimeMillis(); @@ -192,9 +189,6 @@ public class FileGenerator { assert in != null; while (in.hasNextLine()) { if (lineCount % 1000000 == 0) { - endTime = System.currentTimeMillis(); - // logger.info("write line:{},inner space consumer:{},use - // time:{}",lineCount,innerWriter.calculateMemSizeForEachGroup(),endTime); LOG.info("write line:{},use time:{}s", lineCount, (endTime - startTime) / 1000); } String str = in.nextLine(); @@ -206,10 +200,6 @@ public class FileGenerator { LOG.info("write line:{},use time:{}s", lineCount, (endTime - startTime) / 1000); innerWriter.close(); in.close(); - endTime = System.currentTimeMillis(); - LOG.info("write total:{},use time:{}s", lineCount, (endTime - startTime) / 1000); - LOG.info("src file size:{}GB", FileUtils.getLocalFileByte(inputDataFile, FileUtils.Unit.GB)); - LOG.info("src file size:{}MB", FileUtils.getLocalFileByte(outputDataFile, FileUtils.Unit.MB)); } static private Scanner getDataFile(String path) { diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/PerfTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/PerfTest.java index e8f3398..372bc9d 100755 --- a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/PerfTest.java +++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/PerfTest.java @@ -144,31 +144,13 @@ public class PerfTest { static private void writeToFile(FileSchema schema) throws InterruptedException, IOException, WriteProcessException { Scanner in = getDataFile(inputDataFile); - long lineCount = 0; - long startTime = System.currentTimeMillis(); - long endTime = System.currentTimeMillis(); assert in != null; while (in.hasNextLine()) { - if (lineCount % 1000000 == 0) { - endTime = System.currentTimeMillis(); - // logger.info("write line:{},inner space consumer:{},use - // time:{}",lineCount,innerWriter.calculateMemSizeForEachGroup(),endTime); - LOG.info("write line:{},use time:{}s", lineCount, (endTime - startTime) / 1000); - } String str = in.nextLine(); TSRecord record = RecordUtils.parseSimpleTupleRecord(str, schema); innerWriter.write(record); - lineCount++; } - endTime = System.currentTimeMillis(); - LOG.info("write line:{},use time:{}s", lineCount, (endTime - startTime) / 1000); innerWriter.close(); - endTime = System.currentTimeMillis(); - LOG.info("write total:{},use time:{}s", lineCount, (endTime - startTime) / 1000); - LOG.info("write total:{},use time:{}ms", lineCount, (endTime - startTime)); - LOG.info("src file size:{} GB", FileUtils.getLocalFileByte(inputDataFile, Unit.GB)); - LOG.info("tsfile size:{} MB", FileUtils.getLocalFileByte(outputDataFile, Unit.MB)); - LOG.info("tsfile size:{} B", FileUtils.getLocalFileByte(outputDataFile, Unit.B)); } private static FileSchema generateTestData() {
