Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ jobs:
- name: FlinkOnRemoteClusterDeployTest
class: org.apache.streampark.e2e.cases.Flink120OnRemoteClusterDeployTest

- name: FlinkOnYarnClusterDeployTest
class: org.apache.streampark.e2e.cases.Flink120OnYarnClusterDeployTest
# - name: FlinkOnYarnClusterDeployTest
# class: org.apache.streampark.e2e.cases.Flink120OnYarnClusterDeployTest

- name: FlinkSQLOnYarnTest
class: org.apache.streampark.e2e.cases.FlinkSQL120OnYarnTest
# - name: FlinkSQLOnYarnTest
# class: org.apache.streampark.e2e.cases.FlinkSQL120OnYarnTest

#- name: Flink117OnRemoteClusterDeployTest
# class: org.apache.streampark.e2e.cases.Flink117OnRemoteClusterDeployTest
Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

<modules>
<module>streampark-common</module>
<module>streampark-common-scala-bridge</module>
<module>streampark-flink</module>
<module>streampark-spark</module>
<module>streampark-console</module>
Expand Down Expand Up @@ -225,6 +226,12 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.streampark</groupId>
<artifactId>streampark-common-scala-bridge_${scala.binary.version}</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
Expand Down
45 changes: 45 additions & 0 deletions streampark-common-scala-bridge/pom.xml
Comment thread
wolfboys marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.streampark</groupId>
<artifactId>streampark</artifactId>
<version>${revision}</version>
</parent>

<artifactId>streampark-common-scala-bridge_${scala.binary.version}</artifactId>
<name>StreamPark : Common Scala Bridge</name>

<dependencies>
<dependency>
<groupId>org.apache.streampark</groupId>
<artifactId>streampark-common_${scala.binary.version}</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ object Implicits extends ToScalaImplicits with ToJavaImplicits with DecorateAsJa

type JavaShort = java.lang.Short

/** Converts plain Java maps to immutable Scala maps (excludes ConcurrentMap to avoid ambiguity). */
implicit def javaLinkedHashMapToScalaMap[K, V](map: JavaLinkedMap[K, V]): Map[K, V] = {
if (map == null) Map.empty else map.asScala.toMap
}

implicit def javaHashMapToScalaMap[K, V](map: JavaHashMap[K, V]): Map[K, V] = {
if (map == null) Map.empty else map.asScala.toMap
}

implicit class AutoCloseImplicits[T <: AutoCloseable](autoCloseable: T) {
implicit def using[R](func: T => R)(implicit excFunc: Throwable => R = null): R = {
var exception: Option[Throwable] = Option.empty
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* 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.
*/

package org.apache.streampark.common.util

import org.apache.streampark.shaded.org.slf4j.{Logger => Slf4JLogger}

trait Logger {

@transient private[this] var _logger: Slf4JLogger = _

private[this] val prefix = "[StreamPark]"

protected def logName: String = this.getClass.getName.stripSuffix("$")

protected def logger: Slf4JLogger = {
if (_logger == null) {
_logger = StreamParkLoggerFactory.loggerFactory().getLogger(logName)
}
_logger
}

protected def logInfo(msg: => String): Unit = {
if (logger.isInfoEnabled) logger.info(s"$prefix $msg")
}

protected def logInfo(msg: => String, throwable: Throwable): Unit = {
if (logger.isInfoEnabled) logger.info(s"$prefix $msg", throwable)
}

protected def logDebug(msg: => String): Unit = {
if (logger.isDebugEnabled) logger.debug(s"$prefix $msg")
}

protected def logDebug(msg: => String, throwable: Throwable): Unit = {
if (logger.isDebugEnabled) logger.debug(s"$prefix $msg", throwable)
}

def logTrace(msg: => String): Unit = {
if (logger.isTraceEnabled) logger.trace(s"$prefix $msg")
}

protected def logTrace(msg: => String, throwable: Throwable): Unit = {
if (logger.isTraceEnabled) logger.trace(s"$prefix $msg", throwable)
}

def logWarn(msg: => String): Unit = {
if (logger.isWarnEnabled) logger.warn(s"$prefix $msg")
}

protected def logWarn(msg: => String, throwable: Throwable): Unit = {
if (logger.isWarnEnabled) logger.warn(s"$prefix $msg", throwable)
}

protected def logError(msg: => String): Unit = {
if (logger.isErrorEnabled) logger.error(s"$prefix $msg")
}

protected def logError(msg: => String, throwable: Throwable): Unit = {
if (logger.isErrorEnabled) logger.error(s"$prefix $msg", throwable)
}

protected def isTraceEnabled(): Boolean = logger.isTraceEnabled
}
31 changes: 5 additions & 26 deletions streampark-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@

<dependencies>

<!-- test -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-scala_${scala.binary.version}</artifactId>
<version>${mockito-scala.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.binary.version}</artifactId>
<version>${scalatest.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand All @@ -58,10 +43,10 @@
<scope>test</scope>
</dependency>

<!-- enumeratum -->
<dependency>
<groupId>com.beachape</groupId>
<artifactId>enumeratum_${scala.binary.version}</artifactId>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -147,13 +132,8 @@
<plugins>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>

<plugin>
Expand All @@ -170,7 +150,6 @@
<dependencyReducedPomLocation>${project.basedir}/target/dependency-reduced-pom.xml</dependencyReducedPomLocation>
<artifactSet>
<includes>
<include>com.beachape:*</include>
<include>io.netty:netty-resolver</include>
</includes>
</artifactSet>
Expand Down
Loading
Loading