Class HDFSAvroImporter
java.lang.Object
com.Lomikel.Januser.JanusClient
com.astrolabsoftware.FinkBrowser.Avro.AvroImporter
com.astrolabsoftware.FinkBrowser.Avro.HDFSAvroImporter
- All Implemented Interfaces:
ModifyingGremlinClient
AvroImporter
imports Avro files from HDFS into JanusGraph.- Author:
- J.Hrivnac
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Import Avro files or directory.void
Process Avro alert file or directory with files (recursive).void
processDir
(String dirFN, String fileExt) Process directory with Avro alert files (recursive).void
processFile
(org.apache.hadoop.fs.Path path) Process Avro alert file .protected void
Write FITS file.Methods inherited from class com.astrolabsoftware.FinkBrowser.Avro.AvroImporter
close, fitsDir, hbaseUrl, n, now, processAlert, processFile, processPCA, processRecord, register, skip
Methods inherited from class com.Lomikel.Januser.JanusClient
commit, g, open, open, reopen, timer, timerStart
-
Field Details
-
_conf
-
_fs
-
log
Logging .
-
-
Constructor Details
-
HDFSAvroImporter
public HDFSAvroImporter(String properties, int reportLimit, int commitLimit, String strategy, String fitsDir, String hbaseUrl, String dataType) Create with JanusGraph properties file.- Parameters:
properties
- The file with the complete Janusgraph properties.reportLimit
- The number of events to use for progress report (-1 means no report untill the end).commitLimit
- The number of events to commit in one step (-1 means commit only at the end).strategy
- The creation strategy. dro If null, then considering as alert.p,replace,getOrCreate.fitsDir
- The directory for FITS files. If nullor empty, FITS are included in the Graph. Ignored if HBase url set.hbaseUrl
- The url for HBase table with full data as ip:port:table:schema. May be null or empty.dataType
- The data type, alert|pca. If null, then considering as alert.
-
-
Method Details
-
main
Import Avro files or directory.- Parameters:
args
- [0] The Janusgraph properties file.args
- [1] The Avro file or directory with Avro files.args
- [2] The directory for FITS files. If null or empty, FITS are included in the Graph. Ignored if HBase url set.args
- [3] The url for HBase table with full data as ip:port:table:schema. May be null or empty.args
- [4] The number of events to use for progress report (-1 means no report untill the end).args
- [5] The number of events to commit in one step (-1 means commit only at the end).args
- [6] The creation strategy. create,drop,replace,skip.args
- [7] The data type, alert|pca. If null, then considering as alert.- Throws:
LomikelException
- If anything goes wrong.IOException
-
processDir
Description copied from class:AvroImporter
Process directory with Avro alert files (recursive).- Overrides:
processDir
in classAvroImporter
- Parameters:
dirFN
- The dirname of directiory with data file.fileExt
- The file extention.- Throws:
IOException
- If problem with file reading.
-
process
Description copied from class:AvroImporter
Process Avro alert file or directory with files (recursive).- Overrides:
process
in classAvroImporter
- Parameters:
fn
- The filename of the data file or directory with files.- Throws:
IOException
- If problem with file reading.LomikelException
- If anything wrong.
-
processFile
Process Avro alert file .- Parameters:
path
- The data file.- Throws:
IOException
- If problem with file reading.
-
writeFits
Description copied from class:AvroImporter
Write FITS file.- Overrides:
writeFits
in classAvroImporter
- Parameters:
fn
- The FITS file name.data
- The FITS file content.
-