You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2020/11/16 04:11:10 UTC
[iotdb] branch rel/0.11 updated (2440505 -> ab5d35b)
This is an automated email from the ASF dual-hosted git repository.
hxd pushed a change to branch rel/0.11
in repository https://gitbox.apache.org/repos/asf/iotdb.git.
from 2440505 Merge pull request #2050 from apache/fix_session_pool_for_0.11
new aeda8b6 try-github-action-to-replace-travis (#2051)
new dab6f23 Create sonar_and_coverall.yml
new 36d7a54 Update sonar_and_coverall.yml
new ab5d35b Add Sonar and Coveralls Check using Github Action (#2052)
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.github/workflows/main-ci.yml | 112 +++++++++++++++++++++
.github/workflows/sonar_and_coverall.yml | 76 ++++++++++++++
.../fileOutputFactory/LocalFSOutputFactory.java | 3 +-
...SameMeasurementsWithDifferentDataTypesTest.java | 14 ++-
.../write/writer/ForceAppendTsFileWriterTest.java | 14 ++-
5 files changed, 213 insertions(+), 6 deletions(-)
create mode 100644 .github/workflows/main-ci.yml
create mode 100644 .github/workflows/sonar_and_coverall.yml
[iotdb] 01/04: try-github-action-to-replace-travis (#2051)
Posted by hx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch rel/0.11
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit aeda8b6406a17a3b8dfe34b4e0efb0d28df2201b
Author: Xiangdong Huang <hx...@apache.org>
AuthorDate: Mon Nov 16 11:06:18 2020 +0800
try-github-action-to-replace-travis (#2051)
---
.github/workflows/main-ci.yml | 112 +++++++++++++++++++++
.../fileOutputFactory/LocalFSOutputFactory.java | 3 +-
...SameMeasurementsWithDifferentDataTypesTest.java | 14 ++-
.../write/writer/ForceAppendTsFileWriterTest.java | 14 ++-
4 files changed, 137 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml
new file mode 100644
index 0000000..a7aec89
--- /dev/null
+++ b/.github/workflows/main-ci.yml
@@ -0,0 +1,112 @@
+# This workflow will build a Java project with Maven
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: Java CI with Maven
+
+on:
+ push:
+ branches:
+ - master
+ - 'rel/*'
+ paths-ignore:
+ - 'docs/**'
+ pull_request:
+ branches:
+ - master
+ - 'rel/*'
+ - cluster_new
+ paths-ignore:
+ - 'docs/**'
+
+jobs:
+ build:
+ strategy:
+ fail-fast: false
+ max-parallel: 20
+ matrix:
+ java: [8, 11.0.x]
+ os: [ubuntu-latest, macos-latest]
+ runs-on: ${{ matrix.os}}
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+ - name: Cache Maven packages
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2
+ key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2
+ - name: Check Apache Rat
+ run: mvn -B apache-rat:check
+ - name: Test with Maven
+ run: mvn -B clean integration-test -Dtest.port.closed=true
+
+ build-win:
+ strategy:
+ fail-fast: false
+ max-parallel: 20
+ matrix:
+ java: [8, 11.0.x]
+ os: [windows-latest]
+ runs-on: ${{ matrix.os}}
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+ - name: Cache Maven packages
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2
+ key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2
+ - name: Check Apache Rat
+ run: mvn -B apache-rat:check
+ - name: Download Hadoop Tools if Needed
+ # Using Powershell ...
+ # github action put codes to d:\a
+ run: mkdir D:\a\hadoop\bin ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/winutils.exe -OutFile D:\a\hadoop\bin\winutils.exe ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop.dll -OutFile C:\windows\system32\hadoop.dll ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop -OutFile D:\a\hadoop\bin\hadoop ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop.cmd -OutFile D:\a\hadoop\bin\hadoop.cmd ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop.exp -OutFile D:\a\hadoop\bin\hadoop.exp ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop.lib -OutFile D:\a\hadoop\bin\hadoop.lib ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop.pdb -OutFile D:\a\hadoop\bin\hadoop.pdb ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs.dll -OutFile C:\windows\system32\hdfs.dll ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs -OutFile D:\a\hadoop\bin\hdfs ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs.cmd -OutFile D:\a\hadoop\bin\hdfs.cmd ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs.exp -OutFile D:\a\hadoop\bin\hdfs.exp ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs.lib -OutFile D:\a\hadoop\bin\hdfs.lib ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs.pdb -OutFile D:\a\hadoop\bin\hdfs.pdb ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs_static.lib -OutFile D:\a\hadoop\bin\hdfs_static.lib ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/libwinutils.lib -OutFile D:\a\hadoop\bin\libwinutils.lib ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/mapred -OutFile D:\a\hadoop\bin\mapred ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/mapred.cmd -OutFile D:\a\hadoop\bin\mapred.cmd ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/rcc -OutFile D:\a\hadoop\bin\rcc ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/winutils.pdb -OutFile D:\a\hadoop\bin\winutils.pdb ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/yarn -OutFile D:\a\hadoop\bin\yarn ; `
+ Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/yarn.cmd -OutFile D:\a\hadoop\bin\yarn.cmd ; `
+ [Environment]::SetEnvironmentVariable("Path", $env:Path + ";D:\a\hadoop\bin", "User") ; `
+ [Environment]::SetEnvironmentVariable("HADOOP_HOME", "D:\a\hadoop", "User")
+ - name: Add Hadoop Path (Win)
+ shell: bash
+ run: echo 'export PATH=/d/a/hadoop/bin:$PATH' >> ~/.bash_profile && echo 'export HADOOP_HOME=/d/a/hadoop' >> ~/.bash_profile && source ~/.bash_profile
+ - name: Check Hadoop Path (Win)
+ shell: bash
+ run: source ~/.bash_profile && echo $PATH
+ - name: Cache Hadoop packages (Win)
+ uses: actions/cache@v2
+ with:
+ path: D:\a\hadoop
+ key: ${{ runner.os }}-hadoop-files${{ hashFiles('**/*.exe') }}
+ restore-keys: ${{ runner.os }}-hadoop-files
+ - name: Test with Maven
+ shell: bash
+ run: source ~/.bash_profile && mvn -B clean integration-test -Dtest.port.closed=true
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/fileSystem/fileOutputFactory/LocalFSOutputFactory.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/fileSystem/fileOutputFactory/LocalFSOutputFactory.java
index c21caed..5fba471 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/fileSystem/fileOutputFactory/LocalFSOutputFactory.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/fileSystem/fileOutputFactory/LocalFSOutputFactory.java
@@ -19,6 +19,7 @@
package org.apache.iotdb.tsfile.fileSystem.fileOutputFactory;
+import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -34,7 +35,7 @@ public class LocalFSOutputFactory implements FileOutputFactory {
public TsFileOutput getTsFileOutput(String filePath, boolean append) {
try {
- return new LocalTsFileOutput(new FileOutputStream(filePath, append));
+ return new LocalTsFileOutput(new FileOutputStream(new File(filePath), append));
} catch (IOException e) {
logger.error("Failed to get TsFile output of file: {}, ", filePath, e);
return null;
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/SameMeasurementsWithDifferentDataTypesTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/SameMeasurementsWithDifferentDataTypesTest.java
index 9e659b5..b50297b 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/SameMeasurementsWithDifferentDataTypesTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/SameMeasurementsWithDifferentDataTypesTest.java
@@ -19,9 +19,11 @@
package org.apache.iotdb.tsfile.write;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
+import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
@@ -61,8 +63,10 @@ public class SameMeasurementsWithDifferentDataTypesTest {
@After
public void after() {
File file = new File(tsfilePath);
- if (file.exists()) {
- file.delete();
+ try {
+ Files.deleteIfExists(file.toPath());
+ } catch (IOException e) {
+ fail(e.getMessage());
}
}
@@ -91,8 +95,10 @@ public class SameMeasurementsWithDifferentDataTypesTest {
private void writeFile(String tsfilePath) throws IOException, WriteProcessException {
File f = new File(tsfilePath);
- if (f.exists()) {
- f.delete();
+ try {
+ Files.deleteIfExists(f.toPath());
+ } catch (IOException e) {
+ fail(e.getMessage());
}
Schema schema = new Schema();
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/ForceAppendTsFileWriterTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/ForceAppendTsFileWriterTest.java
index b512f0f..eed277b 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/ForceAppendTsFileWriterTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/writer/ForceAppendTsFileWriterTest.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.tsfile.write.writer;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import java.io.File;
import java.util.ArrayList;
@@ -44,12 +45,23 @@ import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
import org.junit.Test;
public class ForceAppendTsFileWriterTest {
- private static final String FILE_NAME = TestConstant.BASE_OUTPUT_PATH.concat("test.tsfile");
+ private static final String FILE_NAME = TestConstant.BASE_OUTPUT_PATH.concat("test1.tsfile");
private static FSFactory fsFactory = FSFactoryProducer.getFSFactory();
@Test
public void test() throws Exception {
File file = fsFactory.getFile(FILE_NAME);
+ if (file.exists()) {
+ fail("Do not know why the file exists...." + file.getAbsolutePath());
+ }
+ System.out.println(file.getAbsolutePath());
+ if (!file.getParentFile().exists()) {
+ fail("folder does not exist...." + file.getParentFile().getAbsolutePath());
+ }
+ if (!file.getParentFile().isDirectory()) {
+ fail("folder is not a directory...." + file.getParentFile().getAbsolutePath());
+ }
+
TsFileWriter writer = new TsFileWriter(file);
writer.registerTimeseries(new Path("d1", "s1"),
new MeasurementSchema("s1", TSDataType.FLOAT, TSEncoding.RLE));
[iotdb] 02/04: Create sonar_and_coverall.yml
Posted by hx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch rel/0.11
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit dab6f23382652f157d40b70a24b7b47fd4642fea
Author: Xiangdong Huang <hx...@apache.org>
AuthorDate: Sun Nov 15 10:32:29 2020 +0800
Create sonar_and_coverall.yml
try using token
---
.github/workflows/sonar_and_coverall.yml | 48 ++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/.github/workflows/sonar_and_coverall.yml b/.github/workflows/sonar_and_coverall.yml
new file mode 100644
index 0000000..f91588d
--- /dev/null
+++ b/.github/workflows/sonar_and_coverall.yml
@@ -0,0 +1,48 @@
+# This workflow will build a Java project with Maven
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: Sonar And Coverall with Maven
+
+on:
+ push:
+ branches:
+ - master
+ - 'rel/*'
+ paths-ignore:
+ - 'docs/**'
+ pull_request:
+ branches:
+ - master
+ - 'rel/*'
+ - cluster_new
+ paths-ignore:
+ - 'docs/**'
+
+jobs:
+ coveralls:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 11.0.x
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11.0.x
+ - name: Cache Maven packages
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2
+ key: code-coverage-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2
+ - name: Run Integration Test
+ run: mvn -B post-integration-test -Pcode-coverage -Pcoveralls -pl '!distribution' -am
+ - name: Code Coverage (Coveralls) Test
+ run: |
+ mvn -B coveralls:report \
+ --no-transfer-progress \
+ -DserviceName=github \
+ -D branch=$BRANCH_NAME \
+ -D pullRequest=$PR_NUMBER \
+ -D repoToken=MiEOlMMMNQhLNV4yayn7rRUPyVSQzbzbZ \
+ -pl tsfile,server,jdbc,cli,session,hive-connector,flink-iotdb-connector,flink-tsfile-connector
[iotdb] 04/04: Add Sonar and Coveralls Check using Github Action
(#2052)
Posted by hx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch rel/0.11
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit ab5d35b9ee504c56833eca7be898cf2cf04ac621
Author: Xiangdong Huang <hx...@apache.org>
AuthorDate: Sun Nov 15 16:58:33 2020 +0800
Add Sonar and Coveralls Check using Github Action (#2052)
---
.github/workflows/sonar_and_coverall.yml | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/sonar_and_coverall.yml b/.github/workflows/sonar_and_coverall.yml
index 02883b6..f3d85dd 100644
--- a/.github/workflows/sonar_and_coverall.yml
+++ b/.github/workflows/sonar_and_coverall.yml
@@ -19,6 +19,34 @@ on:
- 'docs/**'
jobs:
+ sonar:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 11.0.x
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11.0.x
+ - name: Cache Maven packages
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2
+ key: sonar-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2
+ - name: SonarCloud Test
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ SONAR_TOKEN: '2d9c9a58d772a57806a168e00181e3e19f2763dc'
+ run: |
+ mvn -B verify sonar:sonar \
+ -Dsonar.organization=apache \
+ -Dsonar.projectKey=apache_incubator-iotdb \
+ -Dsonar.host.url=https://sonarcloud.io \
+ -Dsonar.login=${{ env.SONAR_TOKEN }} \
+ -DskipTests -pl '!distribution' -am
+
coveralls:
runs-on: ubuntu-latest
strategy:
@@ -41,7 +69,7 @@ jobs:
run: |
mvn -B coveralls:report \
--no-transfer-progress \
- -DserviceName=github \
+ -DserviceName=travis_ci \
-D branch=$BRANCH_NAME \
-D pullRequest=$PR_NUMBER \
-D repoToken=MiEOlMMMNQhLNV4yayn7rRUPyVSQzbzbZ \
[iotdb] 03/04: Update sonar_and_coverall.yml
Posted by hx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch rel/0.11
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 36d7a5467d7644147a7d26782f52970cd464b70b
Author: Xiangdong Huang <hx...@apache.org>
AuthorDate: Sun Nov 15 14:34:10 2020 +0800
Update sonar_and_coverall.yml
change jdk to 1.8 for coveralls
---
.github/workflows/sonar_and_coverall.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/sonar_and_coverall.yml b/.github/workflows/sonar_and_coverall.yml
index f91588d..02883b6 100644
--- a/.github/workflows/sonar_and_coverall.yml
+++ b/.github/workflows/sonar_and_coverall.yml
@@ -25,10 +25,10 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v2
- - name: Set up JDK 11.0.x
+ - name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
- java-version: 11.0.x
+ java-version: 1.8
- name: Cache Maven packages
uses: actions/cache@v2
with: