Interface ResourceStatePolicy


  • public interface ResourceStatePolicy
    ResourceStatePolicy is used to determine if the state of a resource is "up" or "down". For resources like data nodes and disks, up and down mean available and unavailable, respectively.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isDown()
      Checks to see if the state is down (soft or hard).
      boolean isHardDown()
      Checks to see if the state is permanently down.
      void onError()
      Should be called by the caller every time an error is encountered for the corresponding resource.
      void onHardDown()
      Should be called if the caller knows outside of the policy that the resource has gone down.
      void onHardUp()
      Should be called if the caller knows outside of the policy that the resource is up.
      void onSuccess()
      May be called by the caller when the resource is responsive.
    • Method Detail

      • isHardDown

        boolean isHardDown()
        Checks to see if the state is permanently down.
        Returns:
        true if the state is permanently down, false otherwise.
      • isDown

        boolean isDown()
        Checks to see if the state is down (soft or hard).
        Returns:
        true if the state is down, false otherwise.
      • onError

        void onError()
        Should be called by the caller every time an error is encountered for the corresponding resource.
      • onSuccess

        void onSuccess()
        May be called by the caller when the resource is responsive.
      • onHardDown

        void onHardDown()
        Should be called if the caller knows outside of the policy that the resource has gone down.
      • onHardUp

        void onHardUp()
        Should be called if the caller knows outside of the policy that the resource is up.