public class NodeTypeLoader extends TypeLoader
Specific TypeLoader implementation for node types.
Check out the 'Data import' section in the SPARKSEE User Manual for more details on this.
| Constructor and Description |
|---|
NodeTypeLoader()
Creates a new instance.
|
NodeTypeLoader(RowReader rowReader,
Graph graph,
int type,
AttributeList attrs,
Int32List attrsPos)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
register(TypeLoaderListener tel)
Registers a new listener.
|
void |
run()
See the TypeLoader class Run method.
|
void |
runNPhases(int partitions)
See the TypeLoader class RunNPhases method.
|
void |
runTwoPhases()
See the TypeLoader class RunTwoPhases method.
|
void |
setAttributePositions(Int32List attrsPos)
Sets the list of attribute positions.
|
void |
setAttributes(AttributeList attrs)
Sets the list of Attributes.
|
void |
setFrequency(int freq)
Sets the frequency of listener notification.
|
void |
setGraph(Graph graph)
Sets the graph where the data will be loaded.
|
void |
setLocale(java.lang.String localeStr)
Sets the locale that will be used to read the data.
|
void |
setLogError(java.lang.String path)
Sets a log error file.
|
void |
setLogOff()
Truns off all the error reporting.
|
void |
setRowReader(RowReader rr)
Sets the input data source.
|
void |
setTimestampFormat(java.lang.String timestampFormat)
Sets a specific timestamp format.
|
void |
setType(int type)
Sets the type to be loaded.
|
public NodeTypeLoader()
public NodeTypeLoader(RowReader rowReader, Graph graph, int type, AttributeList attrs, Int32List attrsPos)
attrsPos[in] Attribute positions (column index >=0).
rowReader - [in] Input RowReader.graph - [in] Graph.type - [in] Type identifier.attrs - [in] Attribute identifiers to be loaded.attrsPos - [in] Attribute positions (column index >=0).public void run()
throws java.lang.RuntimeException,
java.io.IOException
run in class TypeLoaderjava.lang.RuntimeException - nulljava.io.IOException - nullpublic void setLogError(java.lang.String path)
throws java.io.IOException
By default errors are thrown as a exception and the load process ends. If a log file is set, errors are logged there and the load process does not stop.
setLogError in class TypeLoaderpath - [in] The path to the error log file.java.io.IOException - If bad things happen opening the file.public void setType(int type)
setType in class TypeLoadertype - [in] Type identifier.public void setLocale(java.lang.String localeStr)
It should match the locale used in the rowreader.
setLocale in class TypeLoaderlocaleStr - [in] The locale string for the read data. See CSVReader.public void setTimestampFormat(java.lang.String timestampFormat)
setTimestampFormat in class TypeLoadertimestampFormat - [in] A string with the timestamp format definition.public void setAttributes(AttributeList attrs)
setAttributes in class TypeLoaderattrs - [in] Attribute identifiers to be loadedpublic void register(TypeLoaderListener tel)
register in class TypeLoadertel - TypeLoaderListener to be registered.public void setFrequency(int freq)
setFrequency in class TypeLoaderfreq - [in] Frequency in number of rows managed to notify progress to all listenerspublic void runTwoPhases()
throws java.lang.RuntimeException,
java.io.IOException
runTwoPhases in class TypeLoaderjava.lang.RuntimeException - nulljava.io.IOException - nullpublic void setRowReader(RowReader rr)
setRowReader in class TypeLoaderrr - [in] Input RowReader.public void setAttributePositions(Int32List attrsPos)
attrsPos[in] Attribute positions (column index >=0).
setAttributePositions in class TypeLoaderattrsPos - [in] Attribute positions (column index >=0).public void setGraph(Graph graph)
setGraph in class TypeLoadergraph - [in] Graph.public void runNPhases(int partitions)
throws java.lang.RuntimeException,
java.io.IOException
runNPhases in class TypeLoaderpartitions - nulljava.lang.RuntimeException - nulljava.io.IOException - nullpublic void setLogOff()
The log file will not be created and no exceptions for invalid data will be thrown. If you just want to turn off the logs, but abort at the first error what you should do is not call this method and not set a logError file.
setLogOff in class TypeLoader