Class ChangeRequestHttpSyncer<T>

java.lang.Object
org.apache.druid.server.coordination.ChangeRequestHttpSyncer<T>

public class ChangeRequestHttpSyncer<T> extends Object
This class facilitates the usage of long-polling HTTP endpoints powered by ChangeRequestHistory. For example HttpServerInventoryView uses it to keep segment state in sync with data nodes which expose the segment state via HTTP endpoint in SegmentListerResource.getSegments(long, long, long, javax.servlet.http.HttpServletRequest).
  • Field Details

  • Constructor Details

  • Method Details

    • start

      public void start()
    • stop

      public void stop()
    • awaitInitialization

      public boolean awaitInitialization() throws InterruptedException
      Waits for the first successful sync with this server up to maxDurationToWaitForSync.
      Throws:
      InterruptedException
    • isInitialized

      public boolean isInitialized()
      Whether this server has been synced successfully at least once.
    • getDebugInfo

      public Map<String,Object> getDebugInfo()
      Returns debugging information for printing, must not be used for any other purpose.
    • needsReset

      public boolean needsReset()
      Whether this syncer should be reset. This method returning true typically indicates a problem with the sync scheduler.
      Returns:
      true if the delay since the last request to the server (or since syncer start in case of no request to the server) has exceeded maxDelayBetweenSyncRequests.
    • getUnstableTimeMillis

      public long getUnstableTimeMillis()
    • isSyncedSuccessfully

      public boolean isSyncedSuccessfully()
      Returns:
      true if there have been no sync failures recently and the last successful sync was not more than maxDurationToWaitForSync ago.
    • isExecutorShutdown

      public boolean isExecutorShutdown()