Github user mmiklavc commented on a diff in the pull request:
https://github.com/apache/metron/pull/585#discussion_r116865536
--- Diff:
metron-platform/metron-pcap-backend/src/main/java/org/apache/metron/spout/pcap/PartitionHDFSWriter.java
---
@@ -102,14 +106,43 @@ public void sync(FSDataOutputStream input) throws
IOException {
private SyncHandler syncHandler;
private long batchStartTime;
private long numWritten;
+ private Configuration fsConfig = new Configuration();
public PartitionHDFSWriter(String topic, int partition, String uuid,
HDFSWriterConfig config) {
this.topic = topic;
this.partition = partition;
this.uuid = uuid;
this.config = config;
+
try {
- this.fs = FileSystem.get(new Configuration());
+ int replicationFactor = config.getReplicationFactor();
+ if (replicationFactor != -1) {
+ fsConfig.set("dfs.replication",
(String.valueOf(replicationFactor)));
+ }
+ if(config.getHDFSConfig() != null &&
!config.getHDFSConfig().isEmpty()) {
+ for(Map.Entry<String, Object> entry :
config.getHDFSConfig().entrySet()) {
+ if(entry.getValue() instanceof Integer) {
--- End diff --
String.valueOf() takes a primitive and we don't specifically know the type
of X in the incoming config map when calling fsConfig.setX (where X is a type,
e.g. Boolean, Integer, etc.).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---