EdgeTypeLoader Class Reference
[IO]

EdgeTypeLoader class. More...

Inheritance diagram for EdgeTypeLoader:

Inheritance graph
Collaboration diagram for EdgeTypeLoader:

Collaboration graph

List of all members.

Public Member Functions

 EdgeTypeLoader ()
 Creates a new instance.
 EdgeTypeLoader (RowReader &rr, dex::gdb::Graph &g, dex::gdb::type_t t, dex::gdb::AttributeList &attrs, dex::gdb::Int32List &attrsPos, dex::gdb::int32_t hPos, dex::gdb::int32_t tPos, dex::gdb::attr_t hAttr, dex::gdb::attr_t tAttr)
 Creates a new instance.
virtual ~EdgeTypeLoader ()
 Destructor.
void Run () throw (dex::gdb::IOException, dex::gdb::Error)
 See TypeLoader::Run.
void RunTwoPhases () throw (dex::gdb::IOException, dex::gdb::Error)
 See TypeLoader::RunTwoPhases.
void RunNPhases (dex::gdb::int32_t partitions) throw (dex::gdb::IOException, dex::gdb::Error)
 See TypeLoader::RunNPhases.
void SetHeadAttribute (dex::gdb::attr_t attr)
 Sets the attribute that will be used to find the head of the edge.
void SetHeadPosition (dex::gdb::int32_t pos)
 Sets the position of the head attribute in the source data.
void SetTailAttribute (dex::gdb::attr_t attr)
 Sets the attribute that will be used to find the tail of the edge.
void SetTailPosition (dex::gdb::int32_t pos)
 Sets the position of the tail attribute in the source data.
void SetLogError (const std::wstring &path) throw (dex::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 (dex::gdb::Graph &g)
 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 (dex::gdb::type_t t)
 Sets the type to be loaded.
void SetAttributes (dex::gdb::AttributeList &attrs)
 Sets the list of Attributes.
void SetAttributePositions (dex::gdb::Int32List &attrsPos)
 Sets the list of attribute positions.
void SetTimestampFormat (const std::wstring &timestampFormat)
 Sets a specific timestamp format.
void SetFrequency (dex::gdb::int32_t freq)
 Sets the frequency of listener notification.

Protected Types

enum  Mode {
  ONE_PHASE,
  TWO_PHASES,
  N_PHASES
}
 Load can work in different ways. More...

Protected Member Functions

dex::gdb::bool_t CanRun ()
 Checks that all the required settings are ready to run.
void Run (Mode ph, dex::gdb::int32_t par) throw (dex::gdb::IOException, dex::gdb::Error)
 Runs load process.
void NotifyListeners (const TypeLoaderEvent &ev)
 Notifies progress to all registered listeners.


Detailed Description

EdgeTypeLoader class.

Specific TypeLoader implementation for edge types.

Check out the 'Data import' section in the DEX User Manual for more details on this.

Author:
Sparsity Technologies http://www.sparsity-technologies.com

Member Enumeration Documentation

enum TypeLoader::Mode [protected, inherited]

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.


Constructor & Destructor Documentation

EdgeTypeLoader::EdgeTypeLoader ( RowReader rr,
dex::gdb::Graph &  g,
dex::gdb::type_t  t,
dex::gdb::AttributeList &  attrs,
dex::gdb::Int32List &  attrsPos,
dex::gdb::int32_t  hPos,
dex::gdb::int32_t  tPos,
dex::gdb::attr_t  hAttr,
dex::gdb::attr_t  tAttr 
) [inline]

Creates a new instance.

Parameters:
rr [in] Input RowReader.
g [in] Graph.
t [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.


Member Function Documentation

void EdgeTypeLoader::SetHeadAttribute ( dex::gdb::attr_t  attr  )  [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.

Parameters:
attr [in] Head Attribute

Reimplemented from TypeLoader.

void EdgeTypeLoader::SetHeadPosition ( dex::gdb::int32_t  pos  )  [inline]

Sets the position of the head attribute in the source data.

This method is protected because only the Edge loaders should have it.

Parameters:
pos [in] Head position

Reimplemented from TypeLoader.

void EdgeTypeLoader::SetTailAttribute ( dex::gdb::attr_t  attr  )  [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.

Parameters:
attr [in] Tail Attribute

Reimplemented from TypeLoader.

void EdgeTypeLoader::SetTailPosition ( dex::gdb::int32_t  pos  )  [inline]

Sets the position of the tail attribute in the source data.

This method is protected because only the Edge loaders should have it.

Parameters:
pos [in] Tail position

Reimplemented from TypeLoader.

dex::gdb::bool_t TypeLoader::CanRun (  )  [protected, inherited]

Checks that all the required settings are ready to run.

Returns:
Returns true if all the settings are ready.

void TypeLoader::Run ( Mode  ph,
dex::gdb::int32_t  par 
) throw (dex::gdb::IOException, dex::gdb::Error) [protected, inherited]

Runs load process.

Exceptions:
IOException If bad things happen reading from the RowReader.
Parameters:
ph [in] The load mode.
par [in] Number of horizontal partitions to perform the load.

void TypeLoader::NotifyListeners ( const TypeLoaderEvent ev  )  [protected, inherited]

Notifies progress to all registered listeners.

Parameters:
ev [in] Progress event to be notified.

void TypeLoader::SetLogError ( const std::wstring &  path  )  throw (dex::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.

Exceptions:
IOException If bad things happen opening the file.

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.

void TypeLoader::Register ( TypeLoaderListener tel  )  [inherited]

Registers a new listener.

Parameters:
[in] tel TypeLoaderListener to be registered.

void TypeLoader::SetRowReader ( RowReader rr  )  [inherited]

Sets the input data source.

Parameters:
rr [in] Input RowReader.

void TypeLoader::SetGraph ( dex::gdb::Graph &  g  )  [inherited]

Sets the graph where the data will be loaded.

Parameters:
g [in] Graph.

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.

void TypeLoader::SetType ( dex::gdb::type_t  t  )  [inherited]

Sets the type to be loaded.

Parameters:
t [in] Type identifier.

void TypeLoader::SetAttributes ( dex::gdb::AttributeList &  attrs  )  [inherited]

Sets the list of Attributes.

Parameters:
attrs [in] Attribute identifiers to be loaded

void TypeLoader::SetAttributePositions ( dex::gdb::Int32List &  attrsPos  )  [inherited]

Sets the list of attribute positions.

attrsPos [in] Attribute positions (column index >=0).

void TypeLoader::SetFrequency ( dex::gdb::int32_t  freq  )  [inherited]

Sets the frequency of listener notification.

freq [in] Frequency in number of rows managed to notify progress to all listeners


The documentation for this class was generated from the following file:

Generated on Tue Jul 16 12:10:16 2013 for Dex by  doxygen 1.5.6