metron-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cestella <...@git.apache.org>
Subject [GitHub] incubator-metron issue #432: METRON-682: Unify and Improve the Flat File Loa...
Date Wed, 01 Feb 2017 18:05:30 GMT
Github user cestella commented on the issue:

    https://github.com/apache/incubator-metron/pull/432
  
    # Testing Plan
    
    ## Preliminaries
    
    * Download the alexa 1m dataset:
    ```
    wget http://s3.amazonaws.com/alexa-static/top-1m.csv.zip
    unzip top-1m.csv.zip
    ```
    * Stage import files
    ```
    head -n 10000 top-1m.csv > top-10k.csv
    hadoop fs -put top-10k.csv /tmp
    head -n 10000 top-1m.csv | gzip - > top-10k.csv.gz
    head -n 10000 top-1m.csv | zip > top-10k.csv.zip
    ```
    * Create an extractor.json for the CSV data by editing `extractor.json` and pasting in
these contents:
    ```
    {
      "config" : {
        "columns" : {
           "domain" : 1,
           "rank" : 0
                    }
        ,"indicator_column" : "domain"
        ,"type" : "alexa"
        ,"separator" : ","
                 },
      "extractor" : "CSV"
    }
    ```
    
    ## Import from URL
    ```
    # truncate hbase
    echo "truncate 'enrichment'" | hbase shell
    # import data into hbase from URL.  This should take approximately 5 or 6 minutes
    /usr/metron/0.3.0/bin/flatfile_loader.sh -i http://s3.amazonaws.com/alexa-static/top-1m.csv.zip
-t enrichment -c t -e ./extractor.json -p 5 -b 128
    # count data written and verify it's 1M
    echo "count 'enrichment'" | hbase shell
    ```
    
    ## Import from local file (non-zipped)
    ```
    # truncate hbase
    echo "truncate 'enrichment'" | hbase shell
    # import data into hbase 
    /usr/metron/0.3.0/bin/flatfile_loader.sh -i ./top-10k.csv -t enrichment -c t -e ./extractor.json
-p 5 -b 128
    # count data written and verify it's 10k
    echo "count 'enrichment'" | hbase shell
    ```
    
    ## Import from local file (gzipped)
    ```
    # truncate hbase
    echo "truncate 'enrichment'" | hbase shell
    # import data into hbase 
    /usr/metron/0.3.0/bin/flatfile_loader.sh -i ./top-10k.csv.gz -t enrichment -c t -e ./extractor.json
-p 5 -b 128
    # count data written and verify it's 10k
    echo "count 'enrichment'" | hbase shell
    ```
    
    ## Import from local file (zipped)
    ```
    # truncate hbase
    echo "truncate 'enrichment'" | hbase shell
    # import data into hbase 
    /usr/metron/0.3.0/bin/flatfile_loader.sh -i ./top-10k.csv.zip -t enrichment -c t -e ./extractor.json
-p 5 -b 128
    # count data written and verify it's 10k
    echo "count 'enrichment'" | hbase shell
    ```
    
    ## Import from HDFS via MR
    ```
    # truncate hbase
    echo "truncate 'enrichment'" | hbase shell
    # import data into hbase 
    /usr/metron/0.3.0/bin/flatfile_loader.sh -i /tmp/top-10k.csv -t enrichment -c t -e ./extractor.json
-m MR
    # count data written and verify it's 10k
    echo "count 'enrichment'" | hbase shell
    ```



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message