def Run(self):
    """Initialize the data_store."""
    global DB  # pylint: disable=global-statement

    if flags.FLAGS.list_storage:
      for name, cls in DataStore.classes.items():
        print "%s\t\t%s" % (name, cls.__doc__)

      sys.exit(0)

    try:
      cls = DataStore.GetPlugin(config_lib.CONFIG["Datastore.implementation"])
    except KeyError:
      raise RuntimeError("No Storage System %s found." %
                         config_lib.CONFIG["Datastore.implementation"])

    DB = cls()  # pylint: disable=g-bad-name
    DB.Initialize()
    atexit.register(DB.Flush)
    monitor_port = config_lib.CONFIG["Monitoring.http_port"]
    if monitor_port != 0:
      stats.STATS.RegisterGaugeMetric("datastore_size", int,
                                      docstring="Size of data store in bytes",
                                      units="BYTES")
      DB.InitializeMonitorThread()
dataset/ETHPy150Open google/grr/grr/lib/data_store.py/DataStoreInit.Run/original