/** * Verify that that a service is in a given state. * * @param currentState * the desired state * @throws IllegalStateException * if the service state is different from * the desired state */ private void ensureCurrentState(STATE currentState) { ServiceOperations.ensureCurrentState(state, currentState); }
/** * Initialize then start a service. * <p/> * The service state is checked <i>before</i> the operation begins. * This process is <i>not</i> thread safe. * @param service a service that must be in the state * {@link Service.STATE#NOTINITED} * @param configuration the configuration to initialize the service with * @throws RuntimeException on a state change failure * @throws IllegalStateException if the service is in the wrong state */ public static void deploy(Service service, HiveConf configuration) { init(service, configuration); start(service); }
/** * Stop a service; if it is null do nothing. Exceptions are caught and * logged at warn level. (but not Throwables). This operation is intended to * be used in cleanup operations * * @param service a service; may be null * @return any exception that was caught; null if none was. */ public static Exception stopQuietly(Service service) { try { stop(service); } catch (Exception e) { LOG.warn("When stopping the service " + service.getName() + " : " + e, e); return e; } return null; }
/** * Initialize then start a service. * <p/> * The service state is checked <i>before</i> the operation begins. * This process is <i>not</i> thread safe. * @param service a service that must be in the state * {@link Service.STATE#NOTINITED} * @param configuration the configuration to initialize the service with * @throws RuntimeException on a state change failure * @throws IllegalStateException if the service is in the wrong state */ public static void deploy(Service service, HiveConf configuration) { init(service, configuration); start(service); }
/** * Start a service. * <p/> * The service state is checked <i>before</i> the operation begins. * This process is <i>not</i> thread safe. * @param service a service that must be in the state * {@link Service.STATE#INITED} * @throws RuntimeException on a state change failure * @throws IllegalStateException if the service is in the wrong state */ public static void start(Service service) { Service.STATE state = service.getServiceState(); ensureCurrentState(state, Service.STATE.INITED); service.start(); }
/** * Stop a service; if it is null do nothing. Exceptions are caught and * logged at warn level. (but not Throwables). This operation is intended to * be used in cleanup operations * * @param service a service; may be null * @return any exception that was caught; null if none was. */ public static Exception stopQuietly(Service service) { try { stop(service); } catch (Exception e) { LOG.warn("When stopping the service " + service.getName() + " : " + e, e); return e; } return null; }
/** * Initialize then start a service. * <p/> * The service state is checked <i>before</i> the operation begins. * This process is <i>not</i> thread safe. * @param service a service that must be in the state * {@link Service.STATE#NOTINITED} * @param configuration the configuration to initialize the service with * @throws RuntimeException on a state change failure * @throws IllegalStateException if the service is in the wrong state */ public static void deploy(Service service, HiveConf configuration) { init(service, configuration); start(service); }
/** * Initialize a service. * <p/> * The service state is checked <i>before</i> the operation begins. * This process is <i>not</i> thread safe. * @param service a service that must be in the state * {@link Service.STATE#NOTINITED} * @param configuration the configuration to initialize the service with * @throws RuntimeException on a state change failure * @throws IllegalStateException if the service is in the wrong state */ public static void init(Service service, HiveConf configuration) { Service.STATE state = service.getServiceState(); ensureCurrentState(state, Service.STATE.NOTINITED); service.init(configuration); }
/** * Stop a service; if it is null do nothing. Exceptions are caught and * logged at warn level. (but not Throwables). This operation is intended to * be used in cleanup operations * * @param service a service; may be null * @return any exception that was caught; null if none was. */ public static Exception stopQuietly(Service service) { try { stop(service); } catch (Exception e) { LOG.warn("When stopping the service " + service.getName() + " : " + e, e); return e; } return null; }
/** * Initialize then start a service. * <p/> * The service state is checked <i>before</i> the operation begins. * This process is <i>not</i> thread safe. * @param service a service that must be in the state * {@link Service.STATE#NOTINITED} * @param configuration the configuration to initialize the service with * @throws RuntimeException on a state change failure * @throws IllegalStateException if the service is in the wrong state */ public static void deploy(Service service, HiveConf configuration) { init(service, configuration); start(service); }
/** * Verify that that a service is in a given state. * * @param currentState * the desired state * @throws IllegalStateException * if the service state is different from * the desired state */ private void ensureCurrentState(STATE currentState) { ServiceOperations.ensureCurrentState(state, currentState); }
/** * Stop a service; if it is null do nothing. Exceptions are caught and * logged at warn level. (but not Throwables). This operation is intended to * be used in cleanup operations * * @param service a service; may be null * @return any exception that was caught; null if none was. */ public static Exception stopQuietly(Service service) { try { stop(service); } catch (Exception e) { LOG.warn("When stopping the service " + service.getName() + " : " + e, e); return e; } return null; }
/** * Initialize then start a service. * * The service state is checked <i>before</i> the operation begins. * This process is <i>not</i> thread safe. * @param service a service that must be in the state * {@link Service.STATE#NOTINITED} * @param configuration the configuration to initialize the service with * @throws RuntimeException on a state change failure * @throws IllegalStateException if the service is in the wrong state */ public static void deploy(Service service, HiveConf configuration) { init(service, configuration); start(service); }
/** * Verify that a service is in a given state. * * @param currentState * the desired state * @throws IllegalStateException * if the service state is different from * the desired state */ private void ensureCurrentState(STATE currentState) { ServiceOperations.ensureCurrentState(state, currentState); }
/** * Stop a service; if it is null do nothing. Exceptions are caught and * logged at warn level. (but not Throwables). This operation is intended to * be used in cleanup operations * * @param service a service; may be null * @return any exception that was caught; null if none was. */ public static Exception stopQuietly(Service service) { try { stop(service); } catch (Exception e) { LOG.warn("When stopping the service " + service.getName() + " : " + e, e); return e; } return null; }
/** * Initialize then start a service. * * The service state is checked <i>before</i> the operation begins. * This process is <i>not</i> thread safe. * @param service a service that must be in the state * {@link Service.STATE#NOTINITED} * @param configuration the configuration to initialize the service with * @throws RuntimeException on a state change failure * @throws IllegalStateException if the service is in the wrong state */ public static void deploy(Service service, HiveConf configuration) { init(service, configuration); start(service); }
/** * Verify that a service is in a given state. * * @param currentState * the desired state * @throws IllegalStateException * if the service state is different from * the desired state */ private void ensureCurrentState(STATE currentState) { ServiceOperations.ensureCurrentState(state, currentState); }
/** * Stop a service; if it is null do nothing. Exceptions are caught and * logged at warn level. (but not Throwables). This operation is intended to * be used in cleanup operations * * @param service a service; may be null * @return any exception that was caught; null if none was. */ public static Exception stopQuietly(Service service) { try { stop(service); } catch (Exception e) { LOG.warn("When stopping the service " + service.getName() + " : " + e, e); return e; } return null; }
/** * Verify that that a service is in a given state. * * @param currentState * the desired state * @throws IllegalStateException * if the service state is different from * the desired state */ private void ensureCurrentState(STATE currentState) { ServiceOperations.ensureCurrentState(state, currentState); }
/** * Verify that that a service is in a given state. * * @param currentState * the desired state * @throws IllegalStateException * if the service state is different from * the desired state */ private void ensureCurrentState(STATE currentState) { ServiceOperations.ensureCurrentState(state, currentState); }