예제 #1
0
파일: macrothread.py 프로젝트: DaMSL/ddc
 def start_local_catalog(self, isaggressive=False):
     settings = systemsettings()
     service = RedisService(settings.name, isaggressive=False)
     self.localcatalogserver = service.start()
     logging.info("Catalog service started as a background thread. Waiting on it...")
     timeout = settings.CATALOG_STARTUP_DELAY
     while timeout > 0:
       if service.ping():
         return True
       logging.info("Waiting on the Server. Will timeout in %d secs.", timeout)
       time.sleep(1)
       timeout -= 1
     self.localcatalogserver = None
     return False
예제 #2
0
파일: overlay.py 프로젝트: DaMSL/ddc
        if args.name is None:
            logging.error(
                'ERROR. Service requires a application name with corresponding input (json) confile file'
            )
            sys.exit()
        service = CacheService(args.name)
    elif args.service == 'alluxio':
        if args.name is None:
            logging.error(
                'ERROR. Service requires a application name with corresponding input (json) confile file'
            )
            sys.exit()
        service = AlluxioService(args.name, role)
    else:
        logging.error('Unrecognized Service. Quitting')
        sys.exit()

    if args.command == 'start':
        logging.info('Service: START')
        t = service.start()
        if t is not None:
            t.join()
        else:
            logging.error("Service failed to start")
    elif args.command == 'stop':
        logging.info('Service: STOP')
        service.stop()
    else:
        logging.warning("Command not recognized:  %s", args.command)

    logging.debug('Execution Complete for: %s', __file__)
예제 #3
0
파일: overlay.py 프로젝트: DaMSL/ddc
      sys.exit()
    service = RedisService(args.name, isaggressive=True, role=args.role)
  elif args.service == 'cache':
    if args.name is None:
      logging.error('ERROR. Service requires a application name with corresponding input (json) confile file')
      sys.exit()
    service = CacheService(args.name)
  elif args.service == 'alluxio':
    if args.name is None:
      logging.error('ERROR. Service requires a application name with corresponding input (json) confile file')
      sys.exit()
    service = AlluxioService(args.name, role)
  else:
    logging.error('Unrecognized Service. Quitting')
    sys.exit()


  if args.command == 'start':
    logging.info('Service: START')
    t = service.start()
    if t is not None:
      t.join()
    else:
      logging.error("Service failed to start")
  elif args.command == 'stop':
    logging.info('Service: STOP')
    service.stop()
  else:
    logging.warning("Command not recognized:  %s", args.command)

  logging.debug('Execution Complete for: %s', __file__)