Skip to content

Commit be17421

Browse files
author
Dai MIKURUBE
committed
Update to Embulk v0.10.18, and not to depend on "embulk-core"
Along with Embulk v0.10.18, * Change the Maven artifact group name to "org.embulk" * Update the version to "0.5.0-SNAPSHOT" * Update org.embulk:embulk-util-config to "0.1.3" to use its newConfigDiff and newTaskReport * Use org.embulk:embulk-util-retryhelper instead of org.embulk.spi.util.RetryExecutor * Use org.embulk:embulk-util-file instead of org.embulk.spi.util.* * Remove use of commons-lang3
1 parent 8fa1d9c commit be17421

File tree

16 files changed

+102
-99
lines changed

16 files changed

+102
-99
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
embulk-input-s3 v0.3.0+ requires Embulk v0.9.12+
5+
embulk-input-s3 v0.5.0+ requires Embulk v0.9.23+
66

77
* Plugin type: **file input**
88
* Resume supported: **yes**

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ plugins {
77
id "org.embulk.embulk-plugins" version "0.4.2" apply false
88
}
99

10-
group = "org.embulk.input.s3"
11-
version = "0.4.1-SNAPSHOT"
10+
group = "org.embulk"
11+
version = "0.5.0-SNAPSHOT"
1212

1313
allprojects {
1414
apply plugin: "java"

embulk-input-riak_cs/build.gradle

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ repositories {
1010
}
1111

1212
dependencies {
13-
compileOnly "org.embulk:embulk-api:0.10.5"
14-
compileOnly "org.embulk:embulk-core:0.10.5"
13+
compileOnly "org.embulk:embulk-api:0.10.18"
14+
compileOnly "org.embulk:embulk-spi:0.10.18"
15+
// No longer need to depend on "embulk-core"!
1516

1617
compile(project(":embulk-input-s3")) {
1718
// They conflict with embulk-core. They are once excluded here,
18-
// and added explicitly with versions exactly the same with embulk-core:0.10.5.
19+
// and added explicitly with versions exactly the same with embulk-core:0.10.18.
1920
exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
2021
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
2122
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
@@ -25,7 +26,7 @@ dependencies {
2526
}
2627

2728
// They are once excluded from transitive dependencies of other dependencies,
28-
// and added explicitly with versions exactly the same with embulk-core:0.10.5.
29+
// and added explicitly with versions exactly the same with embulk-core:0.10.18.
2930
compile "com.fasterxml.jackson.core:jackson-annotations:2.6.7"
3031
compile "com.fasterxml.jackson.core:jackson-core:2.6.7"
3132
compile "com.fasterxml.jackson.core:jackson-databind:2.6.7"
@@ -35,31 +36,20 @@ dependencies {
3536

3637
testCompile "junit:junit:4.13"
3738
testCompile "org.mockito:mockito-core:1.10.19"
38-
testCompile "org.embulk:embulk-api:0.10.5"
39-
testCompile "org.embulk:embulk-core:0.10.5"
40-
testCompile "org.embulk:embulk-core:0.10.5:tests"
41-
testCompile "org.embulk:embulk-deps-buffer:0.10.5"
42-
testCompile "org.embulk:embulk-deps-config:0.10.5"
43-
testCompile "org.embulk:embulk-deps-timestamp:0.10.5"
44-
testCompile "org.embulk:embulk-standards:0.10.5"
39+
testCompile "org.embulk:embulk-api:0.10.18"
40+
testCompile "org.embulk:embulk-spi:0.10.18"
41+
testCompile "org.embulk:embulk-core:0.10.18"
42+
testCompile "org.embulk:embulk-core:0.10.18:tests"
43+
testCompile "org.embulk:embulk-deps:0.10.18"
44+
testCompile "org.embulk:embulk-standards:0.10.18"
4545
testCompile project(":embulk-input-s3").sourceSets.test.output
4646
}
4747

4848
embulkPlugin {
4949
mainClass = "org.embulk.input.riak_cs.RiakCsFileInputPlugin"
5050
category = "input"
5151
type = "riak_cs"
52-
ignoreConflicts = [
53-
// They conflict with embulk-core:0.10.5, but embulk-core will remove them from its dependencies.
54-
// They are intentionally included in the plugin's dependencies to keep it working before and after the removal.
55-
// Warning messages against them are marked to ignore explicitly here.
56-
[ group: "com.fasterxml.jackson.core", module: "jackson-annotations" ],
57-
[ group: "com.fasterxml.jackson.core", module: "jackson-core" ],
58-
[ group: "com.fasterxml.jackson.core", module: "jackson-databind" ],
59-
[ group: "com.fasterxml.jackson.datatype", module: "jackson-datatype-jdk8" ],
60-
[ group: "javax.validation", module: "validation-api" ],
61-
[ group: "joda-time", module: "joda-time" ],
62-
]
52+
// "ignoreConflicts" is no longer needed because this plugin depends only on "embulk-api" and "embulk-spi".
6353
}
6454

6555
gem {

embulk-input-riak_cs/gradle/dependency-locks/embulkPluginRuntime.lockfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ joda-time:joda-time:2.9.2
1717
org.apache.httpcomponents:httpclient:4.5.5
1818
org.apache.httpcomponents:httpcore:4.4.9
1919
org.embulk:embulk-util-aws-credentials:0.4.0
20-
org.embulk:embulk-util-config:0.1.1
20+
org.embulk:embulk-util-config:0.1.3
21+
org.embulk:embulk-util-file:0.1.1
22+
org.embulk:embulk-util-retryhelper:0.8.0
2123
org.slf4j:jcl-over-slf4j:1.7.12
2224
software.amazon.ion:ion-java:1.0.2

embulk-input-s3/build.gradle

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ repositories {
1010
}
1111

1212
dependencies {
13-
compileOnly "org.embulk:embulk-api:0.10.5"
14-
compileOnly "org.embulk:embulk-core:0.10.5"
13+
compileOnly "org.embulk:embulk-api:0.10.18"
14+
compileOnly "org.embulk:embulk-spi:0.10.18"
1515

1616
compile("com.amazonaws:aws-java-sdk-s3:1.11.466") {
1717
// They conflict with embulk-core. They are once excluded here,
18-
// and added explicitly with versions exactly the same with embulk-core:0.10.5.
18+
// and added explicitly with versions exactly the same with embulk-core:0.10.18.
1919
exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
2020
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
2121
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
@@ -27,7 +27,7 @@ dependencies {
2727

2828
compile("com.amazonaws:aws-java-sdk-sts:1.11.466") {
2929
// They conflict with embulk-core. They are once excluded here,
30-
// and added explicitly with versions exactly the same with embulk-core:0.10.5.
30+
// and added explicitly with versions exactly the same with embulk-core:0.10.18.
3131
exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
3232
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
3333
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
@@ -45,9 +45,13 @@ dependencies {
4545
exclude group: "org.slf4j", module: "slf4j-api"
4646
}
4747

48+
compile "org.embulk:embulk-util-retryhelper:0.8.0"
49+
50+
compile "org.embulk:embulk-util-file:0.1.1"
51+
4852
compile("org.embulk:embulk-util-aws-credentials:0.4.0") {
4953
// They conflict with embulk-core. They are once excluded here,
50-
// and added explicitly with versions exactly the same with embulk-core:0.10.5.
54+
// and added explicitly with versions exactly the same with embulk-core:0.10.18.
5155
exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
5256
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
5357
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
@@ -56,8 +60,18 @@ dependencies {
5660
exclude group: "joda-time", module: "joda-time"
5761
}
5862

63+
compile("org.embulk:embulk-util-config:0.1.3") {
64+
// They conflict with embulk-core. They are once excluded here,
65+
// and added explicitly with versions exactly the same with embulk-core:0.10.18.
66+
exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
67+
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
68+
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
69+
exclude group: "com.fasterxml.jackson.datatype", module: "jackson-datatype-jdk8"
70+
exclude group: "javax.validation", module: "validation-api"
71+
}
72+
5973
// They are once excluded from transitive dependencies of other dependencies,
60-
// and added explicitly with versions exactly the same with embulk-core:0.10.5.
74+
// and added explicitly with versions exactly the same with embulk-core:0.10.18.
6175
compile "com.fasterxml.jackson.core:jackson-annotations:2.6.7"
6276
compile "com.fasterxml.jackson.core:jackson-core:2.6.7"
6377
compile "com.fasterxml.jackson.core:jackson-databind:2.6.7"
@@ -67,30 +81,19 @@ dependencies {
6781

6882
testCompile "junit:junit:4.13"
6983
testCompile "org.mockito:mockito-core:1.10.19"
70-
testCompile "org.embulk:embulk-api:0.10.5"
71-
testCompile "org.embulk:embulk-core:0.10.5"
72-
testCompile "org.embulk:embulk-core:0.10.5:tests"
73-
testCompile "org.embulk:embulk-deps-buffer:0.10.5"
74-
testCompile "org.embulk:embulk-deps-config:0.10.5"
75-
testCompile "org.embulk:embulk-deps-timestamp:0.10.5"
76-
testCompile "org.embulk:embulk-standards:0.10.5"
84+
testCompile "org.embulk:embulk-api:0.10.18"
85+
testCompile "org.embulk:embulk-spi:0.10.18"
86+
testCompile "org.embulk:embulk-core:0.10.18"
87+
testCompile "org.embulk:embulk-core:0.10.18:tests"
88+
testCompile "org.embulk:embulk-deps:0.10.18"
89+
testCompile "org.embulk:embulk-standards:0.10.18"
7790
}
7891

7992
embulkPlugin {
8093
mainClass = "org.embulk.input.s3.S3FileInputPlugin"
8194
category = "input"
8295
type = "s3"
83-
ignoreConflicts = [
84-
// They conflict with embulk-core:0.10.5, but embulk-core will remove them from its dependencies.
85-
// They are intentionally included in the plugin's dependencies to keep it working before and after the removal.
86-
// Warning messages against them are marked to ignore explicitly here.
87-
[ group: "com.fasterxml.jackson.core", module: "jackson-annotations" ],
88-
[ group: "com.fasterxml.jackson.core", module: "jackson-core" ],
89-
[ group: "com.fasterxml.jackson.core", module: "jackson-databind" ],
90-
[ group: "com.fasterxml.jackson.datatype", module: "jackson-datatype-jdk8" ],
91-
[ group: "javax.validation", module: "validation-api" ],
92-
[ group: "joda-time", module: "joda-time" ],
93-
]
96+
// "ignoreConflicts" is no longer needed because this plugin depends only on "embulk-api" and "embulk-spi".
9497
}
9598

9699
gem {

embulk-input-s3/gradle/dependency-locks/embulkPluginRuntime.lockfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ joda-time:joda-time:2.9.2
1717
org.apache.httpcomponents:httpclient:4.5.5
1818
org.apache.httpcomponents:httpcore:4.4.9
1919
org.embulk:embulk-util-aws-credentials:0.4.0
20-
org.embulk:embulk-util-config:0.1.1
20+
org.embulk:embulk-util-config:0.1.3
21+
org.embulk:embulk-util-file:0.1.1
22+
org.embulk:embulk-util-retryhelper:0.8.0
2123
org.slf4j:jcl-over-slf4j:1.7.12
2224
software.amazon.ion:ion-java:1.0.2

embulk-input-s3/src/main/java/org/embulk/input/s3/AbstractS3FileInputPlugin.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838
import org.embulk.spi.Exec;
3939
import org.embulk.spi.FileInputPlugin;
4040
import org.embulk.spi.TransactionalFileInput;
41-
import org.embulk.spi.util.InputStreamFileInput;
42-
import org.embulk.spi.util.InputStreamFileInput.InputStreamWithHints;
43-
import org.embulk.spi.util.ResumableInputStream;
44-
import org.embulk.spi.util.RetryExecutor;
4541
import org.embulk.util.aws.credentials.AwsCredentials;
4642
import org.embulk.util.aws.credentials.AwsCredentialsTask;
4743
import org.embulk.util.config.Config;
@@ -50,6 +46,9 @@
5046
import org.embulk.util.config.ConfigMapperFactory;
5147
import org.embulk.util.config.Task;
5248
import org.embulk.util.config.TaskMapper;
49+
import org.embulk.util.file.InputStreamFileInput;
50+
import org.embulk.util.file.ResumableInputStream;
51+
import org.embulk.util.retryhelper.RetryExecutor;
5352
import org.slf4j.Logger;
5453
import org.slf4j.LoggerFactory;
5554

@@ -63,7 +62,6 @@
6362
import java.util.Optional;
6463

6564
import static java.lang.String.format;
66-
import static org.embulk.spi.util.RetryExecutor.retryExecutor;
6765

6866
public abstract class AbstractS3FileInputPlugin
6967
implements FileInputPlugin
@@ -169,7 +167,7 @@ public ConfigDiff resume(TaskSource taskSource,
169167
control.run(taskSource, taskCount);
170168

171169
// build next config
172-
ConfigDiff configDiff = Exec.newConfigDiff();
170+
ConfigDiff configDiff = CONFIG_MAPPER_FACTORY.newConfigDiff();
173171

174172
// last_path
175173
if (task.getIncremental()) {
@@ -273,10 +271,11 @@ private void setHttpProxyInAwsClient(ClientConfiguration clientConfig, HttpProxy
273271
*/
274272
private static RetryExecutor retryExecutorFrom(RetrySupportPluginTask task)
275273
{
276-
return retryExecutor()
274+
return RetryExecutor.builder()
277275
.withRetryLimit(task.getMaximumRetries())
278-
.withInitialRetryWait(task.getInitialRetryIntervalMillis())
279-
.withMaxRetryWait(task.getMaximumRetryIntervalMillis());
276+
.withInitialRetryWaitMillis(task.getInitialRetryIntervalMillis())
277+
.withMaxRetryWaitMillis(task.getMaximumRetryIntervalMillis())
278+
.build();
280279
}
281280

282281
private FileList listFiles(final PluginTask task)
@@ -408,7 +407,7 @@ public void abort()
408407

409408
public TaskReport commit()
410409
{
411-
return Exec.newTaskReport();
410+
return CONFIG_MAPPER_FACTORY.newTaskReport();
412411
}
413412

414413
@Override
@@ -442,7 +441,7 @@ public SingleFileProvider(PluginTask task, int taskIndex)
442441
}
443442

444443
@Override
445-
public InputStreamWithHints openNextWithHints() throws IOException
444+
public InputStreamFileInput.InputStreamWithHints openNextWithHints() throws IOException
446445
{
447446
if (!iterator.hasNext()) {
448447
return null;
@@ -463,7 +462,7 @@ public S3Object call()
463462
// Keep it for now but might be removed in the future.
464463
LOGGER.info("Open S3Object with bucket [{}], key [{}], with size [{}]", bucket, key, objectSize);
465464
InputStream inputStream = new ResumableInputStream(object.getObjectContent(), new S3InputStreamReopener(client, request, objectSize, retryExec));
466-
return new InputStreamWithHints(inputStream, String.format("s3://%s/%s", bucket, key));
465+
return new InputStreamFileInput.InputStreamWithHints(inputStream, String.format("s3://%s/%s", bucket, key));
467466
}
468467

469468
@Override

embulk-input-s3/src/main/java/org/embulk/input/s3/DefaultRetryable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
import com.amazonaws.AmazonServiceException;
2020
import org.apache.http.HttpStatus;
21-
import org.embulk.spi.util.RetryExecutor;
21+
import org.embulk.util.retryhelper.RetryExecutor;
22+
import org.embulk.util.retryhelper.RetryGiveupException;
23+
import org.embulk.util.retryhelper.Retryable;
2224
import org.slf4j.Logger;
2325
import org.slf4j.LoggerFactory;
2426

@@ -27,8 +29,6 @@
2729
import java.util.concurrent.Callable;
2830

2931
import static java.lang.String.format;
30-
import static org.embulk.spi.util.RetryExecutor.RetryGiveupException;
31-
import static org.embulk.spi.util.RetryExecutor.Retryable;
3232

3333
/**
3434
* Retryable utility, regardless the occurred exceptions,

embulk-input-s3/src/main/java/org/embulk/input/s3/explorer/S3FileExplorer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import com.amazonaws.services.s3.AmazonS3;
2020
import org.embulk.input.s3.FileList;
21-
import org.embulk.spi.util.RetryExecutor;
21+
import org.embulk.util.retryhelper.RetryExecutor;
2222

2323
public abstract class S3FileExplorer
2424
{

embulk-input-s3/src/main/java/org/embulk/input/s3/explorer/S3NameOrderPrefixFileExplorer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.amazonaws.services.s3.model.ObjectListing;
2222
import com.amazonaws.services.s3.model.S3ObjectSummary;
2323
import org.embulk.input.s3.DefaultRetryable;
24-
import org.embulk.spi.util.RetryExecutor;
24+
import org.embulk.util.retryhelper.RetryExecutor;
2525

2626
import java.util.List;
2727

0 commit comments

Comments
 (0)