embulk-output-hdfs 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc90ac0579a94f207537ad5106b3c733158a007b
|
|
4
|
+
data.tar.gz: 6cf1c80f825e7fdb6609c8a54d4db6546ec4414b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27a3f83d4299c8c8ea92a1710730987bbc444911872ba8b78d6e3d863fc6d8ae94c27ff3b70f580006e74cb5c3c0bb59739aaa342665caa9175a433885144a54
|
|
7
|
+
data.tar.gz: 6b5fe6fba56c2843072f8f6ede29d40964f4ec6b4c86a4b6318fad6ed1643e8d752ed46a107330a3ab798594e88cdbaa621e7f54acc74c439f7a8225c85ea321
|
data/CHANGELOG.md
ADDED
data/build.gradle
CHANGED
|
Binary file
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
package org.embulk.output.hdfs;
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import java.io.OutputStream;
|
|
6
|
-
import java.util.ArrayList;
|
|
7
|
-
import java.util.List;
|
|
8
|
-
import java.util.Map;
|
|
9
|
-
|
|
3
|
+
import com.google.common.base.Optional;
|
|
4
|
+
import com.google.common.base.Throwables;
|
|
10
5
|
import org.apache.hadoop.conf.Configuration;
|
|
11
6
|
import org.apache.hadoop.fs.FileSystem;
|
|
12
7
|
import org.apache.hadoop.fs.Path;
|
|
13
|
-
import org.embulk.config.TaskReport;
|
|
14
8
|
import org.embulk.config.Config;
|
|
15
9
|
import org.embulk.config.ConfigDefault;
|
|
16
10
|
import org.embulk.config.ConfigDiff;
|
|
17
11
|
import org.embulk.config.ConfigSource;
|
|
18
12
|
import org.embulk.config.Task;
|
|
13
|
+
import org.embulk.config.TaskReport;
|
|
19
14
|
import org.embulk.config.TaskSource;
|
|
20
15
|
import org.embulk.spi.Buffer;
|
|
21
16
|
import org.embulk.spi.Exec;
|
|
@@ -24,6 +19,14 @@ import org.embulk.spi.TransactionalFileOutput;
|
|
|
24
19
|
import org.jruby.embed.ScriptingContainer;
|
|
25
20
|
import org.slf4j.Logger;
|
|
26
21
|
|
|
22
|
+
import java.io.File;
|
|
23
|
+
import java.io.IOException;
|
|
24
|
+
import java.io.OutputStream;
|
|
25
|
+
import java.net.URI;
|
|
26
|
+
import java.util.ArrayList;
|
|
27
|
+
import java.util.List;
|
|
28
|
+
import java.util.Map;
|
|
29
|
+
|
|
27
30
|
public class HdfsFileOutputPlugin
|
|
28
31
|
implements FileOutputPlugin
|
|
29
32
|
{
|
|
@@ -58,6 +61,9 @@ public class HdfsFileOutputPlugin
|
|
|
58
61
|
@ConfigDefault("false")
|
|
59
62
|
public boolean getOverwrite();
|
|
60
63
|
|
|
64
|
+
@Config("doas")
|
|
65
|
+
@ConfigDefault("null")
|
|
66
|
+
public Optional<String> getDoas();
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
@Override
|
|
@@ -186,6 +192,15 @@ public class HdfsFileOutputPlugin
|
|
|
186
192
|
configuration.set(entry.getKey(), entry.getValue());
|
|
187
193
|
}
|
|
188
194
|
|
|
195
|
+
if (task.getDoas().isPresent()) {
|
|
196
|
+
URI uri = FileSystem.getDefaultUri(configuration);
|
|
197
|
+
try {
|
|
198
|
+
return FileSystem.get(uri, configuration, task.getDoas().get());
|
|
199
|
+
}
|
|
200
|
+
catch (InterruptedException e) {
|
|
201
|
+
throw Throwables.propagate(e);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
189
204
|
return FileSystem.get(configuration);
|
|
190
205
|
}
|
|
191
206
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: embulk-output-hdfs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Civitaspo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -46,6 +46,7 @@ extensions: []
|
|
|
46
46
|
extra_rdoc_files: []
|
|
47
47
|
files:
|
|
48
48
|
- .gitignore
|
|
49
|
+
- CHANGELOG.md
|
|
49
50
|
- LICENSE.txt
|
|
50
51
|
- README.md
|
|
51
52
|
- build.gradle
|
|
@@ -79,7 +80,7 @@ files:
|
|
|
79
80
|
- classpath/curator-client-2.6.0.jar
|
|
80
81
|
- classpath/curator-framework-2.6.0.jar
|
|
81
82
|
- classpath/curator-recipes-2.6.0.jar
|
|
82
|
-
- classpath/embulk-output-hdfs-0.2.
|
|
83
|
+
- classpath/embulk-output-hdfs-0.2.2.jar
|
|
83
84
|
- classpath/gson-2.2.4.jar
|
|
84
85
|
- classpath/hadoop-annotations-2.6.0.jar
|
|
85
86
|
- classpath/hadoop-auth-2.6.0.jar
|
|
Binary file
|