Interface RaftGroupManagerApi

All Known Implementing Classes:
RaftGroupManager

public interface RaftGroupManagerApi
Narrow interface for routing operations to per-key or per-name Raft groups.

Consumers that only need to resolve a RaftNodeApi for a given key or group name depend on this interface rather than on the concrete RaftGroupManager. Tests substitute a Mockito mock of this interface; mocking the concrete RaftGroupManager is forbidden by the project testing policy.

  • Method Details

    • getOrCreateGroup

      RaftNodeApi getOrCreateGroup(String groupName)
      Gets or creates a Raft group by name. Thread-safe; lazy creation.
    • getGroupForKey

      RaftNodeApi getGroupForKey(String key)
      Routes a key to its Raft group via consistent hashing. Same key always routes to the same group.
    • getDefaultGroup

      RaftNodeApi getDefaultGroup()
      Gets the default group ("raft-0").
    • getGroupIfExists

      @Nullable RaftNodeApi getGroupIfExists(String groupName)
      Gets a specific Raft group by name, or null if it has not been instantiated yet.
    • hasGroup

      boolean hasGroup(String groupName)
      Returns true if a group with the given name has already been instantiated.
    • configuredGroupCount

      default int configuredGroupCount()
      Returns the configured upper bound for Raft group IDs.

      Implementations that do not expose a fixed group count may return Integer.MAX_VALUE, which preserves permissive validation for tests and custom managers.