This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push: new b69ebc3 [Extension] Add DataX doriswriter extension directory (#6111) b69ebc3 is described below commit b69ebc3ec4bdd1a0b019d87496464f821425f94c Author: Mingyu Chen <morningman....@gmail.com> AuthorDate: Wed Jun 30 09:55:19 2021 +0800 [Extension] Add DataX doriswriter extension directory (#6111) This CL only add the script for building DataX development environment --- extension/DataX/README | 46 ++++++++++++++++++ extension/DataX/doriswriter/README | 0 extension/DataX/init-env.sh | 55 ++++++++++++++++++++++ .../apache/doris/common/ThreadPoolManagerTest.java | 9 ++-- 4 files changed, 106 insertions(+), 4 deletions(-) diff --git a/extension/DataX/README b/extension/DataX/README new file mode 100644 index 0000000..687793e --- /dev/null +++ b/extension/DataX/README @@ -0,0 +1,46 @@ +<!-- +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. +--> + +## DataX Extension Directory + +This directory is the doriswriter plug-in development environment of Alibaba DataX. + +Because the doriswriter plug-in depends on some modules in the DataX code base, and these module dependencies are not submitted to the official Maven repository, when we develop the doriswriter plug-in, we need to download the complete DataX code base to facilitate our development and compilation of the doriswriter plug-in. + +### Directory structure + +1. `doriswriter/` + + This directory is the code directory of doriswriter, and this part of the code should be in the Doris code base. + +2. `init_env.sh` + + The script mainly performs the following steps: + + 1. Git clone the DataX code base to the local + 2. Softlink the `doriswriter/` directory to `DataX/doriswriter`. + 3. Add `<module>doriswriter</module>` to the original `DataX/pom.xml` + + After that, developers can enter `DataX/` for development. And the changes in the `DataX/doriswriter` directory will be reflected in the `doriswriter/` directory, which is convenient for developers to submit code. + +### How to build + +1. Run `init_env.sh` +2. Modify code of doriswriter in `DataX/doriswriter` +3. Commit code of doriswriter in `doriswriter` diff --git a/extension/DataX/doriswriter/README b/extension/DataX/doriswriter/README new file mode 100644 index 0000000..e69de29 diff --git a/extension/DataX/init-env.sh b/extension/DataX/init-env.sh new file mode 100755 index 0000000..e6a4af8 --- /dev/null +++ b/extension/DataX/init-env.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +# Copyright (c) 2017, Baidu.com, Inc. All Rights Reserved + +# Licensed 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. + +#################################################################### +# This script is used to initial environment of DataX +#################################################################### + +set -eo pipefail + +DATAX_EXTENSION_HOME=`dirname "$0"` +DATAX_EXTENSION_HOME=`cd "$DATAX_EXTENSION_HOME"; pwd` + +export DATAX_EXTENSION_HOME + +DATAX_GITHUB=https://github.com/alibaba/DataX.git + +DORISWRITER_DIR=$DATAX_EXTENSION_HOME/doriswriter +DATAX_GIT_DIR=$DATAX_EXTENSION_HOME/DataX/ +DATAX_POM=$DATAX_EXTENSION_HOME/DataX/pom.xml + +if [ ! -d $DATAX_GIT_DIR ]; then + echo "Clone DataX from $DATAX_GITHUB" + git clone $DATAX_GITHUB $DATAX_GIT_DIR + ln -s $DORISWRITER_DIR $DATAX_GIT_DIR/doriswriter +else + echo "DataX code repo exists in $DATAX_GIT_DIR" +fi + +if [ ! -f "$DATAX_POM" ]; then + echo "$DATAX_POM does not exist, exit" + exit 1 +fi + +if [ `grep -c "doriswriter" $DATAX_POM` -eq 0 ]; then + echo "No doriswriter module in $DATAX_POM, add it" + cp $DATAX_POM ${DATAX_POM}.orig + sed -i "s/<\/modules>/ <module>doriswriter<\/module>\n <\/modules>/g" $DATAX_POM +else + echo "doriswriter module exists in $DATAX_POM" +fi + +echo "Finish DataX environment initialization" diff --git a/fe/fe-core/src/test/java/org/apache/doris/common/ThreadPoolManagerTest.java b/fe/fe-core/src/test/java/org/apache/doris/common/ThreadPoolManagerTest.java index a31b15c..7092630 100755 --- a/fe/fe-core/src/test/java/org/apache/doris/common/ThreadPoolManagerTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/common/ThreadPoolManagerTest.java @@ -19,11 +19,12 @@ package org.apache.doris.common; import org.apache.doris.metric.Metric; import org.apache.doris.metric.MetricRepo; + import org.junit.Assert; import org.junit.Test; -import java.util.concurrent.ThreadPoolExecutor; import java.util.List; +import java.util.concurrent.ThreadPoolExecutor; public class ThreadPoolManagerTest { @@ -68,10 +69,10 @@ public class ThreadPoolManagerTest { for (int i = 0; i < 4; i++) { testFixedThreaddPool.submit(task); } - + + Assert.assertTrue(testFixedThreaddPool.getActiveCount() <= 2); + Assert.assertTrue(testFixedThreaddPool.getQueue().size() > 0); Assert.assertEquals(2, testFixedThreaddPool.getPoolSize()); - Assert.assertEquals(2, testFixedThreaddPool.getActiveCount()); - Assert.assertEquals(2, testFixedThreaddPool.getQueue().size()); Assert.assertEquals(0, testFixedThreaddPool.getCompletedTaskCount()); Thread.sleep(2000); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org