[
https://issues.apache.org/jira/browse/METRON-682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15852132#comment-15852132
]
ASF GitHub Bot commented on METRON-682:
---------------------------------------
Github user mmiklavc commented on a diff in the pull request:
https://github.com/apache/incubator-metron/pull/432#discussion_r99421627
--- Diff:
metron-platform/metron-data-management/src/main/java/org/apache/metron/dataloads/nonbulk/flatfile/importer/MapReduceImporter.java
---
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.metron.dataloads.nonbulk.flatfile.importer;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.hadoop.hbase.mapreduce.TableOutputFormat;
+import org.apache.hadoop.mapreduce.Job;
+import org.apache.metron.dataloads.extractor.ExtractorHandler;
+import org.apache.metron.dataloads.hbase.mr.BulkLoadMapper;
+import org.apache.metron.dataloads.nonbulk.flatfile.LoadOptions;
+import org.apache.metron.enrichment.converter.EnrichmentConverter;
+
+import java.io.IOException;
+import java.util.EnumMap;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+
+public enum MapReduceImporter implements Importer{
+ INSTANCE
+ ;
+
+ @Override
+ public void importData(EnumMap<LoadOptions, Optional<Object>> config
+ , ExtractorHandler handler
+ , Configuration hadoopConfig
+ ) throws IOException {
+ String table = (String) config.get(LoadOptions.HBASE_TABLE).get();
+ String cf = (String) config.get(LoadOptions.HBASE_CF).get();
+ String extractorConfigContents = (String)
config.get(LoadOptions.EXTRACTOR_CONFIG).get();
+ Job job = Job.getInstance(hadoopConfig);
+ List<String> inputs = (List<String>)
config.get(LoadOptions.INPUT).get();
+ job.setJobName("MapReduceImporter: " +
inputs.stream().collect(Collectors.joining(",")) + " => " + table + ":" + cf);
+ System.out.println("Configuring " + job.getJobName());
--- End diff --
Why system out instead of a logger?
> Unify and Improve the Flat File Loader
> --------------------------------------
>
> Key: METRON-682
> URL: https://issues.apache.org/jira/browse/METRON-682
> Project: Metron
> Issue Type: Improvement
> Reporter: Casey Stella
>
> Currently the flat file loader is deficient in a couple ways:
> * It only supports importing local data despite there being a separate,
> poorly named, application which supports importing enrichment via MapReduce
> called threat_intel_loader.sh
> * It does not support local imports from HDFS
> * It does not support local imports from URLs
> * It does not support importing zipped archives locally
> * You cannot import more than one file at once
> This JIRA will:
> * Unify the MapReduce and local imports into one program and allow the user
> to specify the import mode with a CLI flag
> * Support local imports from HDFS and URLs
> * Support local imports from zipped files
> * Support importing more than one file at once
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)