NodeTypeLoader class.
More...
#include <NodeTypeLoader.h>
|
|
| NodeTypeLoader () |
| | Creates a new instance.
|
| | NodeTypeLoader (RowReader &rowReader, sparksee::gdb::Graph &graph, sparksee::gdb::type_t type, sparksee::gdb::AttributeList &attrs, sparksee::gdb::Int32List &attrsPos) |
| | Creates a new instance.
|
|
virtual | ~NodeTypeLoader () |
| | 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 | SetLogError (const std::wstring &path) throw (sparksee::gdb::IOException) |
| | Sets a log error file.
|
| void | SetLogOff () |
| | Truns off all the error reporting.
|
| void | Register (TypeLoaderListener &tel) |
| | Registers a new listener.
|
| void | SetRowReader (RowReader &rr) |
| | Sets the input data source.
|
| void | SetGraph (sparksee::gdb::Graph &graph) |
| | Sets the graph where the data will be loaded.
|
| void | SetLocale (const std::wstring &localeStr) |
| | Sets the locale that will be used to read the data.
|
| void | SetType (sparksee::gdb::type_t type) |
| | Sets the type to be loaded.
|
| void | SetAttributes (sparksee::gdb::AttributeList &attrs) |
| | Sets the list of Attributes.
|
| void | SetAttributePositions (sparksee::gdb::Int32List &attrsPos) |
| | Sets the list of attribute positions.
|
| void | SetTimestampFormat (const std::wstring ×tampFormat) |
| | Sets a specific timestamp format.
|
| void | SetFrequency (sparksee::gdb::int32_t freq) |
| | Sets the frequency of listener notification.
|
|
| void | Run (Mode ph, sparksee::gdb::int32_t par) throw (sparksee::gdb::IOException, sparksee::gdb::Error) |
| | Runs load process.
|
| sparksee::gdb::bool_t | CanRun () |
| | Checks that all the required settings are ready to run.
|
| void | NotifyListeners (const TypeLoaderEvent &ev) |
| | Notifies progress to all registered listeners.
|
| void | SetHeadAttribute (sparksee::gdb::attr_t attr) |
| | Sets the attribute that will be used to find the head of the edge.
|
| void | SetHeadPosition (sparksee::gdb::int32_t pos) |
| | Sets the position of the head attribute in the source data.
|
| void | SetTailAttribute (sparksee::gdb::attr_t attr) |
| | Sets the attribute that will be used to find the tail of the edge.
|
| void | SetTailPosition (sparksee::gdb::int32_t pos) |
| | Sets the position of the tail attribute in the source data.
|
| void | SetTailMEP (sparksee::gdb::MissingEndpoint mep) |
| | Sets the flag to create missing tail nodes when loading nodes or edges.
|
| void | SetHeadMEP (sparksee::gdb::MissingEndpoint mep) |
| | Sets the flag to create missing head nodes when loading nodes or edges.
|
NodeTypeLoader class.
Specific TypeLoader implementation for node types.
Check out the 'Data import' section in the SPARKSEE User Manual for more details on this.
- Author
- Sparsity Technologies http://www.sparsity-technologies.com
◆ Mode
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.
|
◆ NodeTypeLoader()
| NodeTypeLoader::NodeTypeLoader |
( |
RowReader & | rowReader, |
|
|
sparksee::gdb::Graph & | graph, |
|
|
sparksee::gdb::type_t | type, |
|
|
sparksee::gdb::AttributeList & | attrs, |
|
|
sparksee::gdb::Int32List & | attrsPos ) |
|
inline |
◆ CanRun()
| sparksee::gdb::bool_t TypeLoader::CanRun |
( |
| ) |
|
|
protectedinherited |
Checks that all the required settings are ready to run.
- Returns
- Returns true if all the settings are ready.
◆ NotifyListeners()
Notifies progress to all registered listeners.
- Parameters
-
| ev | [in] Progress event to be notified. |
◆ Register()
Registers a new listener.
- Parameters
-
◆ Run() [1/2]
| void NodeTypeLoader::Run |
( |
| ) |
|
| throw | ( | sparksee::gdb::IOException, |
| | sparksee::gdb::Error ) | | | |
|
inlinevirtual |
◆ Run() [2/2]
| void TypeLoader::Run |
( |
Mode | ph, |
|
|
sparksee::gdb::int32_t | par ) |
| throw | ( | sparksee::gdb::IOException, |
| | sparksee::gdb::Error ) | | | |
|
protectedinherited |
Runs load process.
- Parameters
-
| ph | [in] The load mode. |
| par | [in] Number of horizontal partitions to perform the load. |
- Exceptions
-
◆ RunNPhases()
| void NodeTypeLoader::RunNPhases |
( |
sparksee::gdb::int32_t | partitions | ) |
|
| throw | ( | sparksee::gdb::IOException, |
| | sparksee::gdb::Error ) | | | |
|
inlinevirtual |
◆ RunTwoPhases()
| void NodeTypeLoader::RunTwoPhases |
( |
| ) |
|
| throw | ( | sparksee::gdb::IOException, |
| | sparksee::gdb::Error ) | | | |
|
inlinevirtual |
◆ SetAttributePositions()
| void TypeLoader::SetAttributePositions |
( |
sparksee::gdb::Int32List & | attrsPos | ) |
|
|
inherited |
◆ SetAttributes()
| void TypeLoader::SetAttributes |
( |
sparksee::gdb::AttributeList & | attrs | ) |
|
|
inherited |
◆ SetFrequency()
| void TypeLoader::SetFrequency |
( |
sparksee::gdb::int32_t | freq | ) |
|
|
inherited |
Sets the frequency of listener notification.
- Parameters
-
| freq | [in] Frequency in number of rows managed to notify progress to all listeners |
References SetFrequency().
Referenced by SetFrequency().
◆ SetGraph()
| void TypeLoader::SetGraph |
( |
sparksee::gdb::Graph & | graph | ) |
|
|
inherited |
Sets the graph where the data will be loaded.
- Parameters
-
References SetGraph().
Referenced by SetGraph().
◆ SetHeadAttribute()
| void TypeLoader::SetHeadAttribute |
( |
sparksee::gdb::attr_t | attr | ) |
|
|
protectedinherited |
◆ SetHeadMEP()
| void TypeLoader::SetHeadMEP |
( |
sparksee::gdb::MissingEndpoint | mep | ) |
|
|
protectedinherited |
◆ SetHeadPosition()
| void TypeLoader::SetHeadPosition |
( |
sparksee::gdb::int32_t | pos | ) |
|
|
protectedinherited |
◆ SetLocale()
| void TypeLoader::SetLocale |
( |
const std::wstring & | localeStr | ) |
|
|
inherited |
Sets the locale that will be used to read the data.
It should match the locale used in the rowreader.
- Parameters
-
| localeStr | [in] The locale string for the read data. See CSVReader. |
References SetLocale().
Referenced by SetLocale().
◆ SetLogError()
| void TypeLoader::SetLogError |
( |
const std::wstring & | path | ) |
|
| throw | ( | sparksee::gdb::IOException ) | | | |
|
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.
- Parameters
-
| path | [in] The path to the error log file. |
- Exceptions
-
◆ SetLogOff()
| void TypeLoader::SetLogOff |
( |
| ) |
|
|
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.
◆ SetRowReader()
| void TypeLoader::SetRowReader |
( |
RowReader & | rr | ) |
|
|
inherited |
◆ SetTailAttribute()
| void TypeLoader::SetTailAttribute |
( |
sparksee::gdb::attr_t | attr | ) |
|
|
protectedinherited |
◆ SetTailMEP()
| void TypeLoader::SetTailMEP |
( |
sparksee::gdb::MissingEndpoint | mep | ) |
|
|
protectedinherited |
◆ SetTailPosition()
| void TypeLoader::SetTailPosition |
( |
sparksee::gdb::int32_t | pos | ) |
|
|
protectedinherited |
◆ SetTimestampFormat()
| void TypeLoader::SetTimestampFormat |
( |
const std::wstring & | timestampFormat | ) |
|
|
inherited |
◆ SetType()
| void TypeLoader::SetType |
( |
sparksee::gdb::type_t | type | ) |
|
|
inherited |
Sets the type to be loaded.
- Parameters
-
| type | [in] Type identifier. |
References SetType().
Referenced by SetType().
The documentation for this class was generated from the following file: