Class CassandraDaemon

java.lang.Object
org.apache.cassandra.service.CassandraDaemon

public class CassandraDaemon extends Object
The CassandraDaemon is an abstraction for a Cassandra daemon service, which defines not only a way to activate and deactivate it, but also hooks into its lifecycle methods (see setup(), start(), stop() and setup()).
  • Field Details

  • Constructor Details

    • CassandraDaemon

      public CassandraDaemon()
    • CassandraDaemon

      public CassandraDaemon(boolean runManaged)
  • Method Details

    • getInstanceForTesting

      public static CassandraDaemon getInstanceForTesting()
    • nativeTransportService

      public NativeTransportService nativeTransportService()
    • setup

      protected void setup()
      This is a hook for concrete daemons to initialize themselves suitably. Subclasses should override this to finish the job (listening on ports, etc.)
    • runStartupChecks

      public void runStartupChecks()
    • migrateSystemDataIfNeeded

      public void migrateSystemDataIfNeeded() throws IOException
      Checks if the data of the local system keyspaces need to be migrated to a different location.
      Throws:
      IOException
    • setupVirtualKeyspaces

      public void setupVirtualKeyspaces()
    • scrubDataDirectories

      public void scrubDataDirectories() throws StartupException
      Throws:
      StartupException
    • initializeClientTransports

      public void initializeClientTransports()
    • completeSetup

      public void completeSetup()
    • setupCompleted

      public boolean setupCompleted()
    • logSystemInfo

      public static void logSystemInfo(org.slf4j.Logger logger)
    • init

      public void init(String[] arguments) throws IOException
      Initialize the Cassandra Daemon based on the given Commons Daemon-specific arguments. To clarify, this is a hook for JSVC.
      Parameters:
      arguments - the arguments passed in from JSVC
      Throws:
      IOException
    • start

      public void start()
      Start the Cassandra Daemon, assuming that it has already been initialized via init(String[]) Hook for JSVC
    • stop

      public void stop()
      Stop the daemon, ideally in an idempotent manner. Hook for JSVC / Procrun
    • destroyClientTransports

      public void destroyClientTransports()
    • destroy

      public void destroy()
      Clean up all resources obtained during the lifetime of the daemon. This is a hook for JSVC.
    • activate

      public void activate()
      A convenience method to initialize and start the daemon in one shot.
    • registerNativeAccess

      public static void registerNativeAccess() throws NotCompliantMBeanException
      Throws:
      NotCompliantMBeanException
    • applyConfig

      public void applyConfig()
    • validateTransportsCanStart

      public void validateTransportsCanStart()
    • startNativeTransport

      public void startNativeTransport()
    • stopNativeTransport

      @Deprecated(since="5.0.0") public void stopNativeTransport()
      Deprecated.
    • stopNativeTransport

      public void stopNativeTransport(boolean force)
    • isNativeTransportRunning

      public boolean isNativeTransportRunning()
    • deactivate

      public void deactivate()
      A convenience method to stop and destroy the daemon in one shot.
    • stop

      public static void stop(String[] args)
    • main

      public static void main(String[] args)
    • clearConnectionHistory

      public void clearConnectionHistory()