]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20658 remove unused ping/getLastPing
authorPierre <pierre.guillot@sonarsource.com>
Wed, 4 Oct 2023 11:01:22 +0000 (13:01 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 4 Oct 2023 20:03:19 +0000 (20:03 +0000)
server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/AllProcessesCommands.java
server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/DefaultProcessCommands.java
server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/ProcessCommands.java
server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java
server/sonar-process/src/test/java/org/sonar/process/sharedmemoryfile/AllProcessesCommandsTest.java

index bcfccf58235717fc5d317591804c4732ed58196e..cf92409a5d6d33bb7dfa5a7d738f0bc8247c6eda 100644 (file)
@@ -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);
index b59e813548a4e13bfaf74fa78f19e0ea8e3f2157..0a0727d21e7d2c8c26797638372147ff2e0a2aff 100644 (file)
@@ -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);
index a6e3b29662679a8e05be5974cb5b242a5d0ca89c..8ae3e75ef5e8b917f5c56e3f272737de4df1e565 100644 (file)
@@ -51,10 +51,6 @@ public interface ProcessCommands {
    */
   void setOperational();
 
-  void ping();
-
-  long getLastPing();
-
   void setHttpUrl(String s);
 
   String getHttpUrl();
index cac034924bea1ad8498e0a4bfa297e0d7b5624e7..d912d9888d443dcd07088441a50b87223d56351e 100644 (file)
@@ -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) {
 
index ece5c45c94b37305e918ea72baad715ad5e7e95e..6c0d09b922e5115675ce983525854484720ef2e0 100644 (file)
@@ -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())) {