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 intprivate org.apache.hadoop.conf.Configurationprivate booleanprivate booleanprivate org.apache.hadoop.fs.FileSystemprivate GremlinRecipiesprivate intprivate booleanprivate intprivate booleanprivate static org.apache.logging.log4j.LoggerLogging . -
Constructor Summary
ConstructorsConstructorDescriptionParquetImporter(String properties, int reportLimit, int commitLimit, String strategy) Create with JanusGraph properties file. -
Method Summary
Modifier and TypeMethodDescriptionprivate LocalDateTimeint96toTimestamp(byte[] bytes) Transform timestamp from int96 toLocalDateTime.static voidImport Parquet files or directory.voidProcess Parquet alert file or directory with files (recursive).voidprocessDir(String dirFN, String fileExt) Process directory with Parquet alert files.processGroup(org.apache.parquet.example.data.Group g, String lbl) ProcessGroupand create containedVertexes with the specified label.private voidprivate StringChange label.private VertexCreate or drop aVertexaccording 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
ProcessGroupand create containedVertexes with the specified label. Runs recursively. -
vertex
Create or drop aVertexaccording 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.
-