From: Pierre Date: Wed, 4 Oct 2023 11:01:22 +0000 (+0200) Subject: SONAR-20658 remove unused ping/getLastPing X-Git-Tag: 10.3.0.82913~287 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9dcb519843a5fb14e59581d206f0ad738c433894;p=sonarqube.git SONAR-20658 remove unused ping/getLastPing --- diff --git a/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/AllProcessesCommands.java b/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/AllProcessesCommands.java index bcfccf58235..cf92409a5d6 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/AllProcessesCommands.java +++ b/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/AllProcessesCommands.java @@ -149,14 +149,6 @@ public class AllProcessesCommands implements AutoCloseable { writeByte(processNumber, OPERATIONAL_BYTE_OFFSET, OPERATIONAL); } - void ping(int processNumber) { - writeLong(processNumber, PING_BYTE_OFFSET, System.currentTimeMillis()); - } - - long getLastPing(int processNumber) { - return readLong(processNumber, PING_BYTE_OFFSET); - } - String getSystemInfoUrl(int processNumber) { byte[] urlBytes = readBytes(processNumber, SYSTEM_INFO_URL_BYTE_OFFSET, SYSTEM_INFO_URL_SIZE_IN_BYTES); return new String(urlBytes, StandardCharsets.US_ASCII).trim(); @@ -286,16 +278,6 @@ public class AllProcessesCommands implements AutoCloseable { AllProcessesCommands.this.setOperational(processNumber); } - @Override - public void ping() { - AllProcessesCommands.this.ping(processNumber); - } - - @Override - public long getLastPing() { - return AllProcessesCommands.this.getLastPing(processNumber); - } - @Override public void setHttpUrl(String s) { AllProcessesCommands.this.setSystemInfoUrl(processNumber, s); diff --git a/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/DefaultProcessCommands.java b/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/DefaultProcessCommands.java index b59e813548a..0a0727d21e7 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/DefaultProcessCommands.java +++ b/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/DefaultProcessCommands.java @@ -81,16 +81,6 @@ public class DefaultProcessCommands implements ProcessCommands, AutoCloseable { delegate.setOperational(); } - @Override - public void ping() { - delegate.ping(); - } - - @Override - public long getLastPing() { - return delegate.getLastPing(); - } - @Override public void setHttpUrl(String s) { delegate.setHttpUrl(s); diff --git a/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/ProcessCommands.java b/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/ProcessCommands.java index a6e3b296626..8ae3e75ef5e 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/ProcessCommands.java +++ b/server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/ProcessCommands.java @@ -51,10 +51,6 @@ public interface ProcessCommands { */ void setOperational(); - void ping(); - - long getLastPing(); - void setHttpUrl(String s); String getHttpUrl(); diff --git a/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java b/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java index cac034924be..d912d9888d4 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java @@ -235,16 +235,6 @@ public class ProcessEntryPointTest { operational.set(true); } - @Override - public void ping() { - - } - - @Override - public long getLastPing() { - return 0; - } - @Override public void setHttpUrl(String s) { diff --git a/server/sonar-process/src/test/java/org/sonar/process/sharedmemoryfile/AllProcessesCommandsTest.java b/server/sonar-process/src/test/java/org/sonar/process/sharedmemoryfile/AllProcessesCommandsTest.java index ece5c45c94b..6c0d09b922e 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/sharedmemoryfile/AllProcessesCommandsTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/sharedmemoryfile/AllProcessesCommandsTest.java @@ -85,19 +85,6 @@ public class AllProcessesCommandsTest { } } - @Test - public void write_and_read_ping() throws IOException { - try (AllProcessesCommands commands = new AllProcessesCommands(temp.newFolder())) { - int offset = 5; - - assertThat(readLong(commands, offset)).isZero(); - - long currentTime = System.currentTimeMillis(); - commands.ping(PROCESS_NUMBER); - assertThat(readLong(commands, offset)).isGreaterThanOrEqualTo(currentTime); - } - } - @Test public void write_and_read_system_info_url() throws IOException { try (AllProcessesCommands commands = new AllProcessesCommands(temp.newFolder())) {