def __init__(self, storage_writer, path):
    """Initializes a storage merge reader.

    Args:
      storage_writer (StorageWriter): storage writer.
      path (str): path to the input file.

    Raises:
      IOError: if the input file cannot be opened.
      RuntimeError: if an add container method is missing.
    """
    super(SQLiteStorageMergeReader, self).__init__(storage_writer)
    self._active_container_type = None
    self._active_cursor = None
    self._add_active_container_method = None
    self._add_container_type_methods = {}
    self._compression_format = definitions.COMPRESSION_FORMAT_NONE
    self._connection = None
    self._container_types = None
    self._cursor = None
    self._event_data_identifier_mappings = {}
    self._path = path

    # Create a runtime lookup table for the add container type method. This
    # prevents having to create a series of if-else checks for container types.
    # The table is generated at runtime as there are no forward function
    # declarations in Python.
    for container_type, method_name in self._ADD_CONTAINER_TYPE_METHODS.items():
      method = getattr(self, method_name, None)
      if not method:
        raise RuntimeError(
            'Add method missing for container type: {0:s}'.format(
                container_type))

      self._add_container_type_methods[container_type] = method
def __init__ ( self , storage_writer , path ) : super ( SQLiteStorageMergeReader , self ) . __init__ ( storage_writer ) self . _active_container_type = None self . _active_cursor = None self . _add_active_container_method = None self . _add_container_type_methods = { } self . _compression_format = definitions . COMPRESSION_FORMAT_NONE self . _connection = None self . _container_types = None self . _cursor = None self . _event_data_identifier_mappings = { } self . _path = path for container_type , method_name in self . _ADD_CONTAINER_TYPE_METHODS . items ( ) : method = getattr ( self , method_name , None ) if not method : raise RuntimeError ( 'Add method missing for container type: {0:s}' . format ( container_type ) ) self . _add_container_type_methods [ container_type ] = method
Initializes a storage merge reader.

    Args:
      storage_writer (StorageWriter): storage writer.
      path (str): path to the input file.

    Raises:
      IOError: if the input file cannot be opened.
      RuntimeError: if an add container method is missing.