Clean the names of properties, fixes #221

This commit is contained in:
Guillaume Nodet
2020-11-16 09:50:17 +01:00
parent 1ac48446de
commit 668d4e4526
9 changed files with 87 additions and 47 deletions

View File

@@ -424,14 +424,14 @@ public class DaemonMavenCli {
}
List<File> extClassPath = Stream
.of(Environment.DAEMON_EXT_CLASSPATH.asString().split(","))
.of(Environment.MVND_EXT_CLASSPATH.asString().split(","))
.map(File::new)
.collect(Collectors.toList());
CoreExtensionEntry coreEntry = CoreExtensionEntry.discoverFrom(coreRealm);
List<CoreExtension> extensions = Stream
.of(Environment.DAEMON_CORE_EXTENSIONS.asString().split(","))
.of(Environment.MVND_CORE_EXTENSIONS.asString().split(","))
.filter(s -> s != null && !s.isEmpty())
.map(s -> {
String[] parts = s.split(":");

View File

@@ -54,7 +54,7 @@ public class DaemonExpiration {
return any(
any(gcTrashing(), lowHeapSpace(), lowNonHeap()),
all(compatible(), duplicateGracePeriod(), notMostRecentlyUsed()),
idleTimeout(Environment.DAEMON_IDLE_TIMEOUT.asDuration()),
idleTimeout(Environment.MVND_IDLE_TIMEOUT.asDuration()),
all(duplicateGracePeriod(), notMostRecentlyUsed(), lowMemory(0.05)),
registryUnavailable());
}
@@ -83,7 +83,7 @@ public class DaemonExpiration {
}
static DaemonExpirationStrategy duplicateGracePeriod() {
return idleTimeout(Environment.DAEMON_DUPLICATE_DAEMON_GRACE_PERIOD.asDuration());
return idleTimeout(Environment.MVND_DUPLICATE_DAEMON_GRACE_PERIOD.asDuration());
}
static DaemonExpirationStrategy idleTimeout(Duration timeout) {

View File

@@ -105,11 +105,11 @@ public class Server implements AutoCloseable, Runnable {
} catch (Throwable t) {
LOGGER.warn("Unable to ignore INT and TSTP signals", t);
}
this.uid = Environment.DAEMON_UID.asString();
this.uid = Environment.MVND_UID.asString();
this.noDaemon = Environment.MVND_NO_DAEMON.asBoolean();
try {
cli = new DaemonMavenCli();
registry = new DaemonRegistry(Environment.DAEMON_REGISTRY.asPath());
registry = new DaemonRegistry(Environment.MVND_REGISTRY.asPath());
socket = ServerSocketChannel.open().bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
executor = Executors.newScheduledThreadPool(1);
strategy = DaemonExpiration.master();
@@ -184,7 +184,7 @@ public class Server implements AutoCloseable, Runnable {
public void run() {
try {
Duration expirationCheckDelay = Environment.DAEMON_EXPIRATION_CHECK_DELAY.asDuration();
Duration expirationCheckDelay = Environment.MVND_EXPIRATION_CHECK_DELAY.asDuration();
executor.scheduleAtFixedRate(this::expirationCheck,
expirationCheckDelay.toMillis(), expirationCheckDelay.toMillis(), TimeUnit.MILLISECONDS);
LOGGER.info("Daemon started");
@@ -424,7 +424,7 @@ public class Server implements AutoCloseable, Runnable {
private void handle(DaemonConnection connection, BuildRequest buildRequest) {
updateState(Busy);
try {
Duration keepAlive = Environment.DAEMON_KEEP_ALIVE.asDuration();
Duration keepAlive = Environment.MVND_KEEP_ALIVE.asDuration();
LOGGER.info("Executing request");