DexNet 4.7.0
Public Member Functions
com::sparsity::dex::io::TypeLoader Class Reference

Base TypeLoader class. More...

Inheritance diagram for com::sparsity::dex::io::TypeLoader:
Inheritance graph

List of all members.

Public Member Functions

void RunTwoPhases () throws System.IO.IOException, System.ApplicationException
 Run the loader for two phases loading.
void SetLogOff ()
 Truns off all the error reporting.
void Run () throws System.IO.IOException, System.ApplicationException
 Run the loader.
void SetLogError (System.String path) throws System.IO.IOException
 Sets a log error file.
void SetAttributes (com.sparsity.dex.gdb.AttributeList attrs)
 Sets the list of Attributes.
void SetRowReader (com.sparsity.dex.io.RowReader rr)
 Sets the input data source.
void Register (com.sparsity.dex.io.TypeLoaderListener tel)
 Registers a new listener.
void SetLocale (System.String localeStr)
 Sets the locale that will be used to read the data.
void SetAttributePositions (com.sparsity.dex.gdb.Int32List attrsPos)
 Sets the list of attribute positions.
void RunNPhases (int partitions) throws System.IO.IOException, System.ApplicationException
 Run the loader for N phases loading.
void SetFrequency (int freq)
 Sets the frequency of listener notification.
void SetGraph (com.sparsity.dex.gdb.Graph g)
 Sets the graph where the data will be loaded.
void SetTimestampFormat (System.String timestampFormat)
 Sets a specific timestamp format.
void SetType (int t)
 Sets the type to be loaded.

Detailed Description

Base TypeLoader class.

Base class to load a node or edge type from a graph using a RowReader.

TypeLoaderListener can be registered to receive information about the progress of the load process by means of TypeLoaderEvent.

The default frequency of notification to listeners is 100000.

Timestamp formats accepted by default (see ScriptParser):

"yyyy-MM-dd hh:mm:ss.SSS"

"yyyy-MM-dd hh:mm:ss"

"yyyy-MM-dd"

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

Member Function Documentation

void com::sparsity::dex::io::TypeLoader::Register ( com.sparsity.dex.io.TypeLoaderListener  tel)

Registers a new listener.

Parameters:
telTypeLoaderListener to be registered.

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::Run ( ) throws System.IO.IOException, System.ApplicationException

Run the loader.

Exceptions:
System.IO.IOExceptionnull
System.ApplicationExceptionnull

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::RunNPhases ( int  partitions) throws System.IO.IOException, System.ApplicationException

Run the loader for N phases loading.

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 are necessary.

Working on this mode it is necessary to build a temporary file.

Parameters:
partitions[in] Number of horizontal partitions to perform the load.
Exceptions:
System.IO.IOExceptionnull
System.ApplicationExceptionnull

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::RunTwoPhases ( ) throws System.IO.IOException, System.ApplicationException

Run the loader for two phases loading.

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.

Exceptions:
System.IO.IOExceptionnull
System.ApplicationExceptionnull

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::SetAttributePositions ( com.sparsity.dex.gdb.Int32List  attrsPos)

Sets the list of attribute positions.

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

Parameters:
attrsPosnull

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::SetAttributes ( com.sparsity.dex.gdb.AttributeList  attrs)

Sets the list of Attributes.

Parameters:
attrs[in] Attribute identifiers to be loaded

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::SetFrequency ( int  freq)

Sets the frequency of listener notification.

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

Parameters:
freqnull

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::SetGraph ( com.sparsity.dex.gdb.Graph  g)

Sets the graph where the data will be loaded.

Parameters:
g[in] Graph.

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::SetLocale ( System.String  localeStr)

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.

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::SetLogError ( System.String  path) throws System.IO.IOException

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:
pathnull
Exceptions:
System.IO.IOExceptionIf bad things happen opening the file.

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::SetLogOff ( )

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.

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::SetRowReader ( com.sparsity.dex.io.RowReader  rr)

Sets the input data source.

Parameters:
rr[in] Input RowReader.

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::SetTimestampFormat ( System.String  timestampFormat)

Sets a specific timestamp format.

Parameters:
timestampFormatnull

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.

void com::sparsity::dex::io::TypeLoader::SetType ( int  t)

Sets the type to be loaded.

Parameters:
t[in] Type identifier.

Reimplemented in com::sparsity::dex::io::EdgeTypeLoader, and com::sparsity::dex::io::NodeTypeLoader.