From bf0b6e3770ca7ea39252aa6d791f349f007a6009 Mon Sep 17 00:00:00 2001 From: PeterZh6 Date: Fri, 4 Oct 2024 13:55:51 +0800 Subject: [PATCH] first run --- .../sort-end-to-end-tests-v1.15/pom.xml | 9 +++ .../sort/tests/utils/HBaseContainer.java | 7 +- .../inlong/sort/tests/utils/HBaseManager.java | 6 +- .../resources/docker/hbase/start-hbase.sh | 65 +++++++++++++++++++ 4 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/resources/docker/hbase/start-hbase.sh diff --git a/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/pom.xml b/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/pom.xml index 380587691cc..0ab23da911d 100644 --- a/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/pom.xml +++ b/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/pom.xml @@ -157,6 +157,15 @@ jedis test + + + org.apache.phoenix + phoenix-core + 5.2.0 + diff --git a/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/java/org/apache/inlong/sort/tests/utils/HBaseContainer.java b/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/java/org/apache/inlong/sort/tests/utils/HBaseContainer.java index 5572e29bab9..3f0213799b3 100644 --- a/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/java/org/apache/inlong/sort/tests/utils/HBaseContainer.java +++ b/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/java/org/apache/inlong/sort/tests/utils/HBaseContainer.java @@ -55,10 +55,11 @@ public HBaseContainer(String imageName) { public String getDriverClassName() { try { - Class.forName("org.apache.hbase.jdbc.Driver"); - return "org.apache.hbase.jdbc.Driver"; + Class.forName("com.mysql.cj.jdbc.Driver"); + return "com.mysql.cj.jdbc.Driver"; } catch (ClassNotFoundException e) { - throw new RuntimeException("HBase JDBC Driver not found!", e); + return "com.mysql.jdbc.Driver"; + // throw new RuntimeException("HBase JDBC Driver not found!", e); } } diff --git a/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/java/org/apache/inlong/sort/tests/utils/HBaseManager.java b/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/java/org/apache/inlong/sort/tests/utils/HBaseManager.java index 074a381d8ba..31753f06146 100644 --- a/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/java/org/apache/inlong/sort/tests/utils/HBaseManager.java +++ b/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/java/org/apache/inlong/sort/tests/utils/HBaseManager.java @@ -37,17 +37,17 @@ public class HBaseManager { public static final String INTER_CONTAINER_HBASE_ALIAS = "hbase"; private static final String NEW_HBASE_REPOSITORY = "inlong-hbase"; private static final String NEW_HBASE_TAG = "latest"; - private static final String HBASE_IMAGE_NAME = "harisekhon/hbase:2.4.11"; + private static final String HBASE_IMAGE_NAME = "harisekhon/hbase:latest"; private static final String DEFAULT_COLUMN_FAMILY = "cf1"; public static final Logger HBASE_LOG = LoggerFactory.getLogger(HBaseContainer.class); static { GenericContainer oldHBase = new GenericContainer(HBASE_IMAGE_NAME); Startables.deepStart(Stream.of(oldHBase)).join(); - oldHBase.copyFileToContainer(MountableFile.forClasspathResource("/docker/hbase/start_hbase.sh"), + oldHBase.copyFileToContainer(MountableFile.forClasspathResource("/docker/hbase/start-hbase.sh"), "/data/hbase/"); try { - oldHBase.execInContainer("chmod", "+x", "/data/hbase/start_hbase.sh"); + oldHBase.execInContainer("chmod", "+x", "/data/hbase/start-hbase.sh"); } catch (Exception e) { e.printStackTrace(); } diff --git a/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/resources/docker/hbase/start-hbase.sh b/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/resources/docker/hbase/start-hbase.sh new file mode 100644 index 00000000000..f053526245a --- /dev/null +++ b/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/resources/docker/hbase/start-hbase.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +# +#/** +# * 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. +# */ + +# Modelled after $HADOOP_HOME/bin/start-hbase.sh. + +# Start hadoop hbase daemons. +# Run this on master node. +usage="Usage: start-hbase.sh [--autostart-window-size ]\ + [--autostart-window-retry-limit ]\ + [autostart|start]" + +bin=`dirname "${BASH_SOURCE-$0}"` +bin=`cd "$bin">/dev/null; pwd` + +# default autostart args value indicating infinite window size and no retry limit +AUTOSTART_WINDOW_SIZE=0 +AUTOSTART_WINDOW_RETRY_LIMIT=0 + +. "$bin"/hbase-config.sh + +# start hbase daemons +errCode=$? +if [ $errCode -ne 0 ] +then + exit $errCode +fi + +if [ "$1" = "autostart" ] +then + commandToRun="--autostart-window-size ${AUTOSTART_WINDOW_SIZE} --autostart-window-retry-limit ${AUTOSTART_WINDOW_RETRY_LIMIT} autostart" +else + commandToRun="start" +fi + +# HBASE-6504 - only take the first line of the output in case verbose gc is on +distMode=`$bin/hbase --config "$HBASE_CONF_DIR" org.apache.hadoop.hbase.util.HBaseConfTool hbase.cluster.distributed | head -n 1` + +if [ "$distMode" == 'false' ] +then + "$bin"/hbase-daemon.sh --config "${HBASE_CONF_DIR}" $commandToRun master +else + "$bin"/hbase-daemons.sh --config "${HBASE_CONF_DIR}" $commandToRun zookeeper + "$bin"/hbase-daemon.sh --config "${HBASE_CONF_DIR}" $commandToRun master + "$bin"/hbase-daemons.sh --config "${HBASE_CONF_DIR}" \ + --hosts "${HBASE_REGIONSERVERS}" $commandToRun regionserver + "$bin"/hbase-daemons.sh --config "${HBASE_CONF_DIR}" \ + --hosts "${HBASE_BACKUP_MASTERS}" $commandToRun master-backup +fi