public abstract class OraclePropertyGraphUtilsBase
extends java.lang.Object
implements oracle.pg.common.messages.MesgConsts
ERR_ARG_CANNOT_BE_NULL, ERR_CODE_NOT_IN_LIST, ERR_DOP_CONSTRAINT, ERR_E_AUTO_IDX_MUST_SOLR_OR_LUCENE, ERR_E_AUTO_IDX_NOT_EXIST, ERR_E_DS_MUSTBE_FILE_OR_IS, ERR_E_MAX_LINE_CONSTRAINT, ERR_EDGE_DIR_NOT_BOTH, ERR_EDGE_WORK_TBL_NOT_CLEAN, ERR_GRAPH_NAME_CANT_BENULL, ERR_HIT_EXCEPTION, ERR_HIT_INTERRUPT, ERR_HIT_IO, ERR_HIT_OPGE, ERR_HIT_PARSEE, ERR_ID_CANNOT_BE_NULL, ERR_IDX_KEY_CANNOT_BE_NULL, ERR_IDX_KEY_NOT_NULL, ERR_IDX_KEYS_NOT_NULL, ERR_IN_DS_EDGE_CANTBE_NULL, ERR_IN_DS_VERT_CANTBE_NULL, ERR_IN_E_FLAT_DOESNT_EXIST, ERR_IN_V_FLAT_DOESNT_EXIST, ERR_INPUT_LIST_NOT_NULL, ERR_INPUT_NOT_NULL, ERR_INVALID_CHANGE_ACTION, ERR_INVALID_NUM_FIELDS, ERR_INVALID_NUM_NOARG, ERR_INVALID_NUMBER, ERR_INVALID_VAL, ERR_KEY_CANNOT_BE_ID, ERR_KEY_CANNOT_BE_NULL, ERR_KEY_CANNOT_BE_NULL_EMPTY, ERR_KEY_NOT_SET_TO, ERR_NO_ELEM_TO_BE_CONSUMED, ERR_NO_OP_SUPPORTED, ERR_NOT_IMPLEMENTED_YET, ERR_NOT_ORACLE_V_E, ERR_NUM_PART_CONSTRAINT, ERR_OFFSET_CONSTRAINT, ERR_OFFSET_E_MUST_BE_POS, ERR_OFFSET_V_MUST_BE_POS, ERR_OPT_FLAG_EDGE_INVALID, ERR_OPT_FLAG_VERT_INVALID, ERR_ORA_TEXT_INVALID_KEY, ERR_ORA_TEXT_ONLY_AUTO, ERR_OUTPUT_LIST_NOT_NULL, ERR_PG_ALREADY_EXISTS, ERR_PG_NOT_EMPTY, ERR_PG_NOT_NULL, ERR_SIZE_MUST_BE_POS, ERR_TIMEOUT_TAB_CREATION, ERR_TXT_IDX_NOT_FOUND, ERR_TYPE_ID_NOT_RECO, ERR_UNSUPPORTED_VAL_TYP, ERR_USER_REQ_OP_CANCEL, ERR_V_AUTO_IDX_MUST_SOLR_OR_LUCENE, ERR_V_AUTO_IDX_NOT_EXIST, ERR_V_DS_MUSTBE_FILE_OR_IS, ERR_V_MAX_LINE_CONSTRAINT, ERR_VALUE_CANNOT_BE_NULL, INFO_EMP_K_NO_P_VAL, INFO_NUL_K_NO_P_VAL
Constructor and Description |
---|
OraclePropertyGraphUtilsBase() |
Modifier and Type | Method and Description |
---|---|
static oracle.jdbc.OracleConnection |
castAsOracleConnection(java.sql.Connection connection)
Cast a java.sql.Connection object into an OracleConnection object
|
static java.lang.Object |
castRDBMSObject(java.lang.Object obj,
java.lang.Class dtClass) |
static Direction |
castTinkerpop23Direction(com.tinkerpop.blueprints.Direction tp23Direction)
Cast a Tinkerpop 2.3 Direction object to a Tinkerpop 3.X Direction object.
|
static com.tinkerpop.blueprints.Direction |
castToTinkerpop23Direction(Direction tp30Direction)
Cast a Tinkerpop 3.X Direction object to a Tinkerpop 2.3 Direction object.
|
static boolean |
compareFiles(java.lang.String szSrcFile,
java.lang.String szDstFile)
Compare the content of two files contents against each other.
|
static boolean |
compareValueObjects(java.lang.Object obj,
java.lang.Object obj1)
Compares two value objects
|
static void |
convertCSV2OPE(java.io.InputStream inCSV,
java.lang.String eidColName,
long lOffsetEID,
java.lang.String svidColName,
java.lang.String dvidColName,
boolean hasEdgeLabelCol,
java.lang.String elColName,
ColumnToAttrMapping[] ctams,
int dop,
char delimiterChar,
char quotationChar,
long lOffsetLines,
java.text.DateFormat dateFormat,
boolean allowMultiline,
java.io.OutputStream opeOS,
DataConverterListener dcl)
Converts a property graph file for edges in CSV format into Oracle Flat
File format.
|
static void |
convertCSV2OPE(java.io.InputStream inCSV,
java.lang.String eidColName,
long lOffsetEID,
java.lang.String svidColName,
java.lang.String dvidColName,
boolean hasEdgeLabelCol,
java.lang.String elColName,
ColumnToAttrMapping[] ctams,
int dop,
char delimiterChar,
char quotationChar,
long lOffsetLines,
java.text.DateFormat dateFormat,
java.io.OutputStream opeOS,
DataConverterListener dcl)
Converts a property graph file for edges in CSV format into Oracle Flat
File format.
|
static void |
convertCSV2OPE(java.io.InputStream inCSV,
java.lang.String eidColName,
long lOffsetEID,
java.lang.String svidColName,
java.lang.String dvidColName,
boolean hasEdgeLabelCol,
java.lang.String elColName,
ColumnToAttrMapping[] ctams,
int dop,
long lOffsetLines,
java.text.DateFormat dateFormat,
java.io.OutputStream opeOS,
DataConverterListener dcl)
Converts a property graph file for edges in CSV format into Oracle Flat
File format.
|
static void |
convertCSV2OPE(java.io.InputStream inCSV,
java.lang.String eidColName,
long lOffsetEID,
java.lang.String svidColName,
java.lang.String dvidColName,
boolean hasEdgeLabelCol,
java.lang.String elColName,
ColumnToAttrMapping[] ctams,
int dop,
long lOffsetLines,
java.io.OutputStream opeOS,
DataConverterListener dcl)
Converts a property graph file for edges in CSV format into Oracle Flat
File format.
|
static void |
convertCSV2OPE(java.io.InputStream inCSV,
java.lang.String eidColName,
long lOffsetEID,
java.lang.String svidColName,
java.lang.String dvidColName,
long lOffsetVID,
boolean hasEdgeLabelCol,
java.lang.String elColName,
ColumnToAttrMapping[] ctams,
int dop,
char delimiterChar,
char quotationChar,
long lOffsetLines,
java.text.DateFormat dateFormat,
boolean allowMultiline,
java.io.OutputStream opeOS,
DataConverterListener dcl)
Converts a property graph file for edges in CSV format into Oracle Flat
File format.
|
static void |
convertCSV2OPE(java.io.InputStream inCSV,
java.lang.String eidColName,
long lOffsetEID,
java.lang.String svidColName,
java.lang.String dvidColName,
long lOffsetSVID,
long lOffsetDVID,
boolean hasEdgeLabelCol,
java.lang.String elColName,
ColumnToAttrMapping[] ctams,
int dop,
char delimiterChar,
char quotationChar,
long lOffsetLines,
java.text.DateFormat dateFormat,
boolean allowMultiline,
java.io.OutputStream opeOS,
DataConverterListener dcl)
Converts a property graph file for edges in CSV format into Oracle Flat
File format.
|
static void |
convertCSV2OPV(java.io.InputStream inCSV,
java.lang.String vidColName,
long lOffsetVID,
ColumnToAttrMapping[] ctams,
int dop,
char delimiterChar,
char quotationChar,
long lOffsetLines,
java.text.DateFormat dateFormat,
boolean allowMultiline,
java.io.OutputStream opvOS,
DataConverterListener dcl)
Converts a property graph file for vertices in CSV format into Oracle Flat
File format using the specified delimiters.
|
static void |
convertCSV2OPV(java.io.InputStream inCSV,
java.lang.String vidColName,
long lOffsetVID,
ColumnToAttrMapping[] ctams,
int dop,
char delimiterChar,
char quotationChar,
long lOffsetLines,
java.text.DateFormat dateFormat,
java.io.OutputStream opvOS,
DataConverterListener dcl)
Converts a property graph file for vertices in CSV format into Oracle Flat
File format using the specified delimiters.
|
static void |
convertCSV2OPV(java.io.InputStream inCSV,
java.lang.String vidColName,
long lOffsetVID,
ColumnToAttrMapping[] ctams,
int dop,
long lOffsetLines,
java.text.DateFormat dateFormat,
java.io.OutputStream opvOS,
DataConverterListener dcl)
Converts a property graph file for vertices in CSV format into Oracle Flat
File format using the specified delimiters.
|
static void |
convertCSV2OPV(java.io.InputStream inCSV,
java.lang.String vidColName,
long lOffsetVID,
ColumnToAttrMapping[] ctams,
int dop,
long lOffsetLines,
java.io.OutputStream opvOS,
DataConverterListener dcl)
Converts a property graph file for vertices in CSV format into Oracle Flat
File format using the specified delimiters.
|
static void |
convertRDBMSTable2OPE(java.sql.Connection conn,
java.lang.String rdbmsTableName,
java.lang.String eidColName,
long lEIDOffset,
java.lang.String svidColName,
java.lang.String dvidColName,
long lVIDOffset,
boolean bHasEdgeLabelCol,
java.lang.String elColName,
ColumnToAttrMapping[] ctams,
int dop,
java.io.OutputStream opeOS,
DataConverterListener dcl)
This method converts given rdbms table to a ope file
|
static void |
convertRDBMSTable2OPE(java.sql.Connection conn,
java.lang.String rdbmsTableName,
java.lang.String eidColName,
long lEIDOffset,
java.lang.String svidColName,
java.lang.String dvidColName,
long lVIDOffset,
boolean bHasEdgeLabelCol,
java.lang.String elColName,
ColumnToAttrMapping[] ctams,
int dop,
java.io.OutputStream opeOS,
DataConverterListener dcl,
BackendConfig bc)
This method converts given rdbms table to a ope file
|
static void |
convertRDBMSTable2OPE(java.sql.Connection conn,
java.lang.String rdbmsTableName,
java.lang.String eidColName,
long lEIDOffset,
java.lang.String svidColName,
java.lang.String dvidColName,
long lSVIDOffset,
long lDVIDOffset,
boolean bHasEdgeLabelCol,
java.lang.String elColName,
ColumnToAttrMapping[] ctams,
int dop,
java.io.OutputStream opeOS,
DataConverterListener dcl)
This method converts given rdbms table to a ope file
|
static void |
convertRDBMSTable2OPE(java.sql.Connection conn,
java.lang.String rdbmsTableName,
java.lang.String eidColName,
long lEIDOffset,
java.lang.String svidColName,
java.lang.String dvidColName,
long lSVIDOffset,
long lDVIDOffset,
boolean bHasEdgeLabelCol,
java.lang.String elColName,
ColumnToAttrMapping[] ctams,
int dop,
java.io.OutputStream opeOS,
DataConverterListener dcl,
BackendConfig bc)
This method converts given rdbms table to a ope file
|
static void |
convertRDBMSTable2OPV(java.sql.Connection conn,
java.lang.String rdbmsTableName,
java.lang.String vidColName,
long lVIDOffset,
ColumnToAttrMapping[] ctams,
int dop,
java.io.OutputStream opvOS,
DataConverterListener dcl)
Converts given rdbms table to a opv file.
|
static void |
convertRDBMSTable2OPV(java.sql.Connection conn,
java.lang.String rdbmsTableName,
java.lang.String vidColName,
long lVIDOffset,
ColumnToAttrMapping[] ctams,
int dop,
java.io.OutputStream opvOS,
DataConverterListener dcl,
BackendConfig bc)
Converts given rdbms table to a opv file.
|
static byte[] |
escape(java.lang.String s)
Escapes a string into the required Oracle flat file format.
|
static void |
exportEdges(java.util.Iterator<com.tinkerpop.blueprints.Edge>[] itEdgeArray,
java.io.OutputStream osEdge)
This function exports a given edges into the output stream using Oracle
flat-file format.
|
static void |
exportFlatFiles(OraclePropertyGraphBase pg,
java.io.OutputStream osVertex,
java.io.OutputStream osEdge,
int dop,
boolean append)
This function exports a given property graph into two flat files: one
for vertices and the other for edges.
|
static void |
exportFlatFiles(OraclePropertyGraphBase pg,
java.lang.String vertexFileName,
java.lang.String edgeFileName,
boolean append)
This function exports a given property graph into two flat files: one
for vertices and the other for edges.
|
static void |
exportFlatFiles(OraclePropertyGraphBase pg,
java.lang.String vertexFileName,
java.lang.String edgeFileName,
int dop,
boolean append)
This function exports a given property graph into two flat files: one
for vertices and the other for edges.
|
static void |
exportGML(OraclePropertyGraphBase opg,
java.io.OutputStream os,
java.io.PrintStream psOut)
Exports all vertices/edges from the specified property graph into the output
stream in GML format.
|
static void |
exportGML(OraclePropertyGraphBase opg,
java.lang.String gmlFileName,
java.io.PrintStream psOut)
Exports all vertices/edges from the specified property graph into the specified
file in GML format.
|
static void |
exportGraphML(OraclePropertyGraphBase opg,
java.io.OutputStream os,
java.io.PrintStream psOut)
Exports all vertices/edges from the specified property graph into the output
stream in GraphGML format.
|
static void |
exportGraphML(OraclePropertyGraphBase opg,
java.lang.String graphMLFileName,
java.io.PrintStream psOut)
Exports all vertices/edges from the specified property graph into the specified
file in GraphGML format.
|
static void |
exportGraphMLTinkerpop3(OraclePropertyGraphBase opg,
java.io.OutputStream os,
java.io.PrintStream psOut)
Exports all vertices/edges from the specified property graph into the output
stream in GraphGML format.
|
static void |
exportGraphMLTinkerpop3(OraclePropertyGraphBase opg,
java.lang.String graphMLFileName,
java.io.PrintStream psOut)
Exports all vertices/edges from the specified property graph into the specified
file in GraphGML format.
|
static void |
exportGraphSON(OraclePropertyGraphBase opg,
java.io.OutputStream os,
java.io.PrintStream psOut)
Exports all vertices/edges from the specified property graph into the output
stream in GraphSON format.
|
static void |
exportGraphSON(OraclePropertyGraphBase opg,
java.lang.String graphSonFileName,
java.io.PrintStream psOut)
Exports all vertices/edges from the specified property graph into the specified
file in GraphSON format.
|
static void |
exportGraphSONTinkerpop3(OraclePropertyGraphBase opg,
java.io.OutputStream os,
java.io.PrintStream psOut)
Exports all vertices/edges from the specified property graph into the output
stream in GraphSON format.
|
static void |
exportGraphSONTinkerpop3(OraclePropertyGraphBase opg,
java.lang.String graphSonFileName,
java.io.PrintStream psOut)
Exports all vertices/edges from the specified property graph into the specified
file in GraphSON format.
|
static void |
exportVertices(java.util.Iterator<com.tinkerpop.blueprints.Vertex>[] itVertexArray,
java.io.OutputStream osVertex)
This function exports a given vertices into the output stream using Oracle
flat-file format.
|
static void |
flushIfReachLimit(java.io.ByteArrayOutputStream baos,
java.io.OutputStream os) |
static void |
flushIfReachLimit(java.io.ByteArrayOutputStream baos,
java.io.OutputStream os,
long limit) |
static oracle.pgx.common.types.PropertyType |
getDatatypeAsPropertyType(java.lang.Class dtClass)
Gets the
PropertyType object based on the given datatype class. |
static java.io.InputStream |
handleGZipInputStream(java.io.InputStream in)
Handles a GZIP InputStream.
|
static void |
importGML(OraclePropertyGraphBase opg,
java.io.InputStream is,
java.io.PrintStream psOut)
Imports all vertices/edges from the input stream in GML format into
the specified property graph.
|
static void |
importGML(OraclePropertyGraphBase opg,
java.lang.String gmlFileName,
java.io.PrintStream psOut)
Imports all vertices/edges from the specified file in GML format into
the specified property graph.
|
static void |
importGraphML(OraclePropertyGraphBase opg,
java.io.InputStream is,
java.io.PrintStream psOut)
Imports all vertices/edges from the input stream in GraphGML format into
the specified property graph.
|
static void |
importGraphML(OraclePropertyGraphBase opg,
java.lang.String graphMLFileName,
java.io.PrintStream psOut)
Imports all vertices/edges from the specified file in GraphGML format into
the specified property graph.
|
static void |
importGraphMLTinkerpop3(OraclePropertyGraphBase opg,
java.io.InputStream is,
java.io.PrintStream psOut)
Imports all vertices/edges from the input stream in GraphGML format into
the specified property graph.
|
static void |
importGraphMLTinkerpop3(OraclePropertyGraphBase opg,
java.lang.String graphMLFileName,
java.io.PrintStream psOut)
Imports all vertices/edges from the specified file in GraphGML format into
the specified property graph.
|
static void |
importGraphSON(OraclePropertyGraphBase opg,
java.io.InputStream is,
java.io.PrintStream psOut)
Imports all vertices/edges from the input stream in GraphSON format into
the specified property graph.
|
static void |
importGraphSON(OraclePropertyGraphBase opg,
java.lang.String graphSonFileName,
java.io.PrintStream psOut)
Imports all vertices/edges from the specified file in GraphSON format into
the specified property graph.
|
static void |
importGraphSONTinkerpop3(OraclePropertyGraphBase opg,
java.io.InputStream is,
java.io.PrintStream psOut)
Imports all vertices/edges from the input stream in GraphSON format into
the specified property graph.
|
static void |
importGraphSONTinkerpop3(OraclePropertyGraphBase opg,
java.lang.String graphSonFileName,
java.io.PrintStream psOut)
Imports all vertices/edges from the specified file in GraphSON format into
the specified property graph.
|
static void |
insertOneEdgeLineWithKVIntoDB(java.sql.Connection conn,
java.lang.String pgName,
long leid,
long lsvid,
long ldvid,
java.lang.String el,
java.lang.String szPropertyKey,
java.lang.Object value) |
static void |
insertOneEdgeLineWithoutKVIntoDB(java.sql.Connection conn,
java.lang.String pgName,
long leid,
long lsvid,
long ldvid,
java.lang.String el) |
static void |
insertOneVertexLineWithKVIntoDB(java.sql.Connection conn,
java.lang.String pgName,
long lvid,
java.lang.String szPropertyKey,
java.lang.Object value) |
static void |
insertOneVertexLineWithoutKVIntoDB(java.sql.Connection conn,
java.lang.String pgName,
long lvid) |
static <E> java.util.List<E> |
listify(java.lang.Iterable<E> it)
Converts a given Iterable instance to a List object.
|
static void |
outputEdgeRecord(java.io.OutputStream os,
java.lang.Long eid,
java.lang.Long svid,
java.lang.Long dvid,
java.lang.String label,
java.lang.String szPropertyKey,
java.lang.Object value)
This method outputs a property (K/V) of an edge, identified by an integer ID, into the
given output stream.
|
static void |
outputVertexRecord(java.io.OutputStream os,
java.lang.Long vid,
java.lang.String szPropertyKey,
java.lang.Object value)
This method outputs a property (K/V) of a vertex, identified by an integer ID, into the
given output stream.
|
static void |
outputVertexRecord(java.io.OutputStream os,
java.lang.Long vid,
java.lang.String szLabel,
java.lang.String szPropertyKey,
java.lang.Object value)
This method outputs a property (K/V) of a vertex, identified by an integer ID, into the
given output stream.
|
static void |
prepareConfigEdgePropertiesFromOPVFile(java.lang.Object[] oaEdgeSources,
oracle.pgx.config.AbstractPgGraphConfigBuilder config,
int dop,
OracleFileSplitterConfig ofsconfig)
Updates an existing
AbstractPgGraphConfigBuilder with all the
vertex properties obtained from the given set of OPV flat files. |
static void |
prepareConfigVertexPropertiesFromOPVFile(java.lang.Object[] oaVertexSources,
oracle.pgx.config.AbstractPgGraphConfigBuilder config,
int dop,
OracleFileSplitterConfig ofsconfig)
Updates an existing
AbstractPgGraphConfigBuilder with all the
vertex properties obtained from the given set of OPV flat files. |
static void |
quietlyClose(java.io.BufferedReader br)
Quietly closes the specified BufferedReader.
|
static void |
quietlyClose(java.io.InputStream is)
Quietly closes the specified
InputStream . |
static void |
quietlyClose(java.io.OutputStream os)
Quietly closes the specified
OutputStream . |
static void |
quietlyCloseResultSet(java.sql.ResultSet rs)
Closes (in a best effort fashion) the provided result
set.
|
static void |
quietlyCloseResultSetAndStmt(java.sql.ResultSet rs)
Closes (in a best effort fashion) the provided result
set and its corresponding statement.
|
static void |
quietlyCloseResultSetAndStmt(java.sql.ResultSet rs,
java.sql.Statement stmt)
Closes (in a best effort fashion) the provided result
set and its corresponding statement.
|
static void |
quietlyCloseStmt(java.sql.Statement stmt)
Closes (in a best effort fashion) the provided statement.
|
static void |
quietlyShutdown(OraclePropertyGraphBase opg)
Quietly shutdown a property graph.
|
static void |
saveInputStreamIntoFile(java.io.InputStream is,
java.lang.String fileName)
Saves the content of the given input stream into a temporary file
|
static void |
setExceptionHandlers(java.lang.Thread splitterThread,
java.lang.Thread loaderThread) |
static void |
setStmtArgumentForDml(int idx,
java.sql.PreparedStatement ps,
java.lang.String szKey,
java.lang.Object objVa1)
*
|
static <E> long |
size(java.lang.Iterable<E> it)
Returns the number of elements in the given Iterable object.
|
static <E> long |
size(java.util.Iterator<E> it)
Returns the number of elements in the given Iterable object.
|
static void |
splitAndLoad(java.lang.Thread splitter,
java.lang.Thread loader) |
static java.lang.String |
unescape(java.lang.String s)
Unescapes a string from Oracle flat file format into a regular string.
|
static void |
validateSources(java.lang.Object[] oaSources,
java.lang.String element) |
static void |
writeOneEdgeLineWithKV(java.io.OutputStream os,
long leid,
long lsvid,
long ldvid,
java.lang.String el,
java.lang.String szPropertyKey,
java.lang.Object value) |
static void |
writeOneEdgeLineWithKV(java.io.OutputStream os,
long leid,
long lsvid,
long ldvid,
java.lang.String el,
java.lang.String szPropertyKey,
java.lang.Object value,
BackendConfig bc) |
static void |
writeOneEdgeLineWithKV(java.io.OutputStream os,
long leid,
long lsvid,
long ldvid,
java.lang.String el,
java.lang.String szPropertyKey,
java.lang.Object value,
BackendConfig bc,
DataConverterListener dcl,
long[] lErrors) |
static void |
writeOneEdgeLineWithoutKV(java.io.OutputStream os,
long leid,
long lsvid,
long ldvid,
java.lang.String el) |
static void |
writeOneVertexLineWithKV(java.io.OutputStream os,
long lvid,
java.lang.String szPropertyKey,
java.lang.Object value) |
static void |
writeOneVertexLineWithKV(java.io.OutputStream os,
long lvid,
java.lang.String szPropertyKey,
java.lang.Object value,
BackendConfig bc) |
static void |
writeOneVertexLineWithKV(java.io.OutputStream os,
long lvid,
java.lang.String szPropertyKey,
java.lang.Object value,
java.lang.String vertexLabel,
BackendConfig bc,
DataConverterListener dcl) |
static void |
writeOneVertexLineWithKV(java.io.OutputStream os,
long lvid,
java.lang.String szPropertyKey,
java.lang.Object value,
java.lang.String vertexLabel,
BackendConfig bc,
DataConverterListener dcl,
long[] lErrors) |
static void |
writeOneVertexLineWithKV(java.io.OutputStream os,
long lvid,
java.lang.String vertexLabel,
java.lang.String szPropertyKey,
java.lang.Object value) |
static void |
writeOneVertexLineWithKV(java.io.OutputStream os,
long lvid,
java.lang.String szLabel,
java.lang.String szPropertyKey,
java.lang.Object value,
BackendConfig bc) |
static void |
writeOneVertexLineWithLabelWithoutKV(java.io.OutputStream os,
long lvid,
java.lang.String szLabel) |
static void |
writeOneVertexLineWithoutKV(java.io.OutputStream os,
long lvid) |
static void |
writeValue(java.io.OutputStream os,
java.lang.Object value,
byte[] baFieldDelimiter,
java.text.SimpleDateFormat sdf)
Serializes an object into the given output stream.
|
static void |
writeValue(java.io.OutputStream os,
java.lang.Object value,
byte[] baFieldDelimiter,
java.text.SimpleDateFormat sdf,
BackendConfig bc)
Serializes an object into the given output stream.
|
public static oracle.jdbc.OracleConnection castAsOracleConnection(java.sql.Connection connection) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.Object castRDBMSObject(java.lang.Object obj, java.lang.Class dtClass)
public static Direction castTinkerpop23Direction(com.tinkerpop.blueprints.Direction tp23Direction)
public static com.tinkerpop.blueprints.Direction castToTinkerpop23Direction(Direction tp30Direction)
public static final boolean compareFiles(java.lang.String szSrcFile, java.lang.String szDstFile) throws java.io.IOException
szSrcFile
- the name of the first file to compareszDstFile
- the name of the second file to comparejava.io.IOException
public static boolean compareValueObjects(java.lang.Object obj, java.lang.Object obj1)
public static void convertCSV2OPE(java.io.InputStream inCSV, java.lang.String eidColName, long lOffsetEID, java.lang.String svidColName, java.lang.String dvidColName, boolean hasEdgeLabelCol, java.lang.String elColName, ColumnToAttrMapping[] ctams, int dop, char delimiterChar, char quotationChar, long lOffsetLines, java.text.DateFormat dateFormat, boolean allowMultiline, java.io.OutputStream opeOS, DataConverterListener dcl)
ColumnToAttrMapping
array is supplied with all the details of the column names and their type.
If the ColumnToAttrMapping
array supplied is null then the files must include a
header in the first line.inCSV
- an InputStream
object for the CSV fileeidColName
- the column name that will be used as EID. If NULL, then
the EID will be generated based on the line number. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetEID
- the offset to the EID. Each EID will have a value of
(lOffsetEID + EID).svidColName
- the column name that will be used as SVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.dvidColName
- the column name that will be used as DVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.hasEdgeLabelCol
- if true, read from elColName and treat the values as
edge labels. If false, use elColName as a constant for all edge labelselColName
- the column name that will be used as edge labelctams
- an array of ColumnToAttrMapping objects. Each ColumnToAttrMapping
object defines a mapping from a column in CSV file to an attribute of
certain type in an OPE file. These mappings must be in the same order
as the values are presented in the CSV file. E.g. If a CSV file
includes a header for name,age,weight; the ctams array must include
these mappings in the same order.dop
- degree of parallelism used to optimize converting performance.delimiterChar
- the character used to delimit values in a CSV file, e.g. ','quotationChar
- the character used to delimit how to treat quotation
characters for values, e.g. '"'lOffsetLines
- in order to skip the first lines of the input filedateFormat
- the preferred Date format used to parse the dates in the CSV file, it can be null.allowMultiline
- Whether or not fields from can contain multiple lines, i.e. contain newline character.opeOS
- the OutputStream
object where the OPE file will be writtendcl
- an instance of DataConverterListener that can be used to report
progress and control the conversion process when an error occurs.public static void convertCSV2OPE(java.io.InputStream inCSV, java.lang.String eidColName, long lOffsetEID, java.lang.String svidColName, java.lang.String dvidColName, boolean hasEdgeLabelCol, java.lang.String elColName, ColumnToAttrMapping[] ctams, int dop, char delimiterChar, char quotationChar, long lOffsetLines, java.text.DateFormat dateFormat, java.io.OutputStream opeOS, DataConverterListener dcl)
ColumnToAttrMapping
array is supplied with all the details of the column names and their type.
If the ColumnToAttrMapping
array supplied is null then the files must include a
header in the first line.inCSV
- an InputStream
object for the CSV fileeidColName
- the column name that will be used as EID. If NULL, then
the EID will be generated based on the line number. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetEID
- the offset to the EID. Each EID will have a value of
(lOffsetEID + EID).svidColName
- the column name that will be used as SVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.dvidColName
- the column name that will be used as DVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.hasEdgeLabelCol
- if true, read from elColName and treat the values as
edge labels. If false, use elColName as a constant for all edge labelselColName
- the column name that will be used as edge labelctams
- an array of ColumnToAttrMapping objects. Each ColumnToAttrMapping
object defines a mapping from a column in CSV file to an attribute of
certain type in an OPE file. These mappings must be in the same order
as the values are presented in the CSV file. E.g. If a CSV file
includes a header for name,age,weight; the ctams array must include
these mappings in the same order.dop
- degree of parallelism used to optimize converting performance.delimiterChar
- the character used to delimit values in a CSV file, e.g. ','quotationChar
- the character used to delimit how to treat quotation
characters for values, e.g. '"'lOffsetLines
- in order to skip the first lines of the input filedateFormat
- the preferred Date format used to parse the dates in the CSV file, it can be null.opeOS
- the OutputStream
object where the OPE file will be writtendcl
- an instance of DataConverterListener that can be used to report
progress and control the conversion process when an error occurs.public static void convertCSV2OPE(java.io.InputStream inCSV, java.lang.String eidColName, long lOffsetEID, java.lang.String svidColName, java.lang.String dvidColName, boolean hasEdgeLabelCol, java.lang.String elColName, ColumnToAttrMapping[] ctams, int dop, long lOffsetLines, java.text.DateFormat dateFormat, java.io.OutputStream opeOS, DataConverterListener dcl)
ColumnToAttrMapping
array is supplied with all the details of the column names and their type.
If the ColumnToAttrMapping
array supplied is null then the files must include a
header in the first line.inCSV
- an InputStream
object for the CSV fileeidColName
- the column name that will be used as EID. If NULL, then
the EID will be generated based on the line number. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetEID
- the offset to the EID. Each EID will have a value of
(lOffsetEID + EID).svidColName
- the column name that will be used as SVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.dvidColName
- the column name that will be used as DVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.hasEdgeLabelCol
- if true, read from elColName and treat the values as
edge labels. If false, use elColName as a constant for all edge labelselColName
- the column name that will be used as edge labelctams
- an array of ColumnToAttrMapping objects. Each ColumnToAttrMapping
object defines a mapping from a column in CSV file to an attribute of
certain type in an OPE file. These mappings must be in the same order
as the values are presented in the CSV file. E.g. If a CSV file
includes a header for name,age,weight; the ctams array must include
these mappings in the same order.dop
- degree of parallelism used to optimize converting performance.lOffsetLines
- in order to skip the first lines of the input filedateFormat
- the preferred Date format used to parse the dates in the CSV file, it can be null.opeOS
- the OutputStream
object where the OPE file will be writtendcl
- an instance of DataConverterListener that can be used to report
progress and control the conversion process when an error occurs.public static void convertCSV2OPE(java.io.InputStream inCSV, java.lang.String eidColName, long lOffsetEID, java.lang.String svidColName, java.lang.String dvidColName, boolean hasEdgeLabelCol, java.lang.String elColName, ColumnToAttrMapping[] ctams, int dop, long lOffsetLines, java.io.OutputStream opeOS, DataConverterListener dcl)
ColumnToAttrMapping
array is supplied with all the details of the column names and their type.
If the ColumnToAttrMapping
array supplied is null then the files must include a
header in the first line.inCSV
- an InputStream
object for the CSV fileeidColName
- the column name that will be used as EID. If NULL, then
the EID will be generated based on the line number. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetEID
- the offset to the EID. Each EID will have a value of
(lOffsetEID + EID).svidColName
- the column name that will be used as SVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.dvidColName
- the column name that will be used as DVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.hasEdgeLabelCol
- if true, read from elColName and treat the values as
edge labels. If false, use elColName as a constant for all edge labelselColName
- the column name that will be used as edge labelctams
- an array of ColumnToAttrMapping objects. Each ColumnToAttrMapping
object defines a mapping from a column in CSV file to an attribute of
certain type in an OPE file. These mappings must be in the same order
as the values are presented in the CSV file. E.g. If a CSV file
includes a header for name,age,weight; the ctams array must include
these mappings in the same order.dop
- degree of parallelism used to optimize converting performance.lOffsetLines
- in order to skip the first lines of the input fileopeOS
- the OutputStream
object where the OPE file will be writtendcl
- an instance of DataConverterListener that can be used to report
progress and control the conversion process when an error occurs.public static void convertCSV2OPE(java.io.InputStream inCSV, java.lang.String eidColName, long lOffsetEID, java.lang.String svidColName, java.lang.String dvidColName, long lOffsetVID, boolean hasEdgeLabelCol, java.lang.String elColName, ColumnToAttrMapping[] ctams, int dop, char delimiterChar, char quotationChar, long lOffsetLines, java.text.DateFormat dateFormat, boolean allowMultiline, java.io.OutputStream opeOS, DataConverterListener dcl)
ColumnToAttrMapping
array is supplied with all the details of the column names and their type.
If the ColumnToAttrMapping
array supplied is null then the files must include a
header in the first line.inCSV
- an InputStream
object for the CSV fileeidColName
- the column name that will be used as EID. If NULL, then
the EID will be generated based on the line number. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetEID
- the offset to the EID. Each EID will have a value of
(lOffsetEID + EID).svidColName
- the column name that will be used as SVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.dvidColName
- the column name that will be used as DVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetVID
- the offset to the VID. Each SVID and DVID will have a value of
(lOffsetVID + SVID or lOffsetVID + DVID).hasEdgeLabelCol
- if true, read from elColName and treat the values as
edge labels. If false, use elColName as a constant for all edge labelselColName
- the column name that will be used as edge labelctams
- an array of ColumnToAttrMapping objects. Each ColumnToAttrMapping
object defines a mapping from a column in CSV file to an attribute of
certain type in an OPE file. These mappings must be in the same order
as the values are presented in the CSV file. E.g. If a CSV file
includes a header for name,age,weight; the ctams array must include
these mappings in the same order.dop
- degree of parallelism used to optimize converting performance.delimiterChar
- the character used to delimit values in a CSV file, e.g. ','quotationChar
- the character used to delimit how to treat quotation
characters for values, e.g. '"'lOffsetLines
- in order to skip the first lines of the input filedateFormat
- the preferred Date format used to parse the dates in the CSV file, it can be null.allowMultiline
- Whether or not fields from can contain multiple lines, i.e. contain newline character.opeOS
- the OutputStream
object where the OPE file will be writtendcl
- an instance of DataConverterListener that can be used to report
progress and control the conversion process when an error occurs.public static void convertCSV2OPE(java.io.InputStream inCSV, java.lang.String eidColName, long lOffsetEID, java.lang.String svidColName, java.lang.String dvidColName, long lOffsetSVID, long lOffsetDVID, boolean hasEdgeLabelCol, java.lang.String elColName, ColumnToAttrMapping[] ctams, int dop, char delimiterChar, char quotationChar, long lOffsetLines, java.text.DateFormat dateFormat, boolean allowMultiline, java.io.OutputStream opeOS, DataConverterListener dcl)
ColumnToAttrMapping
array is supplied with all the details of the column names and their type.
If the ColumnToAttrMapping
array supplied is null then the files must include a
header in the first line.inCSV
- an InputStream
object for the CSV fileeidColName
- the column name that will be used as EID. If NULL, then
the EID will be generated based on the line number. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetEID
- the offset to the EID. Each EID will have a value of
(lOffsetEID + EID).svidColName
- the column name that will be used as SVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.dvidColName
- the column name that will be used as DVID. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetSVID
- the offset to the SVID. Each SVID will have a value of
(lOffsetSVID + SVID).lOffsetDVID
- the offset to the DVID. Each DVID will have a value of
(lOffsetDVID + DVID).hasEdgeLabelCol
- if true, read from elColName and treat the values as
edge labels. If false, use elColName as a constant for all edge labelselColName
- the column name that will be used as edge labelctams
- an array of ColumnToAttrMapping objects. Each ColumnToAttrMapping
object defines a mapping from a column in CSV file to an attribute of
certain type in an OPE file. These mappings must be in the same order
as the values are presented in the CSV file. E.g. If a CSV file
includes a header for name,age,weight; the ctams array must include
these mappings in the same order.dop
- degree of parallelism used to optimize converting performance.delimiterChar
- the character used to delimit values in a CSV file, e.g. ','quotationChar
- the character used to delimit how to treat quotation
characters for values, e.g. '"'lOffsetLines
- in order to skip the first lines of the input filedateFormat
- the preferred Date format used to parse the dates in the CSV file, it can be null.allowMultiline
- Whether or not fields from can contain multiple lines, i.e. contain newline character.opeOS
- the OutputStream
object where the OPE file will be writtendcl
- an instance of DataConverterListener that can be used to report
progress and control the conversion process when an error occurs.public static void convertCSV2OPV(java.io.InputStream inCSV, java.lang.String vidColName, long lOffsetVID, ColumnToAttrMapping[] ctams, int dop, char delimiterChar, char quotationChar, long lOffsetLines, java.text.DateFormat dateFormat, boolean allowMultiline, java.io.OutputStream opvOS, DataConverterListener dcl)
ColumnToAttrMapping
array is supplied with all the details of the column names and their type.
If the ColumnToAttrMapping
array supplied is null then the files must include a
header in the first line.inCSV
- an InputStream
object for the CSV filevidColName
- the column name that will be used as VID. If NULL, then
the VID will be generated based on the line number. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetVID
- the offset to the VID. Each VID will have a value of
(lOffsetVID + VID).ctams
- an array of ColumnToAttrMapping objects. Each ColumnToAttrMapping
object defines a mapping from a column in CSV file to an attribute of
certain type in an OPV file. These mappings must be in the same order
as the values are presented in the CSV file. E.g. If a CSV file
includes a header for name,age,weight; the ctams array must include
these mappings in the same order.dop
- degree of parallelism used to optimize converting performance.delimiterChar
- the character used to delimit values in a CSV file, e.g. ','quotationChar
- the character used to delimit how to treat quotation
characters for values, e.g. '"'lOffsetLines
- in order to skip the first lines of the input filedateFormat
- the preferred Date format used to parse the dates in the CSV file, it can be null.allowMultiline
- Whether or not fields from can contain multiple lines, i.e. contain newline character.opvOS
- the OutputStream
object where the OPV file will be writtendcl
- an instance of DataConverterListener that can be used to report
progress and control the conversion process when an error occurs.public static void convertCSV2OPV(java.io.InputStream inCSV, java.lang.String vidColName, long lOffsetVID, ColumnToAttrMapping[] ctams, int dop, char delimiterChar, char quotationChar, long lOffsetLines, java.text.DateFormat dateFormat, java.io.OutputStream opvOS, DataConverterListener dcl)
ColumnToAttrMapping
array is supplied with all the details of the column names and their type.
If the ColumnToAttrMapping
array supplied is null then the files must include a
header in the first line.inCSV
- an InputStream
object for the CSV filevidColName
- the column name that will be used as VID. If NULL, then
the VID will be generated based on the line number. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetVID
- the offset to the VID. Each VID will have a value of
(lOffsetVID + VID).ctams
- an array of ColumnToAttrMapping objects. Each ColumnToAttrMapping
object defines a mapping from a column in CSV file to an attribute of
certain type in an OPV file. These mappings must be in the same order
as the values are presented in the CSV file. E.g. If a CSV file
includes a header for name,age,weight; the ctams array must include
these mappings in the same order.dop
- degree of parallelism used to optimize converting performance.delimiterChar
- the character used to delimit values in a CSV file, e.g. ','quotationChar
- the character used to delimit how to treat quotation
characters for values, e.g. '"'lOffsetLines
- in order to skip the first lines of the input filedateFormat
- the preferred Date format used to parse the dates in the CSV file, it can be null.opvOS
- the OutputStream
object where the OPV file will be writtendcl
- an instance of DataConverterListener that can be used to report
progress and control the conversion process when an error occurs.public static void convertCSV2OPV(java.io.InputStream inCSV, java.lang.String vidColName, long lOffsetVID, ColumnToAttrMapping[] ctams, int dop, long lOffsetLines, java.text.DateFormat dateFormat, java.io.OutputStream opvOS, DataConverterListener dcl)
ColumnToAttrMapping
array is supplied with all the details of the column names and their type.
If the ColumnToAttrMapping
array supplied is null then the files must include a
header in the first line.inCSV
- an InputStream
object for the CSV filevidColName
- the column name that will be used as VID. If NULL, then
the VID will be generated based on the line number. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetVID
- the offset to the VID. Each VID will have a value of
(lOffsetVID + VID).ctams
- an array of ColumnToAttrMapping objects. Each ColumnToAttrMapping
object defines a mapping from a column in CSV file to an attribute of
certain type in an OPV file. These mappings must be in the same order
as the values are presented in the CSV file. E.g. If a CSV file
includes a header for name,age,weight; the ctams array must include
these mappings in the same order.dop
- degree of parallelism used to optimize converting performance.lOffsetLines
- in order to skip the first lines of the input filedateFormat
- the preferred Date format used to parse the dates in the CSV file, it can be null.opvOS
- the OutputStream
object where the OPV file will be writtendcl
- an instance of DataConverterListener that can be used to report
progress and control the conversion process when an error occurs.public static void convertCSV2OPV(java.io.InputStream inCSV, java.lang.String vidColName, long lOffsetVID, ColumnToAttrMapping[] ctams, int dop, long lOffsetLines, java.io.OutputStream opvOS, DataConverterListener dcl)
ColumnToAttrMapping
array is supplied with all the details of the column names and their type.
If the ColumnToAttrMapping
array supplied is null then the files must include a
header in the first line.inCSV
- an InputStream
object for the CSV filevidColName
- the column name that will be used as VID. If NULL, then
the VID will be generated based on the line number. If the given
column name does not have a numeric value, the value will be hashed into
a long number for the ID.lOffsetVID
- the offset to the VID. Each VID will have a value of
(lOffsetVID + VID).ctams
- an array of ColumnToAttrMapping objects. Each ColumnToAttrMapping
object defines a mapping from a column in CSV file to an attribute of
certain type in an OPV file. These mappings must be in the same order
as the values are presented in the CSV file. E.g. If a CSV file
includes a header for name,age,weight; the ctams array must include
these mappings in the same order.dop
- degree of parallelism used to optimize converting performance.lOffsetLines
- in order to skip the first lines of the input fileopvOS
- the OutputStream
object where the OPV file will be writtendcl
- an instance of DataConverterListener that can be used to report
progress and control the conversion process when an error occurs.public static void convertRDBMSTable2OPE(java.sql.Connection conn, java.lang.String rdbmsTableName, java.lang.String eidColName, long lEIDOffset, java.lang.String svidColName, java.lang.String dvidColName, long lVIDOffset, boolean bHasEdgeLabelCol, java.lang.String elColName, ColumnToAttrMapping[] ctams, int dop, java.io.OutputStream opeOS, DataConverterListener dcl)
conn
- an connection instance to Oracle relational databaserdbmsTableName
- the name of RDBMS table to be convertedeidColName
- the column in given RDBMS table to be treated as eid, can be NULL
when eidColName is not null and of type integer/long: use (column value + lEIDOffset) as eid
when eidColName is not null and not of type integer/long: use (hash(column value) + lEIDOffset) as eid
when eidColName is null: use (rownum + lEIDOffset) as eidlEIDOffset
- the offset to the eidsvidColName
- the column in given RDBMS table to be treated as svid, can not be NULL
when svidColName is of type integer/long: use (column value + lVIDOffset) as svid
when svidColName is not of type integer/long: use (hash(column value) + lVIDOffset) as sviddvidColName
- the column in given RDBMS table to be treated as dvid, can not be NULL
when eidColName is of type integer/long: use (column value + lVIDOffset) as dvid
when eidColName is not of type integer/long: use (hash(column value) + lVIDOffset) as dvidlVIDOffset
- the offset to the VID. Each SVID and DVID will have a value of
(lVIDOffset + SVID or lVIDOffset + DVID).bHasEdgeLabelCol
- a boolean flag represents if the given rdbms table has a column for edge labels
if true, use (value of column elColName) as edge label
if false, use elColName as a constant for all edge labelselColName
- ctams
- an array of ColumnToAttrMapping objects; each ColumnToAttrMapping object defines a mapping from a column in rdbms table to an attribute of certain type in opedop
- degree of parallelismopeOS
- ope output stream to be written todcl
- an instance of DataConverterListener that can be used to report progress and control the conversion process when an error occurrs.public static void convertRDBMSTable2OPE(java.sql.Connection conn, java.lang.String rdbmsTableName, java.lang.String eidColName, long lEIDOffset, java.lang.String svidColName, java.lang.String dvidColName, long lVIDOffset, boolean bHasEdgeLabelCol, java.lang.String elColName, ColumnToAttrMapping[] ctams, int dop, java.io.OutputStream opeOS, DataConverterListener dcl, BackendConfig bc)
conn
- an connection instance to Oracle relational databaserdbmsTableName
- the name of RDBMS table to be convertedeidColName
- the column in given RDBMS table to be treated as eid, can be NULL
when eidColName is not null and of type integer/long: use (column value + lEIDOffset) as eid
when eidColName is not null and not of type integer/long: use (hash(column value) + lEIDOffset) as eid
when eidColName is null: use (rownum + lEIDOffset) as eidlEIDOffset
- the offset to the eidsvidColName
- the column in given RDBMS table to be treated as svid, can not be NULL
when svidColName is of type integer/long: use (column value + lVIDOffset) as svid
when svidColName is not of type integer/long: use (hash(column value) + lVIDOffset) as sviddvidColName
- the column in given RDBMS table to be treated as dvid, can not be NULL
when eidColName is of type integer/long: use (column value + lVIDOffset) as dvid
when eidColName is not of type integer/long: use (hash(column value) + lVIDOffset) as dvidlVIDOffset
- the offset to the VID. Each SVID and DVID will have a value of
(lVIDOffset + SVID or lVIDOffset + DVID).bHasEdgeLabelCol
- a boolean flag represents if the given rdbms table has a column for edge labels
if true, use (value of column elColName) as edge label
if false, use elColName as a constant for all edge labelselColName
- ctams
- an array of ColumnToAttrMapping objects; each ColumnToAttrMapping object defines a mapping from a column in rdbms table to an attribute of certain type in opedop
- degree of parallelismopeOS
- ope output stream to be written todcl
- an instance of DataConverterListener that can be used to report progress and control the conversion process when an error occurrs.bc
- an instance of BackendConfing used to Serialization Syntax Checkingpublic static void convertRDBMSTable2OPE(java.sql.Connection conn, java.lang.String rdbmsTableName, java.lang.String eidColName, long lEIDOffset, java.lang.String svidColName, java.lang.String dvidColName, long lSVIDOffset, long lDVIDOffset, boolean bHasEdgeLabelCol, java.lang.String elColName, ColumnToAttrMapping[] ctams, int dop, java.io.OutputStream opeOS, DataConverterListener dcl)
conn
- an connection instance to Oracle relational databaserdbmsTableName
- the name of RDBMS table to be convertedeidColName
- the column in given RDBMS table to be treated as eid, can be NULL
when eidColName is not null and of type integer/long: use (column value + lEIDOffset) as eid
when eidColName is not null and not of type integer/long: use (hash(column value) + lEIDOffset) as eid
when eidColName is null: use (rownum + lEIDOffset) as eidlEIDOffset
- the offset to the eidsvidColName
- the column in given RDBMS table to be treated as svid, can not be NULL
when svidColName is of type integer/long: use (column value + lVIDOffset) as svid
when svidColName is not of type integer/long: use (hash(column value) + lVIDOffset) as sviddvidColName
- the column in given RDBMS table to be treated as dvid, can not be NULL
when eidColName is of type integer/long: use (column value + lVIDOffset) as dvid
when eidColName is not of type integer/long: use (hash(column value) + lVIDOffset) as dvidlSVIDOffset
- the offset to the SVID. Each SVID will have a value of
(lSVIDOffset + SVID).lDVIDOffset
- the offset to the DVID. Each DVID will have a value of
(lDVIDOffset + DVID).bHasEdgeLabelCol
- a boolean flag represents if the given rdbms table has a column for edge labels
if true, use (value of column elColName) as edge label
if false, use elColName as a constant for all edge labelselColName
- ctams
- an array of ColumnToAttrMapping objects; each ColumnToAttrMapping object defines a mapping from a column in rdbms table to an attribute of certain type in opedop
- degree of parallelismopeOS
- ope output stream to be written todcl
- an instance of DataConverterListener that can be used to report progress and control the conversion process when an error occurrs.public static void convertRDBMSTable2OPE(java.sql.Connection conn, java.lang.String rdbmsTableName, java.lang.String eidColName, long lEIDOffset, java.lang.String svidColName, java.lang.String dvidColName, long lSVIDOffset, long lDVIDOffset, boolean bHasEdgeLabelCol, java.lang.String elColName, ColumnToAttrMapping[] ctams, int dop, java.io.OutputStream opeOS, DataConverterListener dcl, BackendConfig bc)
conn
- an connection instance to Oracle relational databaserdbmsTableName
- the name of RDBMS table to be convertedeidColName
- the column in given RDBMS table to be treated as eid, can be NULL
when eidColName is not null and of type integer/long: use (column value + lEIDOffset) as eid
when eidColName is not null and not of type integer/long: use (hash(column value) + lEIDOffset) as eid
when eidColName is null: use (rownum + lEIDOffset) as eidlEIDOffset
- the offset to the eidsvidColName
- the column in given RDBMS table to be treated as svid, can not be NULL
when svidColName is of type integer/long: use (column value + lVIDOffset) as svid
when svidColName is not of type integer/long: use (hash(column value) + lVIDOffset) as sviddvidColName
- the column in given RDBMS table to be treated as dvid, can not be NULL
when eidColName is of type integer/long: use (column value + lVIDOffset) as dvid
when eidColName is not of type integer/long: use (hash(column value) + lVIDOffset) as dvidlSVIDOffset
- the offset to the SVID. Each SVID will have a value of
(lSVIDOffset + SVID).lDVIDOffset
- the offset to the DVID. Each DVID will have a value of
(lDVIDOffset + DVID).bHasEdgeLabelCol
- a boolean flag represents if the given rdbms table has a column for edge labels
if true, use (value of column elColName) as edge label
if false, use elColName as a constant for all edge labelselColName
- ctams
- an array of ColumnToAttrMapping objects; each ColumnToAttrMapping object defines a mapping from a column in rdbms table to an attribute of certain type in opedop
- degree of parallelismopeOS
- ope output stream to be written todcl
- an instance of DataConverterListener that can be used to report progress and control the conversion process when an error occurrs.bc
- an instance of BackendConfing used to Serialization Syntax Checkingpublic static void convertRDBMSTable2OPV(java.sql.Connection conn, java.lang.String rdbmsTableName, java.lang.String vidColName, long lVIDOffset, ColumnToAttrMapping[] ctams, int dop, java.io.OutputStream opvOS, DataConverterListener dcl)
conn
- an connection instance to Oracle relational databaserdbmsTableName
- the name of RDBMS table to be convertedvidColName
- the column in given RDBMS table to be treated as vid
when vidColName is not null and of type integer/long: use (column value + lVIDOffset) as vid
when vidColName is not null and not of type integer/long: use (hash(column value) + lVIDOffset) as vid
when vidColName is null: use (rownum + lVIDOffset) as vidlVIDOffset
- the offset to the vidctams
- an array of ColumnToAttrMapping objects; each ColumnToAttrMapping object defines a mapping from a column in rdbms table to an attribute of certain type in opvdop
- degree of parallelismopvOS
- opv output stream to be written todcl
- an instance of DataConverterListener that can be used to report progress and control the conversion process when an error occurrs.public static void convertRDBMSTable2OPV(java.sql.Connection conn, java.lang.String rdbmsTableName, java.lang.String vidColName, long lVIDOffset, ColumnToAttrMapping[] ctams, int dop, java.io.OutputStream opvOS, DataConverterListener dcl, BackendConfig bc)
conn
- a connection instance to Oracle relational databaserdbmsTableName
- the name of RDBMS table to be convertedvidColName
- the column in given RDBMS table to be treated as vid
when vidColName is not null and of type integer/long: use (column value + lVIDOffset) as vid
when vidColName is not null and not of type integer/long: use (hash(column value) + lVIDOffset) as vid
when vidColName is null: use (rownum + lVIDOffset) as vidlVIDOffset
- the offset to the vidctams
- an array of ColumnToAttrMapping objects; each ColumnToAttrMapping object defines a mapping from a column in rdbms table to an attribute of certain type in opvdop
- degree of parallelismopvOS
- opv output stream to be written todcl
- an instance of DataConverterListener that can be used to report progress and control the conversion process when an error occurrs.public static final byte[] escape(java.lang.String s)
s
- the string to be escapedpublic static void exportEdges(java.util.Iterator<com.tinkerpop.blueprints.Edge>[] itEdgeArray, java.io.OutputStream osEdge) throws java.io.IOException, java.io.FileNotFoundException
itEdgeArray
- an array of edges iteratorsosEdge
- an OutputStream
object for the edge flat filejava.io.IOException
java.io.FileNotFoundException
public static void exportFlatFiles(OraclePropertyGraphBase pg, java.io.OutputStream osVertex, java.io.OutputStream osEdge, int dop, boolean append) throws java.io.IOException, java.io.FileNotFoundException
pg
- the property graph that will be exported into flat filesosVertex
- an OutputStream
object for the vertex flat fileosEdge
- an OutputStream
object for the edge flat filedop
- the degree of parallelism used when writing the data into the
flat files. This will use multiple threads to optimize writing performance.append
- if false, overwrite the existing flat files removing all
existing data.java.io.IOException
java.io.FileNotFoundException
public static final void exportFlatFiles(OraclePropertyGraphBase pg, java.lang.String vertexFileName, java.lang.String edgeFileName, boolean append) throws java.io.IOException, java.io.FileNotFoundException
pg
- the property graph that will be exported into flat filesvertexFileName
- the name of the vertex flat file e.g. graph.opvedgeFileName
- the name of the edge flat file e.g. graph.opeappend
- if false, overwrite the existing flat files removing all
existing data.java.io.IOException
java.io.FileNotFoundException
public static final void exportFlatFiles(OraclePropertyGraphBase pg, java.lang.String vertexFileName, java.lang.String edgeFileName, int dop, boolean append) throws java.io.IOException, java.io.FileNotFoundException
pg
- the property graph that will be exported into flat filesvertexFileName
- the name of the vertex flat file e.g. graph.opvedgeFileName
- the name of the edge flat file e.g. graph.opedop
- the degree of parallelism used when writing the data into the
flat files. This will use multiple threads to optimize writing performance.append
- if false, overwrite the existing flat files removing all
existing data.java.io.IOException
java.io.FileNotFoundException
public static final void exportGML(OraclePropertyGraphBase opg, java.io.OutputStream os, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be exported.os
- the OutputStream
where the property graph data will be exportedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void exportGML(OraclePropertyGraphBase opg, java.lang.String gmlFileName, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be exported.gmlFileName
- the name of the file where the data should be writtenpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void exportGraphML(OraclePropertyGraphBase opg, java.io.OutputStream os, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be exported.os
- the OutputStream
where the property graph data will be exportedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void exportGraphML(OraclePropertyGraphBase opg, java.lang.String graphMLFileName, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be exported.graphMLFileName
- the name of the file where the data should be writtenpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void exportGraphMLTinkerpop3(OraclePropertyGraphBase opg, java.io.OutputStream os, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be exported.os
- the OutputStream
where the property graph data will be exportedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void exportGraphMLTinkerpop3(OraclePropertyGraphBase opg, java.lang.String graphMLFileName, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be exported.graphMLFileName
- the name of the file where the data should be writtenpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void exportGraphSON(OraclePropertyGraphBase opg, java.io.OutputStream os, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be exported.os
- the OutputStream
where the property graph data will be exportedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void exportGraphSON(OraclePropertyGraphBase opg, java.lang.String graphSonFileName, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be exported.graphSonFileName
- the name of the file where the data should be writtenpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void exportGraphSONTinkerpop3(OraclePropertyGraphBase opg, java.io.OutputStream os, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be exported.os
- the OutputStream
where the property graph data will be exportedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void exportGraphSONTinkerpop3(OraclePropertyGraphBase opg, java.lang.String graphSonFileName, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be exported.graphSonFileName
- the name of the file where the data should be writtenpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static void exportVertices(java.util.Iterator<com.tinkerpop.blueprints.Vertex>[] itVertexArray, java.io.OutputStream osVertex) throws java.io.IOException, java.io.FileNotFoundException
itVertexArray
- an array of vertices iteratorsosVertex
- an OutputStream
object for the vertex flat filejava.io.IOException
java.io.FileNotFoundException
public static void flushIfReachLimit(java.io.ByteArrayOutputStream baos, java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public static void flushIfReachLimit(java.io.ByteArrayOutputStream baos, java.io.OutputStream os, long limit) throws java.io.IOException
java.io.IOException
public static oracle.pgx.common.types.PropertyType getDatatypeAsPropertyType(java.lang.Class dtClass)
PropertyType
object based on the given datatype class.
For unsupported Property Graph data types in PGX such as Serializable,
SimpleRdfDataWrapper, SimpleSpatialDataWrapper, SimpleJsonDataWrapper a String
Property Type will be used.dtClass
- the class of the datatypePropertyType
object.public static final java.io.InputStream handleGZipInputStream(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static final void importGML(OraclePropertyGraphBase opg, java.io.InputStream is, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be imported.is
- the InputStream
where the property graph data will be importedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void importGML(OraclePropertyGraphBase opg, java.lang.String gmlFileName, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be imported.gmlFileName
- the file name where the property graph data will be importedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void importGraphML(OraclePropertyGraphBase opg, java.io.InputStream is, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be imported.is
- the InputStream
where the property graph data will be importedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void importGraphML(OraclePropertyGraphBase opg, java.lang.String graphMLFileName, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be imported.graphMLFileName
- the file name where the property graph data will be importedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void importGraphMLTinkerpop3(OraclePropertyGraphBase opg, java.io.InputStream is, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be imported.is
- the InputStream
where the property graph data will be importedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void importGraphMLTinkerpop3(OraclePropertyGraphBase opg, java.lang.String graphMLFileName, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be imported.graphMLFileName
- the file name where the property graph data will be importedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void importGraphSON(OraclePropertyGraphBase opg, java.io.InputStream is, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be imported.is
- the InputStream
where the property graph data will be importedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void importGraphSON(OraclePropertyGraphBase opg, java.lang.String graphSonFileName, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be imported.graphSonFileName
- the file name where the property graph data will be importedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void importGraphSONTinkerpop3(OraclePropertyGraphBase opg, java.io.InputStream is, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be imported.is
- the InputStream
where the property graph data will be importedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static final void importGraphSONTinkerpop3(OraclePropertyGraphBase opg, java.lang.String graphSonFileName, java.io.PrintStream psOut) throws java.io.IOException
opg
- the property graph to be imported.graphSonFileName
- the file name where the property graph data will be importedpsOut
- the PrintStream used to show the progress of the processjava.io.IOException
public static void insertOneEdgeLineWithKVIntoDB(java.sql.Connection conn, java.lang.String pgName, long leid, long lsvid, long ldvid, java.lang.String el, java.lang.String szPropertyKey, java.lang.Object value) throws java.io.IOException
java.io.IOException
public static void insertOneEdgeLineWithoutKVIntoDB(java.sql.Connection conn, java.lang.String pgName, long leid, long lsvid, long ldvid, java.lang.String el)
public static void insertOneVertexLineWithKVIntoDB(java.sql.Connection conn, java.lang.String pgName, long lvid, java.lang.String szPropertyKey, java.lang.Object value) throws java.io.IOException
java.io.IOException
public static void insertOneVertexLineWithoutKVIntoDB(java.sql.Connection conn, java.lang.String pgName, long lvid)
public static final <E> java.util.List<E> listify(java.lang.Iterable<E> it)
it
- an Iterable instance. It can be NULL.public static void outputEdgeRecord(java.io.OutputStream os, java.lang.Long eid, java.lang.Long svid, java.lang.Long dvid, java.lang.String label, java.lang.String szPropertyKey, java.lang.Object value) throws java.io.IOException
os
- output streameid
- long integer ID of an edgesvid
- source vertex IDdvid
- destination vertex IDlabel
- edge labelszPropertyKey
- key of a propertyvalue
- value of a propertyjava.io.IOException
public static void outputVertexRecord(java.io.OutputStream os, java.lang.Long vid, java.lang.String szPropertyKey, java.lang.Object value) throws java.io.IOException
os
- output streamvid
- long integer ID of a vertexszPropertyKey
- key of a propertyvalue
- value of a propertyjava.io.IOException
public static void outputVertexRecord(java.io.OutputStream os, java.lang.Long vid, java.lang.String szLabel, java.lang.String szPropertyKey, java.lang.Object value) throws java.io.IOException
os
- output streamvid
- long integer ID of a vertexszPropertyKey
- key of a propertyvalue
- value of a propertyjava.io.IOException
public static void prepareConfigEdgePropertiesFromOPVFile(java.lang.Object[] oaEdgeSources, oracle.pgx.config.AbstractPgGraphConfigBuilder config, int dop, OracleFileSplitterConfig ofsconfig)
AbstractPgGraphConfigBuilder
with all the
vertex properties obtained from the given set of OPV flat files.public static void prepareConfigVertexPropertiesFromOPVFile(java.lang.Object[] oaVertexSources, oracle.pgx.config.AbstractPgGraphConfigBuilder config, int dop, OracleFileSplitterConfig ofsconfig)
AbstractPgGraphConfigBuilder
with all the
vertex properties obtained from the given set of OPV flat files.public static void quietlyClose(java.io.BufferedReader br)
br
- the BufferedReader to close.public static final void quietlyClose(java.io.InputStream is)
InputStream
.is
- the InputStream
to close.public static final void quietlyClose(java.io.OutputStream os)
OutputStream
.os
- the OutputStream
to close.public static void quietlyCloseResultSet(java.sql.ResultSet rs)
public static void quietlyCloseResultSetAndStmt(java.sql.ResultSet rs)
public static void quietlyCloseResultSetAndStmt(java.sql.ResultSet rs, java.sql.Statement stmt)
public static void quietlyCloseStmt(java.sql.Statement stmt)
public static final void quietlyShutdown(OraclePropertyGraphBase opg)
opg
- the property graph to be shutdown.public static final void saveInputStreamIntoFile(java.io.InputStream is, java.lang.String fileName) throws java.io.IOException
is
- an InputStream
objectfileName
- the file name where the input stream will be savedjava.io.IOException
public static void setExceptionHandlers(java.lang.Thread splitterThread, java.lang.Thread loaderThread)
public static void setStmtArgumentForDml(int idx, java.sql.PreparedStatement ps, java.lang.String szKey, java.lang.Object objVa1) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public static final <E> long size(java.lang.Iterable<E> it)
public static final <E> long size(java.util.Iterator<E> it)
public static void splitAndLoad(java.lang.Thread splitter, java.lang.Thread loader)
public static final java.lang.String unescape(java.lang.String s)
s
- the string to be unescaped.public static void validateSources(java.lang.Object[] oaSources, java.lang.String element)
public static void writeOneEdgeLineWithKV(java.io.OutputStream os, long leid, long lsvid, long ldvid, java.lang.String el, java.lang.String szPropertyKey, java.lang.Object value) throws java.io.IOException
java.io.IOException
public static void writeOneEdgeLineWithKV(java.io.OutputStream os, long leid, long lsvid, long ldvid, java.lang.String el, java.lang.String szPropertyKey, java.lang.Object value, BackendConfig bc) throws java.io.IOException
java.io.IOException
public static void writeOneEdgeLineWithKV(java.io.OutputStream os, long leid, long lsvid, long ldvid, java.lang.String el, java.lang.String szPropertyKey, java.lang.Object value, BackendConfig bc, DataConverterListener dcl, long[] lErrors) throws java.io.IOException
java.io.IOException
public static void writeOneEdgeLineWithoutKV(java.io.OutputStream os, long leid, long lsvid, long ldvid, java.lang.String el) throws java.io.IOException
java.io.IOException
public static void writeOneVertexLineWithKV(java.io.OutputStream os, long lvid, java.lang.String szPropertyKey, java.lang.Object value) throws java.io.IOException
java.io.IOException
public static void writeOneVertexLineWithKV(java.io.OutputStream os, long lvid, java.lang.String szPropertyKey, java.lang.Object value, BackendConfig bc) throws java.io.IOException
java.io.IOException
public static void writeOneVertexLineWithKV(java.io.OutputStream os, long lvid, java.lang.String szPropertyKey, java.lang.Object value, java.lang.String vertexLabel, BackendConfig bc, DataConverterListener dcl) throws java.io.IOException
java.io.IOException
public static void writeOneVertexLineWithKV(java.io.OutputStream os, long lvid, java.lang.String szPropertyKey, java.lang.Object value, java.lang.String vertexLabel, BackendConfig bc, DataConverterListener dcl, long[] lErrors) throws java.io.IOException
java.io.IOException
public static void writeOneVertexLineWithKV(java.io.OutputStream os, long lvid, java.lang.String vertexLabel, java.lang.String szPropertyKey, java.lang.Object value) throws java.io.IOException
java.io.IOException
public static void writeOneVertexLineWithKV(java.io.OutputStream os, long lvid, java.lang.String szLabel, java.lang.String szPropertyKey, java.lang.Object value, BackendConfig bc) throws java.io.IOException
java.io.IOException
public static void writeOneVertexLineWithLabelWithoutKV(java.io.OutputStream os, long lvid, java.lang.String szLabel) throws java.io.IOException
java.io.IOException
public static void writeOneVertexLineWithoutKV(java.io.OutputStream os, long lvid) throws java.io.IOException
java.io.IOException
public static final void writeValue(java.io.OutputStream os, java.lang.Object value, byte[] baFieldDelimiter, java.text.SimpleDateFormat sdf) throws java.io.IOException
os
- an OutputStream
objectvalue
- the value object to serialize.baFieldDelimiter
- the byte array representation of a fieldDelimiter
to use when processing values in a flat file.sdf
- a SimpleDateFormat
to use when parsing a Date value object.java.io.IOException
public static final void writeValue(java.io.OutputStream os, java.lang.Object value, byte[] baFieldDelimiter, java.text.SimpleDateFormat sdf, BackendConfig bc) throws java.io.IOException
os
- an OutputStream
objectvalue
- the value object to serialize.baFieldDelimiter
- the byte array representation of a fieldDelimiter
to use when processing values in a flat file.sdf
- a SimpleDateFormat
to use when parsing a Date value object.bc
- an instance of BackendConfing used to Serialization Syntax Checkingjava.io.IOException
Copyright © 2015, 2019, Oracle and/or its afflilates. All Rights Reserved.