class_docstr: MLMDConnectionManager manages the connections to MLMD.
  
  It can connect to multiple MLMD databases.
  For each MLMD database it connects, only one connection/channel will be
  created. The connections/channels can be distinguished by the "identifier" of
  the connection config.
  
  The connection sharing begins from the time the manager instance __enter__ and
  ends on the __exit__. Manager can __enter__ multiple times; in such case the
  outermost __enter__ and __exit__ pair matters.
docstr: Get identifier for the connection config.
docstr_tok: ["Get","identifier","for","the","connection","config","."]
code: def _get_identifier(
      self, connection_config: metadata.ConnectionConfigType
  ):
      """Get identifier for the connection config."""
      if isinstance(
          connection_config, metadata_store_pb2.ConnectionConfig
      ):
          db_config = cast(
              metadata_store_pb2.ConnectionConfig, connection_config
          )
          kind = db_config.WhichOneof("config")
          if kind == "fake_database":
              return (kind,)
          elif kind == "mysql":
              return (
                  kind,
                  db_config.mysql.host,
                  db_config.mysql.port,
                  db_config.mysql.database,
              )
          elif kind == "sqlite":
              return (
                  kind,
                  db_config.sqlite.filename_uri,
                  db_config.sqlite.connection_mode,
              )
      if isinstance(
          connection_config,
          metadata_store_pb2.MetadataStoreClientConfig,
      ):
          client_config = cast(
              metadata_store_pb2.MetadataStoreClientConfig,
              connection_config,
          )
          return ("grpc_client", client_config.host, client_config.port)
      raise NotImplementedError(
          f"Unknown connection config {connection_config}."
      )
  
file_path: tfx/tfx/orchestration/mlmd_connection_manager.py
imports: import contextlib
  import types
  from typing import Optional, Type, Union, cast
  from tfx.orchestration import metadata
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling the MLMDConnectionManager obj's underlying member method code with example usage: obj._get_identifier(connection_config) and returns: str,  client_config,  client_config, kind, kind,  db_config,  db_config,  db_config, kind,  db_config,  db_config