-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add keeper container comparator * add keeper instance in check action * add keeper info stats action * get all dc meta from console * add info action for redis * add redis instance for used memory * add redis info action when leader changes * temp * auto migrate keepers * add overload migration pages * fix keeper cotainer meta comparator test fail * fix DefaultDcMetaChangeManagerTest fail * add test for keeper info stats action * add test for redisInfoAction * add test for keeperContainerMetaComparator * temp * temp * add test for DefaultKeeperContainerUsedInfoAnalyzer * add test for AutoMigrateOverloadKeeperContainerAction * add keeper session manager * fix bean circle * add keeper related action when start * fix checker not report keeper result * add log and update choose redis strategy * add keeper session manager * adjust interval of keeper related actions * add alert when keeper migrate * clean expired keeper container used info * update session manager * update all dc meta of current dc with metacache
- Loading branch information
1 parent
42109dd
commit c346720
Showing
139 changed files
with
5,691 additions
and
515 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,4 @@ hs_err_pid* | |
|
||
# npm | ||
node_modules | ||
*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...c/main/java/com/ctrip/xpipe/redis/checker/healthcheck/KeeperHealthCheckActionFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.ctrip.xpipe.redis.checker.healthcheck; | ||
|
||
public interface KeeperHealthCheckActionFactory <T extends HealthCheckAction> extends HealthCheckActionFactory<T, KeeperHealthCheckInstance>{ | ||
} |
4 changes: 4 additions & 0 deletions
4
.../main/java/com/ctrip/xpipe/redis/checker/healthcheck/KeeperHealthCheckActionListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.ctrip.xpipe.redis.checker.healthcheck; | ||
|
||
public interface KeeperHealthCheckActionListener <T extends ActionContext> extends HealthCheckActionListener<T, HealthCheckAction<KeeperHealthCheckInstance>> { | ||
} |
11 changes: 11 additions & 0 deletions
11
...er/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/KeeperHealthCheckInstance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.ctrip.xpipe.redis.checker.healthcheck; | ||
|
||
import com.ctrip.xpipe.api.endpoint.Endpoint; | ||
import com.ctrip.xpipe.redis.checker.healthcheck.session.RedisSession; | ||
|
||
public interface KeeperHealthCheckInstance extends HealthCheckInstance<KeeperInstanceInfo>{ | ||
|
||
Endpoint getEndpoint(); | ||
|
||
RedisSession getRedisSession(); | ||
} |
19 changes: 19 additions & 0 deletions
19
...s-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/KeeperInstanceInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.ctrip.xpipe.redis.checker.healthcheck; | ||
|
||
import com.ctrip.xpipe.endpoint.ClusterShardHostPort; | ||
import com.ctrip.xpipe.endpoint.HostPort; | ||
|
||
|
||
public interface KeeperInstanceInfo extends CheckInfo { | ||
|
||
ClusterShardHostPort getClusterShardHostport(); | ||
|
||
String getShardId(); | ||
|
||
String getDcId(); | ||
|
||
boolean isActive(); | ||
|
||
HostPort getHostPort(); | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
.../redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/KeeperSupport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.ctrip.xpipe.redis.checker.healthcheck; | ||
|
||
public interface KeeperSupport { | ||
} |
29 changes: 29 additions & 0 deletions
29
...a/com/ctrip/xpipe/redis/checker/healthcheck/actions/keeper/AbstractKeeperInfoCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.ctrip.xpipe.redis.checker.healthcheck.actions.keeper; | ||
|
||
import com.ctrip.xpipe.redis.checker.healthcheck.AbstractActionContext; | ||
import com.ctrip.xpipe.redis.checker.healthcheck.KeeperHealthCheckInstance; | ||
import com.ctrip.xpipe.redis.core.protocal.cmd.InfoResultExtractor; | ||
import org.slf4j.Logger; | ||
|
||
import java.util.concurrent.ExecutorService; | ||
import java.util.concurrent.ScheduledExecutorService; | ||
|
||
public abstract class AbstractKeeperInfoCommand<T extends AbstractActionContext> extends KeeperStatsCheckAction<String, InfoResultExtractor> { | ||
|
||
public AbstractKeeperInfoCommand(ScheduledExecutorService scheduled, KeeperHealthCheckInstance instance, ExecutorService executors) { | ||
super(scheduled, instance, executors); | ||
} | ||
|
||
@Override | ||
protected Logger getHealthCheckLogger() { | ||
return logger; | ||
} | ||
|
||
@Override | ||
protected T generateActionContext(String result) { | ||
return createActionContext(result); | ||
} | ||
|
||
protected abstract T createActionContext(String extractor); | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...pipe/redis/checker/healthcheck/actions/keeper/AbstractKeeperInfoCommandActionFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.ctrip.xpipe.redis.checker.healthcheck.actions.keeper; | ||
|
||
import com.ctrip.xpipe.redis.checker.healthcheck.KeeperHealthCheckInstance; | ||
import com.ctrip.xpipe.redis.checker.healthcheck.actions.redisstats.AbstractInfoListener; | ||
import com.ctrip.xpipe.redis.checker.healthcheck.leader.AbstractKeeperLeaderAwareHealthCheckActionFactory; | ||
import com.ctrip.xpipe.redis.checker.healthcheck.leader.SiteLeaderAwareHealthCheckAction; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
import java.util.List; | ||
|
||
public abstract class AbstractKeeperInfoCommandActionFactory<T extends AbstractInfoListener, C extends AbstractKeeperInfoCommand> | ||
extends AbstractKeeperLeaderAwareHealthCheckActionFactory { | ||
@Autowired | ||
private List<T> listeners; | ||
|
||
@Override | ||
public SiteLeaderAwareHealthCheckAction create(KeeperHealthCheckInstance instance) { | ||
C action = createAction(instance); | ||
action.addListeners(listeners); | ||
return action; | ||
} | ||
|
||
protected abstract C createAction(KeeperHealthCheckInstance instance); | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
...a/com/ctrip/xpipe/redis/checker/healthcheck/actions/keeper/AbstractKeeperInfoContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.ctrip.xpipe.redis.checker.healthcheck.actions.keeper; | ||
|
||
import com.ctrip.xpipe.redis.checker.healthcheck.AbstractActionContext; | ||
import com.ctrip.xpipe.redis.checker.healthcheck.KeeperHealthCheckInstance; | ||
import com.ctrip.xpipe.redis.core.protocal.cmd.InfoResultExtractor; | ||
|
||
public abstract class AbstractKeeperInfoContext extends AbstractActionContext<InfoResultExtractor, KeeperHealthCheckInstance> { | ||
public AbstractKeeperInfoContext(KeeperHealthCheckInstance instance, InfoResultExtractor infoResultExtractor) { | ||
super(instance, infoResultExtractor); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...java/com/ctrip/xpipe/redis/checker/healthcheck/actions/keeper/KeeperStatsCheckAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.ctrip.xpipe.redis.checker.healthcheck.actions.keeper; | ||
|
||
import com.ctrip.xpipe.redis.checker.healthcheck.KeeperHealthCheckInstance; | ||
import com.ctrip.xpipe.redis.checker.healthcheck.actions.redisstats.AbstractInstanceStatsCheckAction; | ||
|
||
import java.util.concurrent.ExecutorService; | ||
import java.util.concurrent.ScheduledExecutorService; | ||
|
||
public abstract class KeeperStatsCheckAction<T, K> extends AbstractInstanceStatsCheckAction<T, K , KeeperHealthCheckInstance> { | ||
|
||
public KeeperStatsCheckAction(ScheduledExecutorService scheduled, KeeperHealthCheckInstance instance, ExecutorService executors) { | ||
super(scheduled, instance, executors); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...n/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/keeper/info/RedisInfoAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.ctrip.xpipe.redis.checker.healthcheck.actions.keeper.info; | ||
|
||
import com.ctrip.xpipe.api.command.CommandFuture; | ||
import com.ctrip.xpipe.redis.checker.healthcheck.RedisHealthCheckInstance; | ||
import com.ctrip.xpipe.redis.checker.healthcheck.actions.redisstats.AbstractInfoCommandAction; | ||
import com.ctrip.xpipe.redis.checker.healthcheck.session.Callbackable; | ||
|
||
import java.util.concurrent.ExecutorService; | ||
import java.util.concurrent.ScheduledExecutorService; | ||
|
||
public class RedisInfoAction extends AbstractInfoCommandAction<RedisInfoActionContext> { | ||
|
||
public RedisInfoAction(ScheduledExecutorService scheduled, RedisHealthCheckInstance instance, ExecutorService executors) { | ||
super(scheduled, instance, executors); | ||
} | ||
|
||
@Override | ||
protected RedisInfoActionContext createActionContext(String extractor) { | ||
return new RedisInfoActionContext(instance, extractor); | ||
} | ||
|
||
@Override | ||
protected CommandFuture<String> executeRedisCommandForStats(Callbackable<String> callback) { | ||
return getActionInstance().getRedisSession().info("", callback); | ||
} | ||
|
||
@Override | ||
protected int getBaseCheckInterval() { | ||
return getActionInstance().getHealthCheckConfig().getKeeperCheckerIntervalMilli(); | ||
} | ||
} |
Oops, something went wrong.