Skip to content

Commit

Permalink
Feature/spline spark agent 729 decouple absa commons (#730)
Browse files Browse the repository at this point in the history
* issue #729 Decouple from Absa Commons and other external dependencies

* issue #729 + tests

* issue #729 consolidate commons

* issue #729 move "absa.commons" to "absa.spline.commons"

* issue #729 fix failing tests

* issue #729 remove deprecated methods

* issue #729 POM: Fix an oversight in the dependency name (hardcoded scala version)

* issue #729 Optimize imports

* issue #729 Increment project version to 2.0.0-SNAPSHOT
  • Loading branch information
wajda committed Aug 2, 2023
1 parent c398fcc commit 6ef01c6
Show file tree
Hide file tree
Showing 204 changed files with 5,837 additions and 225 deletions.
2 changes: 1 addition & 1 deletion bundle-2.2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<groupId>za.co.absa.spline.agent.spark</groupId>
<artifactId>spline-spark-agent_2.12</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.3.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bundle-2.3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<groupId>za.co.absa.spline.agent.spark</groupId>
<artifactId>spline-spark-agent_2.12</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.3.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bundle-2.4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<groupId>za.co.absa.spline.agent.spark</groupId>
<artifactId>spline-spark-agent_2.12</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.3.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bundle-3.0/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<groupId>za.co.absa.spline.agent.spark</groupId>
<artifactId>spline-spark-agent_2.12</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.3.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bundle-3.1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<groupId>za.co.absa.spline.agent.spark</groupId>
<artifactId>spline-spark-agent_2.12</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.3.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bundle-3.2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<groupId>za.co.absa.spline.agent.spark</groupId>
<artifactId>spline-spark-agent_2.12</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.3.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bundle-3.3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<groupId>za.co.absa.spline.agent.spark</groupId>
<artifactId>spline-spark-agent_2.12</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.3.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
61 changes: 61 additions & 0 deletions commons/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2023 ABSA Group Limited
~
~ 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.
-->

<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>

<artifactId>agent-commons_2.12</artifactId>
<packaging>jar</packaging>

<parent>
<groupId>za.co.absa.spline.agent.spark</groupId>
<artifactId>spline-spark-agent_2.12</artifactId>
<relativePath>../pom.xml</relativePath>
<version>2.0.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
</dependency>
<dependency>
<groupId>org.scala-graph</groupId>
<artifactId>graph-core_${scala.binary.version}</artifactId>
<version>1.12.5</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
</dependency>

</dependencies>
</project>
21 changes: 21 additions & 0 deletions commons/src/main/resources/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright 2023 ABSA Group Limited
#
# 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.
#

build.version=4.2.42-TEST
build.timestamp=1234567890

bld.ver=Custom version
bld.ttt=Custom timestamp
17 changes: 17 additions & 0 deletions commons/src/main/resources/buildinfo-test/my.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# Copyright 2023 ABSA Group Limited
#
# 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.
#
build.version=My version
build.timestamp=My timestamp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2021 ABSA Group Limited
*
* 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.
*/

package org.apache.commons.configuration

object SubsetConfigurationMethods {

implicit class SubsetConfigurationOps(val conf: SubsetConfiguration) extends AnyVal {

// The `SubsetConfiguration.getParentKey()` method is protected.
// We have to use reflection call due to IllegalAccessError in some environments.
// See: https://github.com/AbsaOSS/commons/issues/75
def getParentKey: String => String = {
val method = classOf[SubsetConfiguration].getDeclaredMethod("getParentKey", classOf[String])
method.setAccessible(true)
s => method.invoke(conf, s).asInstanceOf[String]
}
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 ABSA Group Limited
* Copyright 2023 ABSA Group Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package za.co.absa.commons
package za.co.absa.spline.commons

import scala.util.matching.Regex

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 ABSA Group Limited
* Copyright 2023 ABSA Group Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package za.co.absa.commons
package za.co.absa.spline.commons

object CollectionImplicits {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 ABSA Group Limited
* Copyright 2023 ABSA Group Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,10 +14,10 @@
* limitations under the License.
*/

package za.co.absa.commons
package za.co.absa.spline.commons

import org.apache.commons.configuration.Configuration
import za.co.absa.commons.config.ConfigurationImplicits.ConfigurationRequiredWrapper
import za.co.absa.spline.commons.config.ConfigurationImplicits.ConfigurationRequiredWrapper

import scala.reflect.ClassTag
import scala.util.control.NonFatal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 ABSA Group Limited
* Copyright 2023 ABSA Group Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,9 +14,9 @@
* limitations under the License.
*/

package za.co.absa.commons
package za.co.absa.spline.commons

import za.co.absa.commons.EnumUtils.EnumOps._
import za.co.absa.spline.commons.EnumUtils.EnumOps._

import scala.language.reflectiveCalls
import scala.reflect.ClassTag
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 ABSA Group Limited
* Copyright 2023 ABSA Group Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package za.co.absa.commons
package za.co.absa.spline.commons

import scala.language.reflectiveCalls

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 ABSA Group Limited
* Copyright 2023 ABSA Group Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package za.co.absa.commons
package za.co.absa.spline.commons

trait NamedEntity {
def name: String = getClass.getSimpleName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package za.co.absa.commons
package za.co.absa.spline.commons

object SplineTraversableExtension {
implicit class TraversableOps[A <: Traversable[_]](val xs: A) extends AnyVal {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 ABSA Group Limited
* Copyright 2023 ABSA Group Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package za.co.absa.commons
package za.co.absa.spline.commons

object ThrowableImplicits {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2023 ABSA Group Limited
*
* 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.
*/

package za.co.absa.spline.commons.annotation;

import java.lang.annotation.*;

/**
* A lower-level, unstable API intended for developers.
*
* Developer API might change or be removed in minor versions.
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER,
ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.PACKAGE})
public @interface DeveloperApi {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2023 ABSA Group Limited
*
* 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.
*/

package za.co.absa.spline.commons.annotation;

import java.lang.annotation.*;

/**
* An experimental user-facing API.
*
* Experimental API might change or be removed in minor versions, or be adopted as stable API.
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER,
ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.PACKAGE})
public @interface Experimental {}
Loading

0 comments on commit 6ef01c6

Please sign in to comment.