Пример #1
0
  protected void activateDeploymentUnits(ServiceDeploymentPlanner planner) {
    /*
     * Delete invalid units
     */
    planner.cleanupBadUnits();

    /*
     * Cleanup incomplete units
     */
    planner.cleanupIncompleteUnits();

    /*
     * Stop unhealthy units for service with retainIp=true
     */
    if (DataAccessor.fieldBool(
        planner.getServices().get(0), ServiceDiscoveryConstants.FIELD_SERVICE_RETAIN_IP)) {
      planner.scheduleUnhealthyUnitsStop();
    }

    /*
     * Activate all the units
     */
    startUnits(planner);

    /*
     * Delete the units that have a bad health
     */
    planner.cleanupUnhealthyUnits();

    /*
     * Cleanup unused service indexes
     */
    planner.cleanupUnusedAndDuplicatedServiceIndexes();
  }