From 9b355955ed7d3fb8886428755366ec7a2beac44f Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Mon, 5 Aug 2019 14:41:25 +0200 Subject: [PATCH] =?UTF-8?q?-=09Nothing=20is=20built=20outside=20the=20targ?= =?UTF-8?q?et=20directory=20anymore=20o=09I=20moved=20the=20static=20parts?= =?UTF-8?q?=20of=20the=20client=20and=20server=20distributions=20to=20?= =?UTF-8?q?=E2=80=9Csrc/assembly/resources=E2=80=9D=20and=20added=20an=20a?= =?UTF-8?q?ssembly=20that=20builds=20the=20client=20and=20server=20inside?= =?UTF-8?q?=20the=20target=20directory=20(You=20need=20to=20update=20the?= =?UTF-8?q?=20documentation=20on=20this)=20o=09The=20sever=20is=20now=20av?= =?UTF-8?q?ailable=20at=20server/target/iotdb-server-0.9.0-SNAPSHOT=20o=09?= =?UTF-8?q?The=20client=20is=20now=20available=20at=20client/target/iotdb-?= =?UTF-8?q?client-0.9.0-SNAPSHOT=20o=09I=20updated=20the=20integration=20t?= =?UTF-8?q?ests=20to=20work=20with=20these=20new=20locations=20-=09I=20upd?= =?UTF-8?q?ated=20the=20distribution=20module=20(binary-distribution)=20to?= =?UTF-8?q?=20simply=20include=20and=20unpack=20the=20client=20and=20serve?= =?UTF-8?q?r=20assemblies,=20which=20greatly=20simplifies=20the=20assembly?= =?UTF-8?q?=20itself.=20-=09In=20the=20integration-tests=20you=20use=20a?= =?UTF-8?q?=20process=20builder=20to=20get=20the=20current=20working=20dir?= =?UTF-8?q?ectory=20=E2=80=A6=20you=20can=20access=20this=20in=20the=20?= =?UTF-8?q?=E2=80=9Cuser.dir=E2=80=9D=20System=20property.=20-=09There=20w?= =?UTF-8?q?as=20a=20large=20mixture=20of=20artifacts=20with=20different=20?= =?UTF-8?q?versions=20in=20the=20classpath.=20o=09I=20set=20all=20versions?= =?UTF-8?q?=20to=20the=20same=20using=20a=20big=20dependencyManagement=20b?= =?UTF-8?q?lock=20in=20the=20master=20pom=20o=09I=20removed=20the=20versio?= =?UTF-8?q?n=20of=20every=20external=20dependency=20and=20moved=20it=20int?= =?UTF-8?q?o=20the=20main=20dependencyManagement=20block=20in=20the=20root?= =?UTF-8?q?=20pom=20(except=20dependencies=20only=20used=20in=20the=20exam?= =?UTF-8?q?ples,=20for=20these=20I=20added=20a=20dependencyManagement=20bl?= =?UTF-8?q?ock=20in=20the=20example=20pom).=20This=20way=20you=20instantly?= =?UTF-8?q?=20identify=20external=20dependencies.=20o=09I=20added=20an=20e?= =?UTF-8?q?nforcer=20rule=20to=20fail=20the=20build=20if=20two=20differing?= =?UTF-8?q?=20versions=20of=20one=20artifact=20are=20being=20used=20in=20t?= =?UTF-8?q?he=20build=20(This=20should=20eliminate=20this=20problem=20from?= =?UTF-8?q?=20re-occuring)=20o=09I=20replaced=20the=20usage=20of=20?= =?UTF-8?q?=E2=80=9C${project.version}=E2=80=9D=20with=20the=20real=20vers?= =?UTF-8?q?ion=20(There=20is=20no=20need=20to=20manually=20update=20these?= =?UTF-8?q?=20versions=20and=20this=20way=20when=20looking=20at=20the=20po?= =?UTF-8?q?m=20you=20instantly=20know=20the=20version=20=E2=80=A6=20keep?= =?UTF-8?q?=20in=20mind=20if=20an=20artifact=20is=20deployed=20to=20maven?= =?UTF-8?q?=20central,=20the=20user=20doesn=E2=80=99t=20have=20the=20code?= =?UTF-8?q?=20and=20therefore=20he=20always=20has=20to=20scroll=20up=20to?= =?UTF-8?q?=20the=20top=20in=20order=20to=20see=20which=20version=20is=20u?= =?UTF-8?q?sed)=20-=09There=20were=20some=20imports=20related=20to=20Jdk?= =?UTF-8?q?=2011=20no=20longer=20providing=20some=20APIs,=20I=20moved=20th?= =?UTF-8?q?ose=20imports=20to=20a=20maven=20profile,=20which=20is=20activa?= =?UTF-8?q?ted=20based=20on=20the=20JDK=20version=20-=09HDFSInputTest=20cr?= =?UTF-8?q?eated=20a=20file=20in=20=E2=80=9Cspark/test/=E2=80=9D=20?= =?UTF-8?q?=E2=80=A6=20if=20the=20test=20failed,=20the=20rat=20plugin=20wo?= =?UTF-8?q?uld=20complain=20the=20next=20time=20it=E2=80=99s=20run.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I checked the build with all tests on Oracle-Java 8, Open-JDK 11, Oracle-JDK 12. --- .gitignore | 1 - client/pom.xml | 65 +-- client/src/assembly/client.xml | 40 ++ .../assembly/resources}/sbin/start-client.bat | 0 .../assembly/resources}/sbin/start-client.sh | 0 .../assembly/resources}/tools/export-csv.bat | 0 .../assembly/resources}/tools/export-csv.sh | 0 .../assembly/resources}/tools/import-csv.bat | 0 .../assembly/resources}/tools/import-csv.sh | 0 .../iotdb/cli/client/AbstractScript.java | 29 +- .../iotdb/cli/client/StartClientScriptIT.java | 8 +- .../iotdb/cli/tool/ExportCsvTestIT.java | 8 +- .../iotdb/cli/tool/ImportCsvTestIT.java | 8 +- distribution/pom.xml | 14 + distribution/src/assembly/distribution.xml | 40 +- example/kafka/pom.xml | 24 +- example/pom.xml | 55 ++- example/rocketmq/pom.xml | 14 +- grafana/pom.xml | 2 +- hadoop/pom.xml | 6 +- jdbc/pom.xml | 15 +- pom.xml | 386 ++++++++++++++++-- server/pom.xml | 85 ++-- .../resources}/conf/iotdb-engine.properties | 0 .../assembly/resources}/conf/iotdb-env.bat | 0 .../assembly/resources}/conf/iotdb-env.sh | 0 .../conf/iotdb-sync-client.properties | 0 .../assembly/resources}/conf/logback-tool.xml | 0 .../assembly/resources}/conf/logback.xml | 0 .../resources}/conf/tsfile-format.properties | 0 .../assembly/resources}/sbin/start-server.bat | 0 .../assembly/resources}/sbin/start-server.sh | 0 .../assembly/resources}/sbin/stop-server.bat | 0 .../assembly/resources}/sbin/stop-server.sh | 0 .../assembly/resources}/tools/memory-tool.bat | 0 .../assembly/resources}/tools/memory-tool.sh | 0 .../resources}/tools/start-WalChecker.bat | 0 .../resources}/tools/start-WalChecker.sh | 0 .../resources}/tools/start-sync-client.bat | 0 .../resources}/tools/start-sync-client.sh | 0 .../resources}/tools/stop-sync-client.bat | 0 .../resources}/tools/stop-sync-client.sh | 0 server/src/assembly/server.xml | 40 ++ .../apache/iotdb/db/script/EnvScriptIT.java | 34 +- spark-tsfile/pom.xml | 32 +- .../apache/iotdb/tsfile/HDFSInputTest.java | 2 +- tsfile/pom.xml | 3 - 47 files changed, 641 insertions(+), 270 deletions(-) create mode 100644 client/src/assembly/client.xml rename client/{cli => src/assembly/resources}/sbin/start-client.bat (100%) rename client/{cli => src/assembly/resources}/sbin/start-client.sh (100%) rename client/{cli => src/assembly/resources}/tools/export-csv.bat (100%) rename client/{cli => src/assembly/resources}/tools/export-csv.sh (100%) rename client/{cli => src/assembly/resources}/tools/import-csv.bat (100%) rename client/{cli => src/assembly/resources}/tools/import-csv.sh (100%) rename server/{iotdb => src/assembly/resources}/conf/iotdb-engine.properties (100%) rename server/{iotdb => src/assembly/resources}/conf/iotdb-env.bat (100%) rename server/{iotdb => src/assembly/resources}/conf/iotdb-env.sh (100%) rename server/{iotdb => src/assembly/resources}/conf/iotdb-sync-client.properties (100%) rename server/{iotdb => src/assembly/resources}/conf/logback-tool.xml (100%) rename server/{iotdb => src/assembly/resources}/conf/logback.xml (100%) rename server/{iotdb => src/assembly/resources}/conf/tsfile-format.properties (100%) rename server/{iotdb => src/assembly/resources}/sbin/start-server.bat (100%) rename server/{iotdb => src/assembly/resources}/sbin/start-server.sh (100%) rename server/{iotdb => src/assembly/resources}/sbin/stop-server.bat (100%) rename server/{iotdb => src/assembly/resources}/sbin/stop-server.sh (100%) rename server/{iotdb => src/assembly/resources}/tools/memory-tool.bat (100%) rename server/{iotdb => src/assembly/resources}/tools/memory-tool.sh (100%) rename server/{iotdb => src/assembly/resources}/tools/start-WalChecker.bat (100%) rename server/{iotdb => src/assembly/resources}/tools/start-WalChecker.sh (100%) rename server/{iotdb => src/assembly/resources}/tools/start-sync-client.bat (100%) rename server/{iotdb => src/assembly/resources}/tools/start-sync-client.sh (100%) rename server/{iotdb => src/assembly/resources}/tools/stop-sync-client.bat (100%) rename server/{iotdb => src/assembly/resources}/tools/stop-sync-client.sh (100%) create mode 100644 server/src/assembly/server.xml diff --git a/.gitignore b/.gitignore index f74fb7ff953..f50cc97a3b6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ **/lib/** **/data/** -tsfile/src/test/resources/perTestInputData # Eclipse IDE files **/.classpath **/.project diff --git a/client/pom.xml b/client/pom.xml index 78496971509..07da5c62323 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -31,8 +31,6 @@ IoTDB Client A Client tool. - 1.3.1 - 2.14.5 false ${cli.test.skip} ${cli.test.skip} @@ -41,68 +39,27 @@ org.apache.iotdb iotdb-jdbc - ${project.version} + 0.9.0-SNAPSHOT commons-cli commons-cli - ${common.cli.version} org.apache.commons commons-lang3 - 3.1 me.tongfei progressbar - 0.7.3 jline jline - ${jline.version} - - maven-clean-plugin - - - - ${project.basedir}/cli/lib - - **/*.jar - - false - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - package - - copy-dependencies - - - ${project.basedir}/cli/lib - - - - - - org.apache.maven.plugins - maven-jar-plugin - - ${project.basedir}/cli/lib - - @@ -130,6 +87,26 @@ ${cli.it.skip} + + org.apache.maven.plugins + maven-assembly-plugin + + + + client-assembly + package + + single + + + + src/assembly/client.xml + + false + + + + diff --git a/client/src/assembly/client.xml b/client/src/assembly/client.xml new file mode 100644 index 00000000000..f02a281b8e1 --- /dev/null +++ b/client/src/assembly/client.xml @@ -0,0 +1,40 @@ + + + + client + + dir + zip + + false + + + lib + + + + + src/assembly/resources + / + + + diff --git a/client/cli/sbin/start-client.bat b/client/src/assembly/resources/sbin/start-client.bat similarity index 100% rename from client/cli/sbin/start-client.bat rename to client/src/assembly/resources/sbin/start-client.bat diff --git a/client/cli/sbin/start-client.sh b/client/src/assembly/resources/sbin/start-client.sh similarity index 100% rename from client/cli/sbin/start-client.sh rename to client/src/assembly/resources/sbin/start-client.sh diff --git a/client/cli/tools/export-csv.bat b/client/src/assembly/resources/tools/export-csv.bat similarity index 100% rename from client/cli/tools/export-csv.bat rename to client/src/assembly/resources/tools/export-csv.bat diff --git a/client/cli/tools/export-csv.sh b/client/src/assembly/resources/tools/export-csv.sh similarity index 100% rename from client/cli/tools/export-csv.sh rename to client/src/assembly/resources/tools/export-csv.sh diff --git a/client/cli/tools/import-csv.bat b/client/src/assembly/resources/tools/import-csv.bat similarity index 100% rename from client/cli/tools/import-csv.bat rename to client/src/assembly/resources/tools/import-csv.bat diff --git a/client/cli/tools/import-csv.sh b/client/src/assembly/resources/tools/import-csv.sh similarity index 100% rename from client/cli/tools/import-csv.sh rename to client/src/assembly/resources/tools/import-csv.sh diff --git a/client/src/test/java/org/apache/iotdb/cli/client/AbstractScript.java b/client/src/test/java/org/apache/iotdb/cli/client/AbstractScript.java index 4ca8c333ba7..4cd1a403b53 100644 --- a/client/src/test/java/org/apache/iotdb/cli/client/AbstractScript.java +++ b/client/src/test/java/org/apache/iotdb/cli/client/AbstractScript.java @@ -20,9 +20,7 @@ package org.apache.iotdb.cli.client; import static org.junit.Assert.assertEquals; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; +import java.io.*; import java.util.ArrayList; import java.util.List; @@ -50,13 +48,24 @@ public abstract class AbstractScript { } } - protected String getCurrentPath(String... command) throws IOException { - ProcessBuilder builder = new ProcessBuilder(command); - builder.redirectErrorStream(true); - Process p = builder.start(); - BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream())); - String path = r.readLine(); - return path; + protected String getCliPath() { + // This is usually always set by the JVM + File userDir = new File(System.getProperty("user.dir")); + if(!userDir.exists()) { + throw new RuntimeException("user.dir " + userDir.getAbsolutePath() + " doesn't exist."); + } + File targetDir = new File(userDir, "target"); + File[] files = targetDir.listFiles(new FileFilter() { + @Override + public boolean accept(File pathname) { + return pathname.isDirectory() && pathname.getName().startsWith("iotdb-client-"); + } + }); + if(files.length != 1) { + throw new RuntimeException( + "Exactly one directory starting with 'iotdb-client-' should have been found, but was " + files.length); + } + return files[0].getAbsolutePath(); } protected abstract void testOnWindows() throws IOException; diff --git a/client/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java b/client/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java index 55033a290fc..e4ed965e7c8 100644 --- a/client/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java +++ b/client/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java @@ -50,9 +50,9 @@ public class StartClientScriptIT extends AbstractScript { final String[] output = {"````````````````````````", "Starting IoTDB Client", "````````````````````````", "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%"); + String dir = getCliPath(); ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c", - dir + File.separator + "cli" + File.separator + "sbin" + File.separator + "start-client.bat", + dir + File.separator + "sbin" + File.separator + "start-client.bat", "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root"); testOutput(builder, output); @@ -63,9 +63,9 @@ public class StartClientScriptIT extends AbstractScript { final String[] output = {"---------------------", "Starting IoTDB Client", "---------------------", "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"); + String dir = getCliPath(); ProcessBuilder builder = new ProcessBuilder("sh", - dir + File.separator + "cli" + File.separator + "sbin" + File.separator + "start-client.sh", + dir + 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/client/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java b/client/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java index 1836df02e80..de30750a221 100644 --- a/client/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java +++ b/client/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java @@ -52,9 +52,9 @@ public class ExportCsvTestIT extends AbstractScript{ "````````````````````````````````````````````````", "Encounter an error when exporting data, error is: Connection Error, " + "please check whether the network is available or the server has started."}; - String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%"); + String dir = getCliPath(); ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c", - dir + File.separator + "cli" + File.separator + "tools" + File.separator + "export-csv.bat", + dir + File.separator + "tools" + File.separator + "export-csv.bat", "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root", "-td", "./"); testOutput(builder, output); } @@ -66,9 +66,9 @@ public class ExportCsvTestIT extends AbstractScript{ "------------------------------------------", "Encounter an error when exporting data, error is: Connection Error, " + "please check whether the network is available or the server has started."}; - String dir = getCurrentPath("pwd"); + String dir = getCliPath(); ProcessBuilder builder = new ProcessBuilder("sh", - dir + File.separator + "cli" + File.separator + "tools" + File.separator + "export-csv.sh", + dir + 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/client/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java b/client/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java index 755c8df5277..8bbe91bf56a 100644 --- a/client/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java +++ b/client/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java @@ -52,9 +52,9 @@ public class ImportCsvTestIT extends AbstractScript { "````````````````````````````````````````````````", "Encounter an error when importing data, error is: Connection Error, please check whether " + "the network is available or the server has started."}; - String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%"); + String dir = getCliPath(); ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c", - dir + File.separator + "cli" + File.separator + "tools" + File.separator + "import-csv.bat", + dir + File.separator + "tools" + File.separator + "import-csv.bat", "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root", "-f", "./"); testOutput(builder, output); } @@ -66,9 +66,9 @@ public class ImportCsvTestIT extends AbstractScript { "------------------------------------------", "Encounter an error when importing data, error is: Connection Error, please check whether " + "the network is available or the server has started."}; - String dir = getCurrentPath("pwd"); + String dir = getCliPath(); ProcessBuilder builder = new ProcessBuilder("sh", - dir + File.separator + "cli" + File.separator + "tools" + File.separator + "import-csv.sh", + dir + 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/distribution/pom.xml b/distribution/pom.xml index 4aaceb1dc99..8b737a2a0c8 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -83,4 +83,18 @@ + + + org.apache.iotdb + iotdb-server + 0.9.0-SNAPSHOT + zip + + + org.apache.iotdb + iotdb-client + 0.9.0-SNAPSHOT + zip + + diff --git a/distribution/src/assembly/distribution.xml b/distribution/src/assembly/distribution.xml index 736b276831d..b0cfd6f9245 100644 --- a/distribution/src/assembly/distribution.xml +++ b/distribution/src/assembly/distribution.xml @@ -22,23 +22,19 @@ bin + dir zip true - - - - true + + - org.apache.iotdb:iotdb-server - org.apache.iotdb:iotdb-client + *:zip:* - - lib - false - - - + / + true + + ${maven.multiModuleProjectDirectory}/README.md @@ -67,25 +63,5 @@ ${maven.multiModuleProjectDirectory}/docs docs - - ${maven.multiModuleProjectDirectory}/server/iotdb/conf - conf - - - ${maven.multiModuleProjectDirectory}/server/iotdb/sbin - sbin - - - ${maven.multiModuleProjectDirectory}/client/cli/sbin - sbin - - - ${maven.multiModuleProjectDirectory}/server/iotdb/tools - tools - - - ${maven.multiModuleProjectDirectory}/client/cli/tools - tools - diff --git a/example/kafka/pom.xml b/example/kafka/pom.xml index b7879eb0631..a33298798ef 100644 --- a/example/kafka/pom.xml +++ b/example/kafka/pom.xml @@ -39,33 +39,11 @@ org.apache.iotdb iotdb-jdbc + 0.9.0-SNAPSHOT org.apache.kafka kafka_2.10 - 0.8.2.0 - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - diff --git a/example/pom.xml b/example/pom.xml index 8f5851e91b3..5c191f385ea 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -30,17 +30,54 @@ pom iotdb-examples IoTDB Examples - - - - org.apache.iotdb - iotdb-jdbc - ${project.version} - - - + + 3.4.6 + kafka rocketmq + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + + + + + org.apache.kafka + kafka_2.10 + 0.8.2.0 + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-log4j12 + + + + + org.apache.rocketmq + rocketmq-client + 4.4.0 + + + org.apache.zookeeper + zookeeper + ${zookeeper.version} + + + diff --git a/example/rocketmq/pom.xml b/example/rocketmq/pom.xml index 4806ff14f2b..0117b301cea 100644 --- a/example/rocketmq/pom.xml +++ b/example/rocketmq/pom.xml @@ -34,23 +34,11 @@ org.apache.iotdb iotdb-jdbc + 0.9.0-SNAPSHOT org.apache.rocketmq rocketmq-client - 4.4.0 - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - diff --git a/grafana/pom.xml b/grafana/pom.xml index ba829ff6954..e4721151daa 100644 --- a/grafana/pom.xml +++ b/grafana/pom.xml @@ -61,7 +61,7 @@ org.apache.iotdb iotdb-jdbc - ${project.version} + 0.9.0-SNAPSHOT org.springframework.boot diff --git a/hadoop/pom.xml b/hadoop/pom.xml index a2a8751399a..d1cceec3fc4 100644 --- a/hadoop/pom.xml +++ b/hadoop/pom.xml @@ -36,15 +36,11 @@ org.apache.iotdb tsfile - ${project.version} + 0.9.0-SNAPSHOT org.apache.hadoop hadoop-client - ${hadoop.version} - - - diff --git a/jdbc/pom.xml b/jdbc/pom.xml index c5967a99631..4b971d8d89d 100644 --- a/jdbc/pom.xml +++ b/jdbc/pom.xml @@ -39,12 +39,12 @@ org.apache.iotdb tsfile - ${project.version} + 0.9.0-SNAPSHOT org.apache.iotdb service-rpc - ${project.version} + 0.9.0-SNAPSHOT @@ -96,17 +96,6 @@ ${jdbc.it.skip} - - org.apache.rat - apache-rat-plugin - - - example/data/kafka_data.csv - **/*.iml - **/*.log - - - diff --git a/pom.xml b/pom.xml index 917718e2aac..0073930ee1e 100644 --- a/pom.xml +++ b/pom.xml @@ -60,6 +60,15 @@ 4.0 0.9.3 0.8 + 2.8.8 + 3.5.2 + 1.3.1 + 1.13 + 3.2.2 + 2.6 + 3.8.1 + 1.1.3 + 2.14.5 https://builds.apache.org/analysis @@ -81,6 +90,259 @@ logback-classic ${logback.version} + + com.alibaba + fastjson + 1.2.31 + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + com.fasterxml.jackson.module + jackson-module-paranamer + ${jackson.version} + + + com.fasterxml.jackson.module + jackson-module-scala_2.11 + ${jackson.version} + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.google.guava + guava + 21.0 + + + com.sun.istack + istack-commons-runtime + 3.0.8 + + + com.sun.xml.fastinfoset + FastInfoset + 1.2.16 + + + commons-lang + commons-lang + ${common.lang.version} + + + commons-cli + commons-cli + ${common.cli.version} + + + commons-codec + commons-codec + ${common.codec.version} + + + commons-collections + commons-collections + ${common.collections.version} + + + commons-io + commons-io + ${common.io.version} + + + commons-logging + commons-logging + ${common.logging.version} + + + io.netty + netty + 3.9.9.Final + + + io.netty + netty-all + 4.1.17.Final + + + javax.annotation + javax.annotation-api + 1.3.2 + + + javax.xml.bind + jaxb-api + 2.4.0-b180725.0427 + + + jline + jline + ${jline.version} + + + junit + junit + ${junit.version} + + + log4j + log4j + 1.2.17 + + + me.tongfei + progressbar + 0.7.3 + + + + org.fusesource.jansi + jansi + + + + + org.antlr + antlr-runtime + ${antlr3.version} + + + org.apache.commons + commons-collections4 + ${commons.collections4} + + + org.apache.commons + commons-lang3 + ${common.lang3.version} + + + org.apache.hadoop + hadoop-client + ${hadoop.version} + + + org.apache.spark + spark-core_2.11 + ${spark.version} + + + org.apache.spark + spark-sql_2.11 + ${spark.version} + + + org.codehaus.jackson + jackson-core-asl + 1.9.13 + + + org.codehaus.jackson + jackson-mapper-asl + 1.9.13 + + + org.glassfish.jaxb + jaxb-runtime + 2.4.0-b180725.0644 + + + jakarta.activation + jakarta.activation-api + + + + + org.javassist + javassist + 3.24.0-GA + + + org.mockito + mockito-all + 1.10.19 + + + org.mockito + mockito-core + 2.23.0 + + + org.objenesis + objenesis + 3.0.1 + + + org.powermock + powermock-core + 2.0.2 + + + org.powermock + powermock-api-mockito2 + 2.0.2 + + + org.powermock + powermock-module-junit4 + 2.0.2 + + + org.scala-lang + scala-library + ${scala.version} + + + org.scala-lang + scala-reflect + ${scala.version} + + + org.scalatest + scalatest_2.11 + 3.0.5 + + + org.slf4j + jcl-over-slf4j + 1.7.25 + + + org.slf4j + jul-to-slf4j + 1.7.25 + + + org.slf4j + slf4j-api + 1.7.25 + + + org.slf4j + slf4j-log4j12 + 1.7.25 + + + org.xerial.snappy + snappy-java + 1.0.5-M1 + org.apache.thrift libthrift @@ -107,31 +369,13 @@ junit junit - ${junit.version} test org.mockito mockito-all - 1.10.19 test - - - javax.annotation - javax.annotation-api - 1.3.2 - - - javax.xml.bind - jaxb-api - 2.4.0-b180725.0427 - - - org.glassfish.jaxb - jaxb-runtime - 2.4.0-b180725.0644 - tsfile @@ -202,6 +446,8 @@ **/*.iml **/*.log + + **/*.cvs licenses/* @@ -210,14 +456,8 @@ .checkstyle local-snapshots-dir/** - - iotdb/data/** - iotdb/logs/** - src/test/resources/*.json - - - src/test/resources/perTestInputData - src/test/resources/*.json + + *.json NOTICE-binary LICENSE-binary @@ -234,9 +474,44 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M1 + 3.0.0-M2 + + + enforce-version-convergence + + + + + + + enforce + + + + vulnerability-checks @@ -264,6 +539,11 @@ ossindex-maven-enforcer-rules 1.0.0 + + org.codehaus.mojo + extra-enforcer-rules + 1.2 + + + java-11-and-above + + + [11,20) + + + + + javax.annotation + javax.annotation-api + + + javax.xml.bind + jaxb-api + + + org.glassfish.jaxb + jaxb-runtime + + + + org.antlr antlr-runtime - ${antlr3.version} org.apache.commons commons-lang3 - ${common.lang3.version} io.airlift @@ -78,52 +73,21 @@ org.powermock powermock-core - 2.0.2 test org.powermock powermock-module-junit4 - 2.0.2 test org.powermock powermock-api-mockito2 - 2.0.2 test - - maven-clean-plugin - - - - ${project.basedir}/iotdb/lib - - **/*.jar - - false - - - ${project.basedir}/data - - **/* - - false - - - ${project.basedir}/logs - - **/* - - false - - - - org.antlr antlr3-maven-plugin @@ -136,29 +100,6 @@ - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - package - - copy-dependencies - - - ${project.basedir}/iotdb/lib - - - - - - org.apache.maven.plugins - maven-jar-plugin - - ${project.basedir}/iotdb/lib - - @@ -186,6 +127,26 @@ ${iotdb.it.skip} + + org.apache.maven.plugins + maven-assembly-plugin + + + + server-assembly + package + + single + + + + src/assembly/server.xml + + false + + + + diff --git a/server/iotdb/conf/iotdb-engine.properties b/server/src/assembly/resources/conf/iotdb-engine.properties similarity index 100% rename from server/iotdb/conf/iotdb-engine.properties rename to server/src/assembly/resources/conf/iotdb-engine.properties diff --git a/server/iotdb/conf/iotdb-env.bat b/server/src/assembly/resources/conf/iotdb-env.bat similarity index 100% rename from server/iotdb/conf/iotdb-env.bat rename to server/src/assembly/resources/conf/iotdb-env.bat diff --git a/server/iotdb/conf/iotdb-env.sh b/server/src/assembly/resources/conf/iotdb-env.sh similarity index 100% rename from server/iotdb/conf/iotdb-env.sh rename to server/src/assembly/resources/conf/iotdb-env.sh diff --git a/server/iotdb/conf/iotdb-sync-client.properties b/server/src/assembly/resources/conf/iotdb-sync-client.properties similarity index 100% rename from server/iotdb/conf/iotdb-sync-client.properties rename to server/src/assembly/resources/conf/iotdb-sync-client.properties diff --git a/server/iotdb/conf/logback-tool.xml b/server/src/assembly/resources/conf/logback-tool.xml similarity index 100% rename from server/iotdb/conf/logback-tool.xml rename to server/src/assembly/resources/conf/logback-tool.xml diff --git a/server/iotdb/conf/logback.xml b/server/src/assembly/resources/conf/logback.xml similarity index 100% rename from server/iotdb/conf/logback.xml rename to server/src/assembly/resources/conf/logback.xml diff --git a/server/iotdb/conf/tsfile-format.properties b/server/src/assembly/resources/conf/tsfile-format.properties similarity index 100% rename from server/iotdb/conf/tsfile-format.properties rename to server/src/assembly/resources/conf/tsfile-format.properties diff --git a/server/iotdb/sbin/start-server.bat b/server/src/assembly/resources/sbin/start-server.bat similarity index 100% rename from server/iotdb/sbin/start-server.bat rename to server/src/assembly/resources/sbin/start-server.bat diff --git a/server/iotdb/sbin/start-server.sh b/server/src/assembly/resources/sbin/start-server.sh similarity index 100% rename from server/iotdb/sbin/start-server.sh rename to server/src/assembly/resources/sbin/start-server.sh diff --git a/server/iotdb/sbin/stop-server.bat b/server/src/assembly/resources/sbin/stop-server.bat similarity index 100% rename from server/iotdb/sbin/stop-server.bat rename to server/src/assembly/resources/sbin/stop-server.bat diff --git a/server/iotdb/sbin/stop-server.sh b/server/src/assembly/resources/sbin/stop-server.sh similarity index 100% rename from server/iotdb/sbin/stop-server.sh rename to server/src/assembly/resources/sbin/stop-server.sh diff --git a/server/iotdb/tools/memory-tool.bat b/server/src/assembly/resources/tools/memory-tool.bat similarity index 100% rename from server/iotdb/tools/memory-tool.bat rename to server/src/assembly/resources/tools/memory-tool.bat diff --git a/server/iotdb/tools/memory-tool.sh b/server/src/assembly/resources/tools/memory-tool.sh similarity index 100% rename from server/iotdb/tools/memory-tool.sh rename to server/src/assembly/resources/tools/memory-tool.sh diff --git a/server/iotdb/tools/start-WalChecker.bat b/server/src/assembly/resources/tools/start-WalChecker.bat similarity index 100% rename from server/iotdb/tools/start-WalChecker.bat rename to server/src/assembly/resources/tools/start-WalChecker.bat diff --git a/server/iotdb/tools/start-WalChecker.sh b/server/src/assembly/resources/tools/start-WalChecker.sh similarity index 100% rename from server/iotdb/tools/start-WalChecker.sh rename to server/src/assembly/resources/tools/start-WalChecker.sh diff --git a/server/iotdb/tools/start-sync-client.bat b/server/src/assembly/resources/tools/start-sync-client.bat similarity index 100% rename from server/iotdb/tools/start-sync-client.bat rename to server/src/assembly/resources/tools/start-sync-client.bat diff --git a/server/iotdb/tools/start-sync-client.sh b/server/src/assembly/resources/tools/start-sync-client.sh similarity index 100% rename from server/iotdb/tools/start-sync-client.sh rename to server/src/assembly/resources/tools/start-sync-client.sh diff --git a/server/iotdb/tools/stop-sync-client.bat b/server/src/assembly/resources/tools/stop-sync-client.bat similarity index 100% rename from server/iotdb/tools/stop-sync-client.bat rename to server/src/assembly/resources/tools/stop-sync-client.bat diff --git a/server/iotdb/tools/stop-sync-client.sh b/server/src/assembly/resources/tools/stop-sync-client.sh similarity index 100% rename from server/iotdb/tools/stop-sync-client.sh rename to server/src/assembly/resources/tools/stop-sync-client.sh diff --git a/server/src/assembly/server.xml b/server/src/assembly/server.xml new file mode 100644 index 00000000000..9b2df216a56 --- /dev/null +++ b/server/src/assembly/server.xml @@ -0,0 +1,40 @@ + + + + server + + dir + zip + + false + + + lib + + + + + src/assembly/resources + / + + + diff --git a/server/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java b/server/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java index 2f7e8335426..f08e167b8b7 100644 --- a/server/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java +++ b/server/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java @@ -20,10 +20,7 @@ package org.apache.iotdb.db.script; import static org.junit.Assert.assertEquals; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; +import java.io.*; import java.util.ArrayList; import java.util.List; import org.junit.After; @@ -51,19 +48,19 @@ public class EnvScriptIT { } private void testStartClientOnWindows(String suffix, String os) throws IOException { - String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%"); + String dir = getServerPath(); final String output = "If you want to change this configuration, please check conf/iotdb-env.sh(Unix or OS X, if you use Windows, check conf/iotdb-env.bat)."; String cmd = - dir + File.separator + "iotdb" + File.separator + "conf" + File.separator + "iotdb-env" + dir + File.separator + "conf" + File.separator + "iotdb-env" + suffix; ProcessBuilder startBuilder = new ProcessBuilder("cmd.exe", "/c", cmd); testOutput(dir, suffix, startBuilder, output, os); } private void testStartClientOnUnix(String suffix, String os) throws IOException { - String dir = getCurrentPath("pwd"); + String dir = getServerPath(); final String output = "If you want to change this configuration, please check conf/iotdb-env.sh(Unix or OS X, if you use Windows, check conf/iotdb-env.bat)."; - String cmd = dir + File.separator + "iotdb" + File.separator + "conf" + File.separator + "iotdb-env" + String cmd = dir + File.separator + "conf" + File.separator + "iotdb-env" + suffix; ProcessBuilder builder = new ProcessBuilder("bash", cmd); testOutput(cmd, suffix, builder, output, os); @@ -101,4 +98,25 @@ public class EnvScriptIT { String path = r.readLine(); return path; } + + protected String getServerPath() { + // This is usually always set by the JVM + File userDir = new File(System.getProperty("user.dir")); + if(!userDir.exists()) { + throw new RuntimeException("user.dir " + userDir.getAbsolutePath() + " doesn't exist."); + } + File targetDir = new File(userDir, "target"); + File[] files = targetDir.listFiles(new FileFilter() { + @Override + public boolean accept(File pathname) { + return pathname.isDirectory() && pathname.getName().startsWith("iotdb-server-"); + } + }); + if(files.length != 1) { + throw new RuntimeException( + "Exactly one directory starting with 'iotdb-server-' should have been found, but was " + files.length); + } + return files[0].getAbsolutePath(); + } + } diff --git a/spark-tsfile/pom.xml b/spark-tsfile/pom.xml index 3d74f8fc6f5..4613de1cc77 100644 --- a/spark-tsfile/pom.xml +++ b/spark-tsfile/pom.xml @@ -29,38 +29,34 @@ spark-tsfile jar + IoTDB Spark-TsFile org.apache.iotdb tsfile - ${project.version} + 0.9.0-SNAPSHOT org.apache.hadoop hadoop-client - ${hadoop.version} org.apache.spark spark-core_2.11 - ${spark.version} provided org.apache.spark spark-sql_2.11 - ${spark.version} provided org.scala-lang scala-library - ${scala.version} org.scalatest scalatest_2.11 - 3.0.5 test @@ -91,4 +87,28 @@ + + + java-11-and-above + + + [11,20) + + + + + net.alchim31.maven + scala-maven-plugin + 3.2.0 + + + + -nobootcp + + + + + + + diff --git a/spark-tsfile/src/test/scala/org/apache/iotdb/tsfile/HDFSInputTest.java b/spark-tsfile/src/test/scala/org/apache/iotdb/tsfile/HDFSInputTest.java index 43a88a48145..5f6da88b1ab 100644 --- a/spark-tsfile/src/test/scala/org/apache/iotdb/tsfile/HDFSInputTest.java +++ b/spark-tsfile/src/test/scala/org/apache/iotdb/tsfile/HDFSInputTest.java @@ -30,7 +30,7 @@ import org.junit.Test; public class HDFSInputTest { - private String folder = "../spark/src/test/resources/HDFSInputTest"; + private String folder = "target/test-output/HDFSInputTest"; private String path = folder + "/test.tsfile"; private HDFSInput in; diff --git a/tsfile/pom.xml b/tsfile/pom.xml index 709a4ef495e..cab5fb5827c 100644 --- a/tsfile/pom.xml +++ b/tsfile/pom.xml @@ -44,17 +44,14 @@ com.alibaba fastjson - 1.2.31 org.xerial.snappy snappy-java - 1.0.5-M1 commons-io commons-io - ${common.io.version}