Skip to content

Commit 04583dc

Browse files
authored
Merge pull request #32 from RADAR-base/release-0.5.0
Release 0.5.0
2 parents 84d3d2b + ab56b41 commit 04583dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3463
-1323
lines changed

.travis.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,21 @@ cache:
1212
- $HOME/.gradle/native
1313
- $HOME/.gradle/wrapper
1414

15+
before_install:
16+
- ./gradlew downloadDependencies
17+
1518
deploy:
16-
provider: releases
17-
api_key: ${GH_TOKEN}
18-
file_glob: true
19-
file: "build/libs/*.jar"
20-
skip_cleanup: true
21-
on:
22-
tags: true
19+
- provider: releases
20+
api_key: ${GH_TOKEN}
21+
file_glob: true
22+
file:
23+
- "build/libs/*.jar"
24+
skip_cleanup: true
25+
on:
26+
tags: true
27+
- provider: script
28+
script: ./gradlew bintrayUpload
29+
skip_cleanup: true
30+
on:
31+
tags: true
2332

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ COPY ./src /code/src
2929

3030
RUN ./gradlew jar
3131

32-
FROM openjdk:8-jre-alpine
32+
FROM smizy/hadoop-base:3.0.3-alpine
3333

3434
MAINTAINER Joris Borgdorff <[email protected]>
3535

3636
LABEL description="RADAR-base HDFS data restructuring"
3737

38+
ENV JAVA_OPTS -Djava.library.path=${HADOOP_HOME}/lib/native
39+
3840
COPY --from=builder /code/build/third-party/* /usr/lib/
3941
COPY --from=builder /code/build/scripts/* /usr/bin/
4042
COPY --from=builder /code/build/libs/* /usr/lib/

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Data streamed to HDFS using the [RADAR HDFS sink connector](https://github.com/R
88

99
This package is available as docker image [`radarbase/radar-hdfs-restructure`](https://hub.docker.com/r/radarbase/radar-hdfs-restructure). The entrypoint of the image is the current application. So in all of the commands listed in usage, replace `radar-hdfs-restructure` with for example:
1010
```shell
11-
docker run --rm -t --network hadoop -v "$PWD/output:/output" radarbase/radar-hdfs-restructure:0.4.0 -u hdfs://hdfs -o /output /myTopic
11+
docker run --rm -t --network hadoop -v "$PWD/output:/output" radarbase/radar-hdfs-restructure:0.5.0 -u hdfs://hdfs -o /output /myTopic
1212
```
1313
if your docker cluster is running in the `hadoop` network and your output directory should be `./output`.
1414

@@ -24,7 +24,7 @@ This package requires at least Java JDK 8. Build the distribution with
2424
and install the package into `/usr/local` with for example
2525
```shell
2626
sudo mkdir -p /usr/local
27-
sudo tar -xzf build/distributions/radar-hdfs-restructure-0.4.0.tar.gz -C /usr/local --strip-components=1
27+
sudo tar -xzf build/distributions/radar-hdfs-restructure-0.5.0.tar.gz -C /usr/local --strip-components=1
2828
```
2929

3030
Now the `radar-hdfs-restructure` command should be available.
@@ -59,4 +59,16 @@ radar-hdfs-restructure --compression gzip --hdfs-uri <webhdfs_url> --output-dir
5959

6060
By default, files records are not deduplicated after writing. To enable this behaviour, specify the option `--deduplicate` or `-d`. This set to false by default because of an issue with Biovotion data. Please see - [issue #16](https://github.com/RADAR-base/Restructure-HDFS-topic/issues/16) before enabling it.
6161

62-
Finally, while processing, files are staged to a temporary directory and moved to the output directory afterwards. This has the advantage of less chance of data corruption, but it may result in slower performance. Disable staging using the `--no-stage` option.
62+
## Extending the connector
63+
64+
To implement alternative storage paths, storage drivers or storage formats, put your custom JAR in
65+
`$APP_DIR/lib/radar-hdfs-plugins`. To load them, use the following options:
66+
67+
| Option | Class | Behaviour | Default |
68+
| ----------------------- | ------------------------------------------- | ------------------------------------------ | ------------------------- |
69+
| `--path-factory` | `org.radarcns.hdfs.RecordPathFactory` | Factory to create output path names with. | ObservationKeyPathFactory |
70+
| `--storage-driver` | `org.radarcns.hdfs.data.StorageDriver` | Storage driver to use for storing data. | LocalStorageDriver |
71+
| `--format-factory` | `org.radarcns.hdfs.data.FormatFactory` | Factory for output formats. | FormatFactory |
72+
| `--compression-factory` | `org.radarcns.hdfs.data.CompressionFactory` | Factory class to use for data compression. | CompressionFactory |
73+
74+
To pass arguments to self-assigned plugins, use `-p arg1=value1 -p arg2=value2` command-line flags and read those arguments in the `Plugin#init(Map<String, String>)` method.

build.gradle

Lines changed: 123 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,61 @@
1-
apply plugin: 'java'
2-
apply plugin: 'application'
1+
plugins {
2+
id 'java'
3+
id 'java-library'
4+
id 'application'
5+
id 'com.jfrog.bintray' version '1.8.1'
6+
id 'maven-publish'
7+
}
38

4-
group 'org.radarcns.restructurehdfs'
5-
version '0.4.0'
6-
mainClassName = 'org.radarcns.hdfs.RestructureAvroRecords'
9+
group 'org.radarcns'
10+
version '0.5.0'
11+
mainClassName = 'org.radarcns.hdfs.Application'
712

813
sourceCompatibility = '1.8'
914
targetCompatibility = '1.8'
1015

1116
ext {
17+
moduleDescription = 'RADAR HDFS restructuring'
18+
website = 'https://radar-base.org'
19+
githubRepoName = 'RADAR-base/Restructure-HDFS-topic'
20+
githubUrl = "https://github.com/${githubRepoName}"
21+
issueUrl = "${githubUrl}/issues"
22+
1223
avroVersion = '1.8.2'
1324
jacksonVersion = '2.9.6'
14-
hadoopVersion = '2.7.6'
25+
hadoopVersion = '3.0.3'
1526
jCommanderVersion = '1.72'
27+
almworksVersion = '1.1.1'
1628
}
1729

1830
repositories {
1931
jcenter()
2032
}
2133

2234
dependencies {
23-
implementation group: 'org.apache.avro', name: 'avro', version: avroVersion
35+
api group: 'org.apache.avro', name: 'avro', version: avroVersion
2436
implementation group: 'com.fasterxml.jackson.core' , name: 'jackson-databind', version: jacksonVersion
2537
implementation group: 'com.fasterxml.jackson.dataformat' , name: 'jackson-dataformat-csv', version: jacksonVersion
2638
implementation group: 'com.beust', name: 'jcommander', version: jCommanderVersion
39+
implementation group: 'com.almworks.integers', name: 'integers', version: almworksVersion
2740

2841
implementation group: 'org.apache.avro', name: 'avro-mapred', version: avroVersion
2942
implementation group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion
3043

31-
runtimeOnly group: 'org.apache.hadoop', name: 'hadoop-hdfs', version: hadoopVersion
44+
runtimeOnly group: 'org.apache.hadoop', name: 'hadoop-hdfs-client', version: hadoopVersion
3245

3346
testImplementation group: 'junit', name: 'junit', version: '4.12'
3447
}
3548

49+
ext.sharedManifest = manifest {
50+
attributes(
51+
"Implementation-Title": rootProject.name,
52+
"Implementation-Version": version)
53+
}
54+
3655
jar {
3756
manifest {
38-
attributes 'Implementation-Title': 'RADAR-base HDFS data restructuring',
39-
'Implementation-Version': version
57+
from sharedManifest
58+
attributes 'Main-Class': mainClassName
4059
}
4160
}
4261

@@ -50,6 +69,17 @@ distributions {
5069
}
5170
}
5271

72+
startScripts {
73+
classpath += files('lib/PlaceHolderForPluginPath')
74+
75+
doLast {
76+
def windowsScriptFile = file getWindowsScript()
77+
def unixScriptFile = file getUnixScript()
78+
windowsScriptFile.text = windowsScriptFile.text.replace('PlaceHolderForPluginPath', 'radar-hdfs-plugins\\*')
79+
unixScriptFile.text = unixScriptFile.text.replace('PlaceHolderForPluginPath', 'radar-hdfs-plugins/*')
80+
}
81+
}
82+
5383
tasks.withType(Tar){
5484
compression = Compression.GZIP
5585
extension = 'tar.gz'
@@ -66,6 +96,88 @@ task copyDependencies(type: Copy) {
6696
into "${buildDir}/third-party/"
6797
}
6898

99+
// custom tasks for creating source/javadoc jars
100+
task sourcesJar(type: Jar, dependsOn: classes) {
101+
classifier = 'sources'
102+
from sourceSets.main.allSource
103+
manifest.from sharedManifest
104+
}
105+
106+
task javadocJar(type: Jar, dependsOn: javadoc) {
107+
classifier = 'javadoc'
108+
from javadoc.destinationDir
109+
manifest.from sharedManifest
110+
}
111+
112+
publishing {
113+
publications {
114+
mavenJar(MavenPublication) {
115+
from components.java
116+
artifact sourcesJar
117+
artifact javadocJar
118+
pom {
119+
url = githubUrl as String
120+
description = moduleDescription
121+
122+
licenses {
123+
license {
124+
name = 'The Apache Software License, Version 2.0'
125+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
126+
distribution = 'repo'
127+
}
128+
}
129+
developers {
130+
developer {
131+
id = 'blootsvoets'
132+
name = 'Joris Borgdorff'
133+
134+
organization = 'The Hyve'
135+
}
136+
137+
}
138+
issueManagement {
139+
system = 'GitHub'
140+
url = issueUrl as String
141+
}
142+
organization {
143+
name = 'RADAR-base'
144+
url = website
145+
}
146+
scm {
147+
connection = "scm:git:${githubUrl}" as String
148+
url = githubUrl as String
149+
}
150+
}
151+
}
152+
}
153+
}
154+
155+
156+
bintray {
157+
user project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
158+
key project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
159+
override false
160+
publications 'mavenJar'
161+
pkg {
162+
repo = project.group
163+
name = rootProject.name
164+
userOrg = 'radar-cns'
165+
desc = moduleDescription
166+
licenses = ['Apache-2.0']
167+
websiteUrl = website
168+
issueTrackerUrl = issueUrl
169+
vcsUrl = githubUrl
170+
githubRepo = githubRepoName
171+
githubReleaseNotesFile = 'README.md'
172+
version {
173+
name = project.version
174+
desc = description
175+
vcsTag = System.getenv('TRAVIS_TAG')
176+
released = new Date()
177+
}
178+
}
179+
}
180+
69181
wrapper {
70-
gradleVersion '4.8'
182+
gradleVersion '4.9'
71183
}

gradle/wrapper/gradle-wrapper.jar

0 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-4.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
rootProject.name = 'radar-hdfs-restructure'
2+
enableFeaturePreview('STABLE_PUBLISHING')

0 commit comments

Comments
 (0)