Interface AssignmentPolicy
- All Known Implementing Classes:
RoundRobinAssignmentPolicy
public interface AssignmentPolicy
Implementations provide a policy for assigning users to Persistent Query replicas.
-
Method Summary
Modifier and TypeMethodDescriptionvoidafterConfigurationChanged(@NotNull PersistentQueryConfiguration prev, @NotNull PersistentQueryConfiguration current) Notify the policy that the query configuration changed.voidbeforeConfigurationChanged(@NotNull PersistentQueryConfiguration prev, @NotNull PersistentQueryConfiguration current) Notify the policy that the query configuration changed.intgetOrAssignSlot(@NotNull UserContext user, @NotNull PersistentQueryInfo queryInfo) Get the slot assignment, or assign a slot for the specified user and query.
-
Method Details
-
getOrAssignSlot
int getOrAssignSlot(@NotNull @NotNull UserContext user, @NotNull @NotNull PersistentQueryInfo queryInfo) Get the slot assignment, or assign a slot for the specified user and query.- Parameters:
user- The user to assignqueryInfo- the QueryInfo to assign a slot for- Returns:
- the slot assignment for the user.
-
beforeConfigurationChanged
void beforeConfigurationChanged(@NotNull @NotNull PersistentQueryConfiguration prev, @NotNull @NotNull PersistentQueryConfiguration current) Notify the policy that the query configuration changed.- Parameters:
prev- the old configurationcurrent- the new configuration
-
afterConfigurationChanged
void afterConfigurationChanged(@NotNull @NotNull PersistentQueryConfiguration prev, @NotNull @NotNull PersistentQueryConfiguration current) Notify the policy that the query configuration changed.- Parameters:
prev- the old configurationcurrent- the new configuration
-