Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql_wy connection #452

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/actions/capacityExpansionUnionTest_pg/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'CapExp-Union-Test'
description: 'steps to test the capacity expansion'
inputs:
version:
description: 'iginx runner version'
required: false
default: 0.6.0-SNAPSHOT
DB-name:
description: 'the db version'
required: false
default: postgresql
Test-Way:
description: 'the way to test'
required: false
default: clearData
runs:
using: "composite" # Mandatory parameter
steps:
- name: clear postgresql history data
uses: ./.github/actions/postgresqlWriter
with:
version: ${{inputs.DB-name}}
Test-Way: clearData

- name: Stop Iginx
uses: ./.github/actions/iginxRunner
with:
version: ${{inputs.version}}
if-stop: true

- name: Stop and Clear ZooKeeper
uses: ./.github/actions/zookeeperRunner
with:
if-stop: true

- name: Run ZooKeeper
uses: ./.github/actions/zookeeperRunner
with:
if-rerun: true

- name: Write PostgreSQL history data
uses: ./.github/actions/postgresqlWriter
with:
version: ${{inputs.DB-name}}
Test-Way: ${{inputs.Test-Way}}

- name: Change IginX Config
uses: ./.github/actions/confWriter
with:
Test-Way: ${{inputs.Test-Way}}
if-CapExp: true

- name: Set The DB Name
uses: ./.github/actions/confWriter_pg
with:
confFile: DBName
DB-name: ${{inputs.DB-name}}

- name: Start IginX
uses: ./.github/actions/iginxRunner
with:
version: ${{inputs.version}}
46 changes: 46 additions & 0 deletions .github/actions/confWriter_pg/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'conf-writer'
description: 'conf-writer'
inputs:
confFile:
description: 'the conf that you want to write'
required: false
default: "iginxConf"
if-CapExp:
description: 'if you need capacity expansion'
required: false
default: "false"
Test-Way:
description: 'the way to imp'
required: false
default: clearData
DB-name:
description: 'PostgreSQL version'
required: false
default: postgresql

runs:
using: "composite" # Mandatory parameter
steps:
- if: inputs.if-CapExp=='true'
name: Change conf/config.properties
shell: bash
run: |
if [[ "${{inputs.Test-Way}}" == "oriHasDataExpHasData" || "${{inputs.Test-Way}}" == "oriHasDataExpNoData" ]]; then
if [ "$RUNNER_OS" == "Linux" ]; then
sed -i "s/has_data=false/has_data=true/g" ${GITHUB_WORKSPACE}/core/target/iginx-core-0.6.0-SNAPSHOT/conf/config.properties
elif [ "$RUNNER_OS" == "macOS" ]; then
sed -i "" "s/has_data=false/has_data=true/" ${GITHUB_WORKSPACE}/core/target/iginx-core-0.6.0-SNAPSHOT/conf/config.properties
fi
elif [[ "${{inputs.Test-Way}}" == "oriNoDataExpHasData" || "${{inputs.Test-Way}}" == "oriNoDataExpNoData" ]]; then
if [ "$RUNNER_OS" == "Linux" ]; then
sed -i "s/has_data=true/has_data=false/g" ${GITHUB_WORKSPACE}/core/target/iginx-core-0.6.0-SNAPSHOT/conf/config.properties
elif [ "$RUNNER_OS" == "macOS" ]; then
sed -i "" "s/has_data=true/has_data=false/" ${GITHUB_WORKSPACE}/core/target/iginx-core-0.6.0-SNAPSHOT/conf/config.properties
fi
fi

- if: inputs.confFile=='DBName'
name: Change conf/config.properties
shell: bash
run: |
echo "${{inputs.DB-name}}" > ${GITHUB_WORKSPACE}/test/src/test/java/cn/edu/tsinghua/iginx/integration/DBConf.txt
19 changes: 19 additions & 0 deletions .github/actions/postgresqlWriter/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'postgresql-writer'
description: 'pgsql writer'
inputs:
version:
description: 'PostgreSQL version'
required: false
default: postgresql
Test-Way:
description: 'the way to imp'
required: false
default: clearData
runs:
using: "composite" # Mandatory parameter
steps:
- name: Write history Data
shell: bash
run: |
mvn test -q -Dtest=PostgreSQLHistoryDataGenerator#${{inputs.Test-Way}} -DfailIfNoTests=false
sleep 5
136 changes: 136 additions & 0 deletions .github/workflows/capacity-expansion-pg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: "Capacity-Expansions-On-PostgreSQL"
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
VERSION: 0.6.0-SNAPSHOT
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
PostgreSQL-Test:
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
java: [ 8 ]
python-version: [ "3.7" ]
os: [ ubuntu-latest, macos-latest ]
DB-name: [ "postgresql" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Environmet Dependence
uses: ./.github/actions/dependence
with:
python-version: ${{ matrix.python-version }}
java: ${{ matrix.java }}
- name: Run ZooKeeper
uses: ./.github/actions/zookeeperRunner
- name: Run IoTDB
uses: ./.github/actions/iotdbRunner
with:
version: ${{matrix.DB-name}}
- name: Run PostgreSQL
uses: ./.github/actions/postgresqlRunner
with:
version: ${{matrix.DB-name}}

- name: Change pom
run: |
mv test/pom.xml test/pom.xml.backup
mv test/pom.xml.${{matrix.DB-name}} test/pom.xml
- name: Install IginX with Maven
shell: bash
run: |
mvn clean package -DskipTests

#第 1 阶段测试开始==========================================
- name: Prepare CapExp environment
if: always()
uses: ./.github/actions/capacityExpansionUnionTest_pg
with:
version: ${VERSION}
DB-name: ${{matrix.DB-name}}
Test-Way: oriHasDataExpHasData

- name: oriHasDataExpHasData IT
if: always()
run: |
if [ "${{matrix.DB-name}}" == "iotdb11" ]; then
mvn test -q -Dtest=IoTDB11HistoryDataCapacityExpansionIT#oriHasDataExpHasData -DfailIfNoTests=false
elif [ "${{matrix.DB-name}}" == "iotdb12" ]; then
mvn test -q -Dtest=IoTDB12HistoryDataCapacityExpansionIT#oriHasDataExpHasData -DfailIfNoTests=false
elif [ "${{matrix.DB-name}}" == "postgresql" ]; then
mvn test -q -Dtest=PostgreSQLHistoryDataCapacityExpansionIT#oriHasDataExpHasData -DfailIfNoTests=false
fi

#第 2 阶段测试开始==========================================
- name: Prepare CapExp environment
if: always()
uses: ./.github/actions/capacityExpansionUnionTest_pg
with:
version: ${VERSION}
DB-name: ${{matrix.DB-name}}
Test-Way: oriNoDataExpNoData

- name: oriNoDataExpNoData IT
if: always()
run: |
if [ "${{matrix.DB-name}}" == "iotdb11" ]; then
mvn test -q -Dtest=IoTDB11HistoryDataCapacityExpansionIT#oriNoDataExpNoData -DfailIfNoTests=false
elif [ "${{matrix.DB-name}}" == "iotdb12" ]; then
mvn test -q -Dtest=IoTDB12HistoryDataCapacityExpansionIT#oriNoDataExpNoData -DfailIfNoTests=false
elif [ "${{matrix.DB-name}}" == "postgresql" ]; then
mvn test -q -Dtest=PostgreSQLHistoryDataCapacityExpansionIT#oriNoDataExpNoData -DfailIfNoTests=false
fi

#第 3 阶段测试开始==========================================
- name: Prepare CapExp environment
if: always()
uses: ./.github/actions/capacityExpansionUnionTest_pg
with:
version: ${VERSION}
DB-name: ${{matrix.DB-name}}
Test-Way: oriHasDataExpNoData

- name: oriHasDataExpNoData IT
if: always()
run: |
if [ "${{matrix.DB-name}}" == "iotdb11" ]; then
mvn test -q -Dtest=IoTDB11HistoryDataCapacityExpansionIT#oriHasDataExpNoData -DfailIfNoTests=false
elif [ "${{matrix.DB-name}}" == "iotdb12" ]; then
mvn test -q -Dtest=IoTDB12HistoryDataCapacityExpansionIT#oriHasDataExpNoData -DfailIfNoTests=false
elif [ "${{matrix.DB-name}}" == "postgresql" ]; then
mvn test -q -Dtest=PostgreSQLHistoryDataCapacityExpansionIT#oriHasDataExpNoData -DfailIfNoTests=false
fi

#第 4 阶段测试开始==========================================
- name: Prepare CapExp environment
if: always()
uses: ./.github/actions/capacityExpansionUnionTest_pg
with:
version: ${VERSION}
DB-name: ${{matrix.DB-name}}
Test-Way: oriNoDataExpHasData

- name: oriNoDataExpHasData IT
if: always()
run: |
if [ "${{matrix.DB-name}}" == "iotdb11" ]; then
mvn test -q -Dtest=IoTDB11HistoryDataCapacityExpansionIT#oriNoDataExpHasData -DfailIfNoTests=false
elif [ "${{matrix.DB-name}}" == "iotdb12" ]; then
mvn test -q -Dtest=IoTDB12HistoryDataCapacityExpansionIT#oriNoDataExpHasData -DfailIfNoTests=false
elif [ "${{matrix.DB-name}}" == "postgresql" ]; then
mvn test -q -Dtest=PostgreSQLHistoryDataCapacityExpansionIT#oriNoDataExpHasData -DfailIfNoTests=false
fi

- uses: codecov/codecov-action@v1
with:
file: ./**/target/site/jacoco/jacoco.xml
name: codecov
6 changes: 6 additions & 0 deletions .github/workflows/postgresqlRunner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

set -e
sudo sh -c "apt-get install postgresql postgresql-client"
sh -c "sleep 20"
sudo sh -c "/etc/init.d/postgresql start"
2 changes: 1 addition & 1 deletion conf/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ storageEngineList=127.0.0.1#6667#iotdb11#username=root#password=root#sessionPool
replicaNum=0

# 底层数据库类名
databaseClassNames=iotdb11=cn.edu.tsinghua.iginx.iotdb.IoTDBStorage,iotdb12=cn.edu.tsinghua.iginx.iotdb.IoTDBStorage,influxdb=cn.edu.tsinghua.iginx.influxdb.InfluxDBStorage,parquet=cn.edu.tsinghua.iginx.parquet.ParquetStorage
databaseClassNames=iotdb11=cn.edu.tsinghua.iginx.iotdb.IoTDBStorage,iotdb12=cn.edu.tsinghua.iginx.iotdb.IoTDBStorage,influxdb=cn.edu.tsinghua.iginx.influxdb.InfluxDBStorage,parquet=cn.edu.tsinghua.iginx.parquet.ParquetStorage,postgresql=cn.edu.tsinghua.iginx.postgresql.PostgreSQLStorage
#,opentsdb=cn.edu.tsinghua.iginx.opentsdb.OpenTSDBStorage,timescaledb=cn.edu.tsinghua.iginx.timescaledb.TimescaleDBStorage,postgresql=cn.edu.tsinghua.iginx.postgresql.PostgreSQLStorage

#统计信息收集类
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ private void setResultFromRowStream(RequestContext ctx, RowStream stream) throws
bitmapList.add(ByteBuffer.wrap(bitmap.getBytes()));

if (hasTimestamp) {
logger.info("test hasTimestamp!!!");
timestampList.add(row.getTimestamp());

}
}

Expand Down
Loading