G2Engine Initialization

Initialization

init

init() initializes the G2Engine object. It must be called prior to any other calls.

g2_engine.init(engine_name, senzing_engine_configuration_json, verbose_logging)
Parameters
  • engine_name: (str) A short name given to this instance of the G2Engine object.
  • senzing_engine_configuration_json: A JSON string containing configuration parameters.
  • verbose_logging: (bool [optional]) (default False) Enables diagnostic logging. False for no logging; True for logging.
Click to expand init() example

initWithConfigID

initWithConfigID() creates and initializes a Senzing instance with a specific configuration.

g2_engine.initWithConfigID(engine_name, senzing_engine_configuration_json, config_id_bytearray, verbose_logging)
Parameters
  • engine_name: (str) A short name given to this instance of the G2Engine object.
  • senzing_engine_configuration_json: (str) A JSON string containing configuration parameters.
  • config_id_bytearray: (bytearray) The configID used to initialize the engine.
  • verbose_logging: (bool [optional]) (default False) Enables diagnostic logging. False for no logging; True for logging.
Click to expand initWithConfigID() example

reinit

reinit() reinitializes the engine using a specified initConfigID.

Parameters
  • config_id_bytearray: (bytearray) The configID used to initialize the engine.
Click to expand reinit() example

destroy

destroy() releases resources and performs cleanup for the G2Engine object and any in-memory configurations.

g2_engine.destroy()
Click to expand destroy() example

primeEngine

primeEngine() Initializes high resource consumption components of Senzing used in some functions. If this call is not made, these resources are initialized the first time they are needed and can cause unusually long processing times the first time a function is called that requries these resources.

g2_engine.primeEngine()
Click to expand primeEngine() example

getActiveConfigID

getActiveConfigID() returns an identifier for the currently active Senzing engine configuration, and assign a long integer to a user-designated variable.

g2_engine.getActiveConfigID(config_id_bytearray)
Parameters
  • configuration_id_bytearray: (bytearray) The identifier value for the engine configuration.
Click to expand getActiveConfigID() example

exportConfig

exportConfig() retrieves the Senzing engine’s configuration, and assigns a JSON document to a user-designated buffer containing all relevant configuration information.

g2_engine.exportConfig(response_bytearray, config_id_bytearray)
Parameters
  • response_bytearray: (bytearray) Object to store the output of the method.
  • config_id_bytearray: (bytearray) The identifier value for the engine configuration can be returned here.
Click to expand exportConfig() example