Builds OutputPluginState object from a DB row.

def _HuntOutputPluginStateFromRow(self, row):
    """Builds OutputPluginState object from a DB row."""
    plugin_name, plugin_args_bytes, plugin_state_bytes = row

    plugin_descriptor = rdf_output_plugin.OutputPluginDescriptor(
        plugin_name=plugin_name)
    if plugin_args_bytes is not None:
      plugin_args_cls = plugin_descriptor.GetPluginArgsClass()
      # If plugin_args_cls is None, we have no clue what class plugin args
      # should be and therefore no way to deserialize it. This can happen if
      # a plugin got renamed or removed, for example. In this case we
      # still want to get plugin's definition and state back and not fail hard,
      # so that all other plugins can be read.
      if plugin_args_cls is not None:
        plugin_descriptor.plugin_args = plugin_args_cls.FromSerializedString(
            plugin_args_bytes)

    plugin_state = rdf_protodict.AttributedDict.FromSerializedString(
        plugin_state_bytes)
    return rdf_flow_runner.OutputPluginState(
        plugin_descriptor=plugin_descriptor, plugin_state=plugin_state)