Sparksee
6.0.2
|
EdgeTypeLoader class. More...
Public Member Functions | |
EdgeTypeLoader () | |
Creates a new instance. | |
EdgeTypeLoader (RowReader &rowReader, sparksee::gdb::Graph &graph, sparksee::gdb::type_t type, sparksee::gdb::AttributeList &attrs, sparksee::gdb::Int32List &attrsPos, sparksee::gdb::int32_t hPos, sparksee::gdb::int32_t tPos, sparksee::gdb::attr_t hAttr, sparksee::gdb::attr_t tAttr, sparksee::gdb::MissingEndpoint headMEP, sparksee::gdb::MissingEndpoint tailMEP) | |
Creates a new instance. More... | |
virtual | ~EdgeTypeLoader () |
Destructor. | |
void | Run () throw (sparksee::gdb::IOException, sparksee::gdb::Error) |
See the TypeLoader class Run method. | |
void | RunTwoPhases () throw (sparksee::gdb::IOException, sparksee::gdb::Error) |
See the TypeLoader class RunTwoPhases method. | |
void | RunNPhases (sparksee::gdb::int32_t partitions) throw (sparksee::gdb::IOException, sparksee::gdb::Error) |
See the TypeLoader class RunNPhases method. | |
void | SetHeadAttribute (sparksee::gdb::attr_t attr) |
Sets the attribute that will be used to find the head of the edge. More... | |
void | SetHeadPosition (sparksee::gdb::int32_t pos) |
Sets the position of the head attribute in the source data. More... | |
void | SetTailAttribute (sparksee::gdb::attr_t attr) |
Sets the attribute that will be used to find the tail of the edge. More... | |
void | SetTailPosition (sparksee::gdb::int32_t pos) |
Sets the position of the tail attribute in the source data. More... | |
void | SetTailMEP (sparksee::gdb::MissingEndpoint mep) |
Sets the flag to create missing tail nodes when loading nodes or edges. More... | |
void | SetHeadMEP (sparksee::gdb::MissingEndpoint mep) |
Sets the flag to create missing head nodes when loading nodes or edges. More... | |
void | SetLogError (const std::wstring &path) throw (sparksee::gdb::IOException) |
Sets a log error file. More... | |
void | SetLogOff () |
Truns off all the error reporting. More... | |
void | Register (TypeLoaderListener &tel) |
Registers a new listener. More... | |
void | SetRowReader (RowReader &rr) |
Sets the input data source. More... | |
void | SetGraph (sparksee::gdb::Graph &graph) |
Sets the graph where the data will be loaded. More... | |
void | SetLocale (const std::wstring &localeStr) |
Sets the locale that will be used to read the data. More... | |
void | SetType (sparksee::gdb::type_t type) |
Sets the type to be loaded. More... | |
void | SetAttributes (sparksee::gdb::AttributeList &attrs) |
Sets the list of Attributes. More... | |
void | SetAttributePositions (sparksee::gdb::Int32List &attrsPos) |
Sets the list of attribute positions. More... | |
void | SetTimestampFormat (const std::wstring ×tampFormat) |
Sets a specific timestamp format. More... | |
void | SetFrequency (sparksee::gdb::int32_t freq) |
Sets the frequency of listener notification. More... | |
Protected Types |
Protected Member Functions | |
void | Run (Mode ph, sparksee::gdb::int32_t par) throw (sparksee::gdb::IOException, sparksee::gdb::Error) |
Runs load process. More... | |
sparksee::gdb::bool_t | CanRun () |
Checks that all the required settings are ready to run. More... | |
void | NotifyListeners (const TypeLoaderEvent &ev) |
Notifies progress to all registered listeners. More... | |
EdgeTypeLoader class.
Specific TypeLoader implementation for edge types.
Check out the 'Data import' section in the SPARKSEE User Manual for more details on this.
|
protectedinherited |
Load can work in different ways.
Enumerator | |
---|---|
ONE_PHASE |
Performs the load in a phases. Load all objects an attributes at the same time. |
TWO_PHASES |
Performs the load in two phases. Firstly load all objects (and create them if necessary) and secondly loads all the attributes. Working on this mode it is necessary to build a temporary file. |
N_PHASES |
Performs the load in N phases. Firstly load all objects (and create them if necessary) and secondly loads all the attributes. But in this case, attributes are loaded one by one. This way, if there are three attributes, then 4 traverses to the RowReader are necessary. Working on this mode it is necessary to build a temporary file. |
|
inline |
Creates a new instance.
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). to all listeners. |
hPos | [in] The position (index column) for the head value. |
tPos | [in] The position (index column) for the tail value. |
hAttr | [in] The attribute identifier for the head. |
tAttr | [in] The attribute identifier for the tail. |
tailMEP | [in] The MissingEndpoint policy for the tail nodes |
headMEP | [in] The MissingEndpoint policy for the head nodes |
References TypeLoader::SetHeadAttribute(), TypeLoader::SetHeadMEP(), TypeLoader::SetHeadPosition(), TypeLoader::SetTailAttribute(), TypeLoader::SetTailMEP(), and TypeLoader::SetTailPosition().
|
protectedinherited |
Checks that all the required settings are ready to run.
|
protectedinherited |
Notifies progress to all registered listeners.
ev | [in] Progress event to be notified. |
|
inherited |
Registers a new listener.
[in] | tel | TypeLoaderListener to be registered. |
|
protectedinherited |
Runs load process.
IOException | If bad things happen reading from the RowReader. |
ph | [in] The load mode. |
par | [in] Number of horizontal partitions to perform the load. |
|
inherited |
Sets the list of attribute positions.
attrsPos | [in] Attribute positions (column index >=0). |
|
inherited |
Sets the list of Attributes.
attrs | [in] Attribute identifiers to be loaded |
|
inherited |
Sets the frequency of listener notification.
freq | [in] Frequency in number of rows managed to notify progress to all listeners |
|
inherited |
Sets the graph where the data will be loaded.
graph | [in] Graph. |
|
inline |
Sets the attribute that will be used to find the head of the edge.
This method is protected because only the Edge loaders should have it.
attr | [in] Head Attribute |
References TypeLoader::SetHeadAttribute().
|
inline |
Sets the flag to create missing head nodes when loading nodes or edges.
flag | True if the nodes need to be created. False otherwise |
References END_SPARKSEE_IO_NAMESPACE, and TypeLoader::SetHeadMEP().
|
inline |
Sets the position of the head attribute in the source data.
This method is protected because only the Edge loaders should have it.
pos | [in] Head position |
References TypeLoader::SetHeadPosition().
|
inherited |
Sets the locale that will be used to read the data.
It should match the locale used in the rowreader.
localeStr | [in] The locale string for the read data. See CSVReader. |
|
inherited |
Sets a log error file.
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.
path | [in] The path to the error log file. |
IOException | If bad things happen opening the file. |
|
inherited |
Truns off all the error reporting.
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.
|
inherited |
Sets the input data source.
rr | [in] Input RowReader. |
|
inline |
Sets the attribute that will be used to find the tail of the edge.
This method is protected because only the Edge loaders should have it.
attr | [in] Tail Attribute |
References TypeLoader::SetTailAttribute().
|
inline |
Sets the flag to create missing tail nodes when loading nodes or edges.
flag | True if the nodes need to be created. False otherwise |
References TypeLoader::SetTailMEP().
|
inline |
Sets the position of the tail attribute in the source data.
This method is protected because only the Edge loaders should have it.
pos | [in] Tail position |
References TypeLoader::SetTailPosition().
|
inherited |
Sets a specific timestamp format.
timestampFormat | [in] A string with the timestamp format definition. |
|
inherited |
Sets the type to be loaded.
type | [in] Type identifier. |