import org.sonar.process.cluster.health.SharedHealthStateImpl;
import org.sonar.process.cluster.hz.HazelcastMember;
-import static java.lang.String.format;
-
public class HealthStateSharingImpl implements HealthStateSharing {
private static final Logger LOG = LoggerFactory.getLogger(HealthStateSharingImpl.class);
}
}
} catch (InterruptedException ie) {
- LOG.warn(format("Termination of pool %s failed", HealthStateSharingImpl.class.getSimpleName()), ie);
+ LOG.warn("Termination of pool {} failed", HealthStateSharingImpl.class.getSimpleName(), ie);
// (Re-)Cancel if current thread also interrupted
executorService.shutdownNow();
Thread.currentThread().interrupt();
try {
this.process = commandLauncher.get();
} catch (RuntimeException e) {
- LOG.error(format("Fail to launch process [%s]", processId.getKey()), e);
+ LOG.error("Fail to launch process [{}]", processId.getKey(), e);
lifecycle.tryToMoveTo(Lifecycle.State.STOPPED);
throw e;
}
process.waitFor(timeout, timeoutUnit);
} catch (InterruptedException e) {
// can't wait for the termination of process. Let's assume it's down.
- LOG.warn(format("Interrupted while stopping process %s", processId), e);
+ LOG.warn("Interrupted while stopping process {}", processId, e);
Thread.currentThread().interrupt();
} catch (Throwable e) {
LOG.error("Can not ask for graceful stop of process {}", processId, e);
import java.util.concurrent.TimeUnit;
import org.sonar.process.sharedmemoryfile.ProcessCommands;
-import static java.lang.String.format;
-
/**
* Gracefully stops process in a timely fashion
*/
Future future = executor.submit(monitored::stop);
future.get(terminationTimeoutMs, TimeUnit.MILLISECONDS);
} catch (Exception e) {
- LoggerFactory.getLogger(getClass()).error(format("Can not stop in %dms", terminationTimeoutMs), e);
+ LoggerFactory.getLogger(getClass()).error("Can not stop in {}ms", terminationTimeoutMs, e);
}
executor.shutdownNow();
commands.endWatch();