Skip to content

Commit 178ebf0

Browse files
authored
Merge pull request #87 from RADAR-base/release-1.1.5
Release 1.1.5
2 parents 4cafffc + 108d1b6 commit 178ebf0

File tree

13 files changed

+90
-78
lines changed

13 files changed

+90
-78
lines changed

Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,22 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212

13-
FROM openjdk:14 AS builder
13+
FROM gradle:6.6.1-jdk11 AS builder
1414

1515
RUN mkdir /code
1616
WORKDIR /code
1717

18-
ENV GRADLE_OPTS -Dorg.gradle.daemon=false
19-
20-
COPY ./gradle /code/gradle
21-
COPY ./gradlew /code/
22-
RUN ./gradlew --version
18+
ENV GRADLE_USER_HOME=/code/.gradlecache
2319

2420
COPY ./build.gradle ./gradle.properties ./settings.gradle /code/
2521

26-
RUN ./gradlew downloadDependencies copyDependencies startScripts
22+
RUN gradle downloadDependencies copyDependencies startScripts
2723

2824
COPY ./src /code/src
2925

30-
RUN ./gradlew jar
26+
RUN gradle jar
3127

32-
FROM openjdk:14
28+
FROM openjdk:11-jre-slim
3329

3430
MAINTAINER Joris Borgdorff <[email protected]>, Yatharth Ranjan<[email protected]>
3531

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ When upgrading to version 0.6.0 from version 0.5.x or earlier, please follow the
6161

6262
This package is available as docker image [`radarbase/radar-output-restructure`](https://hub.docker.com/r/radarbase/radar-output-restructure). The entrypoint of the image is the current application. So in all the commands listed in usage, replace `radar-output-restructure` with for example:
6363
```shell
64-
docker run --rm -t --network hadoop -v "$PWD/output:/output" radarbase/radar-output-restructure:1.1.3-hdfs -n hdfs-namenode -o /output /myTopic
64+
docker run --rm -t --network hadoop -v "$PWD/output:/output" radarbase/radar-output-restructure:1.1.5-hdfs -n hdfs-namenode -o /output /myTopic
6565
```
6666
if your docker cluster is running in the `hadoop` network and your output directory should be `./output`.
6767

@@ -171,7 +171,7 @@ This package requires at least Java JDK 8. Build the distribution with
171171
and install the package into `/usr/local` with for example
172172
```shell
173173
sudo mkdir -p /usr/local
174-
sudo tar -xzf build/distributions/radar-output-restructure-1.1.3.tar.gz -C /usr/local --strip-components=1
174+
sudo tar -xzf build/distributions/radar-output-restructure-1.1.5.tar.gz -C /usr/local --strip-components=1
175175
```
176176

177177
Now the `radar-output-restructure` command should be available.

build.gradle

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ plugins {
44
id 'application'
55
id 'com.jfrog.bintray' version '1.8.5'
66
id 'maven-publish'
7-
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
8-
id 'com.avast.gradle.docker-compose' version "0.10.10"
7+
id 'org.jetbrains.kotlin.jvm'
8+
id 'com.avast.gradle.docker-compose' version "0.13.4"
99
}
1010

1111
group 'org.radarbase'
12-
version '1.1.4.1'
12+
version '1.1.5'
1313
mainClassName = 'org.radarbase.output.Application'
1414

1515
sourceCompatibility = '1.8'
@@ -22,16 +22,16 @@ ext {
2222
githubUrl = "https://github.com/${githubRepoName}"
2323
issueUrl = "${githubUrl}/issues"
2424

25-
avroVersion = '1.9.2'
26-
jacksonVersion = '2.10.3'
27-
hadoopVersion = '3.1.2'
25+
avroVersion = '1.10.0'
26+
jacksonVersion = '2.11.3'
27+
hadoopVersion = '3.3.0'
2828
jCommanderVersion = '1.78'
29-
almworksVersion = '1.1.1'
30-
junitVersion = '5.6.1'
31-
minioVersion = '7.1.0'
32-
jedisVersion = '3.2.0'
29+
almworksVersion = '1.1.2'
30+
junitVersion = '5.6.2'
31+
minioVersion = '7.1.4'
32+
jedisVersion = '3.3.0'
3333
slf4jVersion = '1.7.30'
34-
azureStorageVersion = '12.6.0'
34+
azureStorageVersion = '12.8.0'
3535
}
3636

3737
repositories {
@@ -69,7 +69,8 @@ dependencies {
6969
implementation group: 'org.apache.avro', name: 'avro-mapred', version: avroVersion
7070
implementation group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion
7171

72-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
72+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
73+
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
7374
implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
7475

7576
runtimeOnly group: 'org.slf4j', name: 'slf4j-log4j12', version: slf4jVersion
@@ -163,13 +164,18 @@ tasks.withType(Tar){
163164
}
164165

165166
task downloadDependencies {
166-
description "Pre-downloads dependencies"
167-
configurations.compileClasspath.files
168-
configurations.runtimeClasspath.files
167+
doLast {
168+
description "Pre-downloads dependencies"
169+
configurations.compileClasspath.files
170+
configurations.runtimeClasspath.files
171+
}
172+
outputs.upToDateWhen { false }
169173
}
170174

171175
task copyDependencies(type: Copy) {
172-
from configurations.runtimeClasspath.files
176+
from {
177+
configurations.runtimeClasspath.files
178+
}
173179
into "$buildDir/third-party/"
174180
}
175181

@@ -255,5 +261,5 @@ bintray {
255261
}
256262

257263
wrapper {
258-
gradleVersion '6.3'
264+
gradleVersion '6.6.1'
259265
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kotlinVersion=1.4.0

gradle/wrapper/gradle-wrapper.jar

509 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ esac
8282

8383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
8484

85+
8586
# Determine the Java command to use to start the JVM.
8687
if [ -n "$JAVA_HOME" ] ; then
8788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
129130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
132134
JAVACMD=`cygpath --unix "$JAVACMD"`
133135

134136
# We build the pattern for arguments to be converted via cygpath

gradlew.bat

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4040

4141
set JAVA_EXE=java.exe
4242
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4444

4545
echo.
4646
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
5454
set JAVA_HOME=%JAVA_HOME:"=%
5555
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5656

57-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5858

5959
echo.
6060
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,28 +64,14 @@ echo location of your Java installation.
6464

6565
goto fail
6666

67-
:init
68-
@rem Get command-line arguments, handling Windows variants
69-
70-
if not "%OS%" == "Windows_NT" goto win9xME_args
71-
72-
:win9xME_args
73-
@rem Slurp the command line arguments.
74-
set CMD_LINE_ARGS=
75-
set _SKIP=2
76-
77-
:win9xME_args_slurp
78-
if "x%~1" == "x" goto execute
79-
80-
set CMD_LINE_ARGS=%*
81-
8267
:execute
8368
@rem Setup the command line
8469

8570
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8671

72+
8773
@rem Execute Gradle
88-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
8975

9076
:end
9177
@rem End local scope for the variables with windows NT shell

settings.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1+
pluginManagement {
2+
resolutionStrategy {
3+
eachPlugin {
4+
if ( requested.id.id == 'org.jetbrains.kotlin.jvm' ) {
5+
useModule( "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" )
6+
}
7+
}
8+
}
9+
}
10+
111
rootProject.name = 'radar-output-restructure'

src/main/java/org/radarbase/output/format/CsvAvroConverterFactory.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ class CsvAvroConverterFactory: RecordConverterFactory {
1919
override val formats: Collection<String> = setOf("csv")
2020

2121
@Throws(IOException::class)
22-
override fun deduplicate(fileName: String, source: Path, target: Path, compression: Compression, distinctFields: Set<String>, ignoreFields: Set<String>) {
22+
override fun deduplicate(fileName: String, source: Path, target: Path, compression: Compression, distinctFields: Set<String>, ignoreFields: Set<String>): Boolean {
2323
val (header, lineIndexes) = Files.newInputStream(source).use { input ->
2424
processLines(input, compression) { header, lines ->
25-
if (header == null) return
25+
if (header == null) return false
2626
val fields = fieldIndexes(header, distinctFields, ignoreFields)
2727
var count = 0
2828
val lineMap = lines
2929
.onEach { count += 1 }
30-
.mapIndexed { i, line -> Pair(ArrayWrapper(line.byIndex(fields)), i) }
30+
.mapIndexed { idx, line -> Pair(ArrayWrapper(line.byIndex(fields)), idx) }
3131
.toMap(HashMap())
3232

3333
if (lineMap.size == count) {
3434
logger.debug("File {} is already deduplicated. Skipping.", fileName)
35-
return
35+
return false
3636
}
3737

3838
Pair(header, lineMap.values
@@ -52,6 +52,7 @@ class CsvAvroConverterFactory: RecordConverterFactory {
5252
})
5353
}
5454
}
55+
return true
5556
}
5657

5758
private fun writeLines(target: Path, fileName: String, compression: Compression, lines: Sequence<Array<String>>) {

0 commit comments

Comments
 (0)