SparkseePython  6.0.2
Public Member Functions | List of all members
sparksee.NodeTypeLoader Class Reference

NodeTypeLoader class. More...

Inheritance diagram for sparksee.NodeTypeLoader:
Inheritance graph
Collaboration diagram for sparksee.NodeTypeLoader:
Collaboration graph

Public Member Functions

def run (self)
 See the TypeLoader class Run method. More...
 
def set_log_error (self, path)
 Sets a log error file. More...
 
def set_type (self, type)
 Sets the type to be loaded. More...
 
def set_locale (self, locale_str)
 Sets the locale that will be used to read the data. More...
 
def set_timestamp_format (self, timestamp_format)
 Sets a specific timestamp format. More...
 
def set_attributes (self, attrs)
 Sets the list of Attributes. More...
 
def __init__ (self)
 Creates a new instance.
 
def register (self, tel)
 Registers a new listener. More...
 
def set_frequency (self, freq)
 Sets the frequency of listener notification. More...
 
def __init__ (self, row_reader, graph, type, attrs, attrs_pos)
 Creates a new instance. More...
 
def run_two_phases (self)
 See the TypeLoader class RunTwoPhases method. More...
 
def set_row_reader (self, rr)
 Sets the input data source. More...
 
def set_attribute_positions (self, attrs_pos)
 Sets the list of attribute positions. More...
 
def set_graph (self, graph)
 Sets the graph where the data will be loaded. More...
 
def run_n_phases (self, partitions)
 See the TypeLoader class RunNPhases method. More...
 
def set_log_off (self)
 Truns off all the error reporting. More...
 

Detailed Description

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

Constructor & Destructor Documentation

def sparksee.NodeTypeLoader.__init__ (   self,
  row_reader,
  graph,
  type,
  attrs,
  attrs_pos 
)

Creates a new instance.

Parameters
row_reader[in] Input RowReader.
graph[in] Graph.
type[in] Type identifier.
attrs[in] Attribute identifiers to be loaded.
attrs_pos[in] Attribute positions (column index >=0).

References sparksee.NodeTypeLoader.__init__().

Member Function Documentation

def sparksee.NodeTypeLoader.register (   self,
  tel 
)

Registers a new listener.

Parameters
telTypeLoaderListener to be registered.
def sparksee.NodeTypeLoader.run (   self)

See the TypeLoader class Run method.

Exceptions
RuntimeErrornull
IOErrornull
def sparksee.NodeTypeLoader.run_n_phases (   self,
  partitions 
)

See the TypeLoader class RunNPhases method.

Parameters
partitionsnull
Exceptions
RuntimeErrornull
IOErrornull
def sparksee.NodeTypeLoader.run_two_phases (   self)

See the TypeLoader class RunTwoPhases method.

Exceptions
RuntimeErrornull
IOErrornull
def sparksee.NodeTypeLoader.set_attribute_positions (   self,
  attrs_pos 
)

Sets the list of attribute positions.

Parameters
attrs_pos[in] Attribute positions (column index >=0).
def sparksee.NodeTypeLoader.set_attributes (   self,
  attrs 
)

Sets the list of Attributes.

Parameters
attrs[in] Attribute identifiers to be loaded
def sparksee.NodeTypeLoader.set_frequency (   self,
  freq 
)

Sets the frequency of listener notification.

Parameters
freq[in] Frequency in number of rows managed to notify progress to all listeners
def sparksee.NodeTypeLoader.set_graph (   self,
  graph 
)

Sets the graph where the data will be loaded.

Parameters
graph[in] Graph.
def sparksee.NodeTypeLoader.set_locale (   self,
  locale_str 
)

Sets the locale that will be used to read the data.

It should match the locale used in the rowreader.

Parameters
locale_str[in] The locale string for the read data. See CSVReader.
def sparksee.NodeTypeLoader.set_log_error (   self,
  path 
)

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
IOErrorIf bad things happen opening the file.
def sparksee.NodeTypeLoader.set_log_off (   self)

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.

def sparksee.NodeTypeLoader.set_row_reader (   self,
  rr 
)

Sets the input data source.

Parameters
rr[in] Input RowReader.
def sparksee.NodeTypeLoader.set_timestamp_format (   self,
  timestamp_format 
)

Sets a specific timestamp format.

Parameters
timestamp_format[in] A string with the timestamp format definition.
def sparksee.NodeTypeLoader.set_type (   self,
  type 
)

Sets the type to be loaded.

Parameters
type[in] Type identifier.