Class ParquetImporter
java.lang.Object
com.Lomikel.Januser.JanusClient
com.astrolabsoftware.FinkBrowser.Parquet.ParquetImporter
- All Implemented Interfaces:
ModifyingGremlinClient
ParquetImporter
imports Parquet files into JanusGraph.- Author:
- J.Hrivnac
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private org.apache.hadoop.conf.Configuration
private boolean
private boolean
private org.apache.hadoop.fs.FileSystem
private GremlinRecipies
private int
private boolean
private int
private boolean
private static org.apache.logging.log4j.Logger
Logging . -
Constructor Summary
ConstructorsConstructorDescriptionParquetImporter
(String properties, int reportLimit, int commitLimit, String strategy) Create with JanusGraph properties file. -
Method Summary
Modifier and TypeMethodDescriptionprivate LocalDateTime
int96toTimestamp
(byte[] bytes) Transform timestamp from int96 toLocalDateTime
.static void
Import Parquet files or directory.void
Process Parquet alert file or directory with files (recursive).void
processDir
(String dirFN, String fileExt) Process directory with Parquet alert files.processGroup
(org.apache.parquet.example.data.Group g, String lbl) ProcessGroup
and create containedVertex
es with the specified label.private void
private String
Change label.private Vertex
Create or drop aVertex
according to chosen strategy.Methods inherited from class com.Lomikel.Januser.JanusClient
close, commit, g, open, open, reopen, timer, timerStart
-
Field Details
-
VERTEXES
-
RELATIONS
-
IDS
-
_conf
-
_fs
-
_gr
-
_n
-
_reportLimit
-
_commitLimit
-
_create
-
_reuse
-
_replace
-
_drop
-
log
Logging .
-
-
Constructor Details
-
ParquetImporter
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 until the end).commitLimit
- The number of events to commit in one step (-1 means commit only at the end).strategy
- The creation strategy. drop,replace,getOrCreate.
-
-
Method Details
-
main
Import Parquet files or directory.- Parameters:
args
- [0] The Janusgraph properties file.args
- [1] The Parquet file or directory with Parquet files.args
- [2] The number of events to use for progress report (-1 means no report untill the end).args
- [3] The number of events to commit in one step (-1 means commit only at the end).args
- [4] The creation strategy. drop,replace,getOrCreate.- Throws:
LomikelException
- If anything goes wrong.IOException
-
processDir
Process directory with Parquet alert files.- Parameters:
dirFN
- The dirname of directiory with data file.fileExt
- The file extention.- Throws:
IOException
- If problem with file reading.FileNotFoundException
- If problem with file founding.
-
process
Process Parquet alert file or directory with files (recursive).- Parameters:
fn
- The filename of the data file or directory with files.- Throws:
IOException
- If problem with file reading.LomikelException
- If anything wrong.
-
processGroup
ProcessGroup
and create containedVertex
es with the specified label. Runs recursively. -
vertex
Create or drop aVertex
according to chosen strategy. -
registerVertices
-
reLabel
Change label.- Parameters:
label
- The original label.- Returns:
- The changed label.
-
int96toTimestamp
Transform timestamp from int96 toLocalDateTime
.- Parameters:
bytes
- The timestamp of int96 bytes.- Returns:
- The timestamp converted to
LocalDateTime
.
-