Skip to content

Commit

Permalink
Add ActiveVersionChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Jan 10, 2025
1 parent f61784c commit 4b74c9f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@

package org.apache.shardingsphere.mode.manager.cluster.dispatch.checker;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.mode.event.DataChangedEvent;
import org.apache.shardingsphere.mode.manager.ContextManager;

/**
* Active version checker.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ActiveVersionChecker {

/**
* Check active version.
*
* @param contextManager context manager
* @param event data changed event
*/
public static void checkActiveVersion(final ContextManager contextManager, final DataChangedEvent event) {
ShardingSpherePreconditions.checkState(event.getValue().equals(contextManager.getPersistServiceFacade().getRepository().query(event.getKey())),
Expand Down

0 comments on commit 4b74c9f

Please sign in to comment.