├── doc └── images │ ├── command.png │ ├── plugin.jpg │ ├── enhancer.png │ ├── delay-design.jpg │ ├── sandbox-server-port.png │ └── edit-chaosblade-exec-jvm.png ├── chaosblade-exec-plugin ├── chaosblade-exec-plugin-jvm │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ ├── com.alibaba.chaosblade.exec.plugin.jvm.script.base.ScriptEngine │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── jvm │ │ ├── thread │ │ ├── ThreadRunStrategy.java │ │ └── model │ │ │ └── JvmThreadCountSpec.java │ │ ├── script │ │ ├── base │ │ │ ├── DefaultScriptEngineService.java │ │ │ ├── DefaultScriptMetrics.java │ │ │ ├── ScriptMetrics.java │ │ │ ├── ExecutableScript.java │ │ │ ├── ScriptFinder.java │ │ │ ├── finder │ │ │ │ └── ScriptEngineFinder.java │ │ │ └── cache │ │ │ │ └── ScriptCache.java │ │ └── model │ │ │ ├── ScriptTypeEnum.java │ │ │ └── ScriptFileFlagSpec.java │ │ ├── StoppableActionExecutor.java │ │ ├── cpu │ │ └── CpuCountFlagSpec.java │ │ └── gc │ │ └── FullGCIntervalFlagSpec.java ├── chaosblade-exec-plugin-jedis │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── jedis │ │ ├── JedisConstant.java │ │ ├── JedisMultiVersionStrategy.java │ │ ├── JedisHostMatcherSpec.java │ │ ├── JedisKeyMatcherSpec.java │ │ ├── JedisPortMatcherSpec.java │ │ └── JedisDatabaseMatcherSpec.java ├── chaosblade-exec-plugin-mysql │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── mysql │ │ ├── MysqlHostMatcherSpec.java │ │ ├── MysqlPortMatcherSpec.java │ │ ├── MysqlTableMatcherSpec.java │ │ ├── MysqlDatabaseMatcherSpec.java │ │ └── MysqlSqlTypeMatcherSpec.java ├── chaosblade-exec-plugin-feign │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ │ └── java │ │ │ └── com │ │ │ └── alibaba │ │ │ └── chaosblade │ │ │ └── exec │ │ │ └── plugin │ │ │ └── feign │ │ │ └── FeignConstant.java │ └── pom.xml ├── chaosblade-exec-plugin-hbase │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── hbase │ │ ├── HbaseConstant.java │ │ └── HbaseColumnMatcherSpec.java ├── chaosblade-exec-plugin-lettuce │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── lettuce │ │ ├── LettuceConstants.java │ │ └── LettuceValueFlagSpec.java ├── chaosblade-exec-plugin-mongodb │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── mongodb │ │ ├── MongoDBConstant.java │ │ ├── MongoDBDatabaseMatcherSpec.java │ │ └── MongoDBCollectionMatcherSpec.java ├── chaosblade-exec-plugin-servlet │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── servlet │ │ ├── code │ │ └── HttpCodeFlagSpec.java │ │ └── ServletRequestPathMatcherSpec.java ├── chaosblade-exec-plugin-redisson │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ │ └── java │ │ │ └── com │ │ │ └── alibaba │ │ │ └── chaosblade │ │ │ └── exec │ │ │ └── plugin │ │ │ └── redisson │ │ │ ├── RedissonConstant.java │ │ │ └── RedissonKeyMatcherSpec.java │ └── pom.xml ├── chaosblade-exec-plugin-security │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ │ └── java │ │ │ └── com │ │ │ └── alibaba │ │ │ └── chaosblade │ │ │ └── exec │ │ │ └── plugin │ │ │ └── security │ │ │ ├── SecurityConstant.java │ │ │ └── SecurityMatcherSpec.java │ └── pom.xml ├── chaosblade-exec-plugin-druid │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ │ └── java │ │ │ └── com │ │ │ └── alibaba │ │ │ └── chaosblade │ │ │ └── exec │ │ │ └── plugin │ │ │ └── druid │ │ │ └── DruidConstant.java │ └── pom.xml ├── chaosblade-exec-plugin-gateway │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── gateway │ │ └── GatewayConstant.java ├── chaosblade-exec-plugin-rocketmq │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin ├── chaosblade-exec-plugin-tars │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ │ └── java │ │ │ └── com │ │ │ └── alibaba │ │ │ └── chaosblade │ │ │ └── exec │ │ │ └── plugin │ │ │ └── tars │ │ │ ├── TarsConstant.java │ │ │ ├── TarsPlugin.java │ │ │ └── client │ │ │ └── TarsClientPlugin.java │ └── pom.xml ├── chaosblade-exec-plugin-postgrelsql │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── postgrelsql │ │ └── PostgrelsqlConstant.java ├── chaosblade-exec-plugin-zookeeper │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── zookeeper │ │ ├── ZookeeperConstant.java │ │ └── ZookeeperPathMatcherSpec.java ├── chaosblade-exec-plugin-clickhouse │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin ├── chaosblade-exec-plugin-elasticsearch │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── elasticsearch │ │ ├── ElasticSearchConstant.java │ │ └── index │ │ ├── RequestIndex.java │ │ └── impl │ │ ├── SearchRequestIndex.java │ │ └── GetRequestIndex.java ├── chaosblade-exec-plugin-log │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── log │ │ ├── LogConstant.java │ │ └── LogPlugin.java ├── chaosblade-exec-plugin-dubbo │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── dubbo │ │ ├── DubboPlugin.java │ │ ├── consumer │ │ └── DubboConsumerPlugin.java │ │ ├── provider │ │ └── DubboProviderPlugin.java │ │ └── DubboConstant.java ├── chaosblade-exec-plugin-hdfs │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── hdfs │ │ └── common │ │ ├── HdfsPlugin.java │ │ ├── HdfsConstant.java │ │ └── flag │ │ └── HdfsFileMatcherSpec.java ├── chaosblade-exec-plugin-kafka │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── kafka │ │ ├── KafkaPlugin.java │ │ ├── KafkaConstant.java │ │ ├── consumer │ │ └── KafkaConsumerPlugin.java │ │ ├── producer │ │ └── KafkaProducerPlugin.java │ │ └── model │ │ └── TopicMatcherSpec.java ├── chaosblade-exec-plugin-rabbitmq │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── com.alibaba.chaosblade.exec.common.aop.Plugin │ │ │ └── java │ │ │ └── com │ │ │ └── alibaba │ │ │ └── chaosblade │ │ │ └── exec │ │ │ └── plugin │ │ │ └── rabbitmq │ │ │ └── RabbitMqPlugin.java │ └── pom.xml └── chaosblade-exec-plugin-http │ └── src │ └── main │ ├── java │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── plugin │ │ └── http │ │ ├── enhancer │ │ └── InternalPointCut.java │ │ ├── UrlUtils.java │ │ ├── HttpPlugin.java │ │ └── model │ │ └── UriMatcherDefSpec.java │ └── resources │ └── META-INF │ └── services │ └── com.alibaba.chaosblade.exec.common.aop.Plugin ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── chaosblade-exec-bootstrap └── chaosblade-exec-bootstrap-jvmsandbox │ └── src │ └── main │ ├── resources │ └── META-INF │ │ └── services │ │ ├── com.alibaba.jvm.sandbox.api.Module │ │ └── com.alibaba.jvm.sandbox.api.spi.ModuleJarUnLoadSpi │ └── java │ └── com │ └── alibaba │ └── chaosblade │ └── exec │ └── bootstrap │ └── jvmsandbox │ └── OnJarUnloadCompleted.java ├── chaosblade-exec-spi └── src │ └── main │ └── java │ └── com │ └── alibaba │ └── chaosblade │ └── exec │ └── spi │ └── BusinessDataGetter.java ├── chaosblade-exec-common └── src │ └── main │ └── java │ └── com │ └── alibaba │ └── chaosblade │ └── exec │ └── common │ ├── constant │ ├── DelimiterConstant.java │ ├── CategoryConstants.java │ └── ModelConstant.java │ ├── util │ ├── RedisParserUtil.java │ ├── ObjectsUtil.java │ ├── StringUtil.java │ ├── ThreadUtil.java │ ├── JsonUtil.java │ ├── ClassUtils.java │ └── PluginUtil.java │ ├── model │ ├── ModelException.java │ ├── FlagSpec.java │ ├── action │ │ ├── returnv │ │ │ ├── compiler │ │ │ │ ├── CompilerException.java │ │ │ │ └── ConstantType.java │ │ │ ├── UnsupportedReturnTypeException.java │ │ │ ├── ReturnValueExecutor.java │ │ │ └── ValueFlagSpec.java │ │ ├── ActionExecutor.java │ │ ├── delay │ │ │ ├── DelayExecutor.java │ │ │ ├── TimeoutExecutor.java │ │ │ ├── TimeFlagSpec.java │ │ │ └── TimeOffsetFlagSpec.java │ │ ├── threadpool │ │ │ ├── InterruptableRunnable.java │ │ │ └── WaitThread.java │ │ ├── exception │ │ │ ├── ExceptionFlagSpec.java │ │ │ └── ExceptionMessageFlagSpec.java │ │ └── connpool │ │ │ └── ConnectionPoolFullExecutor.java │ ├── Target.java │ ├── matcher │ │ ├── MatcherSpec.java │ │ ├── BasePredicateMatcherSpec.java │ │ └── SimplePredicateMatcherSpec.java │ ├── ScopeModel.java │ └── prepare │ │ └── PrepareSpec.java │ ├── center │ ├── SPIServiceManager.java │ ├── ManagerService.java │ ├── ListenerManager.java │ ├── ModelSpecManager.java │ └── PluginBeanManager.java │ ├── plugin │ ├── MethodConstant.java │ └── ClassNameMatcherSpec.java │ ├── exception │ └── ExperimentException.java │ ├── aop │ ├── Predicate.java │ ├── PluginLifecycleListener.java │ ├── matcher │ │ ├── busi │ │ │ └── BusinessParamPatternMatcher.java │ │ ├── clazz │ │ │ ├── ClassMatcher.java │ │ │ └── NameClassMatcher.java │ │ └── method │ │ │ ├── MethodMatcher.java │ │ │ ├── NameMethodMatcher.java │ │ │ └── ManyNameMethodMatcher.java │ ├── CustomMatcher.java │ ├── PointCut.java │ ├── PluginBeans.java │ └── Plugin.java │ ├── context │ └── TimerTask.java │ └── transport │ └── Context.java ├── .gitignore ├── chaosblade-exec-service └── src │ ├── main │ └── java │ │ └── com │ │ └── alibaba │ │ └── chaosblade │ │ └── exec │ │ └── service │ │ ├── handler │ │ ├── ParseException.java │ │ ├── RequestHandler.java │ │ └── DispatchService.java │ │ └── build │ │ ├── SpecMain.java │ │ ├── ProcessIdBean.java │ │ ├── ProcessFlagBean.java │ │ ├── RefreshFlagBean.java │ │ └── JavaHomeFlagBean.java │ └── test │ └── java │ └── com │ └── alibaba │ └── chaosblade │ └── exec │ └── service │ └── build │ └── PluginUtilTest.java └── README.md /doc/images/command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaosblade-io/chaosblade-exec-jvm/HEAD/doc/images/command.png -------------------------------------------------------------------------------- /doc/images/plugin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaosblade-io/chaosblade-exec-jvm/HEAD/doc/images/plugin.jpg -------------------------------------------------------------------------------- /doc/images/enhancer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaosblade-io/chaosblade-exec-jvm/HEAD/doc/images/enhancer.png -------------------------------------------------------------------------------- /doc/images/delay-design.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaosblade-io/chaosblade-exec-jvm/HEAD/doc/images/delay-design.jpg -------------------------------------------------------------------------------- /doc/images/sandbox-server-port.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaosblade-io/chaosblade-exec-jvm/HEAD/doc/images/sandbox-server-port.png -------------------------------------------------------------------------------- /doc/images/edit-chaosblade-exec-jvm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaosblade-io/chaosblade-exec-jvm/HEAD/doc/images/edit-chaosblade-exec-jvm.png -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.plugin.jvm.script.base.ScriptEngine: -------------------------------------------------------------------------------- 1 | com.alibaba.chaosblade.exec.plugin.jvm.script.java.JavaCodeScriptEngine 2 | com.alibaba.chaosblade.exec.plugin.jvm.script.groovy.GroovyScriptEngine 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Issue Description 8 | 9 | Type: *bug report* or *feature request* 10 | 11 | ### Describe what happened (or what feature you want) 12 | 13 | 14 | ### Describe what you expected to happen 15 | 16 | 17 | ### How to reproduce it (as minimally and precisely as possible) 18 | 19 | 1. 20 | 2. 21 | 3. 22 | 23 | ### Tell us your environment 24 | 25 | 26 | ### Anything else we need to know? 27 | 28 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | ### Describe what this PR does / why we need it 7 | 8 | 9 | ### Does this pull request fix one issue? 10 | 11 | 12 | 13 | ### Describe how you did it 14 | 15 | 16 | ### Describe how to verify it 17 | 18 | 19 | ### Special notes for reviews 20 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.jvm.JvmPlugin -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jedis/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.jedis.JedisPlugin -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-mysql/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.mysql.MysqlPlugin -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-feign/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.feign.FeignPlugin 18 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-hbase/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.hbase.HbasePlugin 18 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-lettuce/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.lettuce.LettucePlugin -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-mongodb/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.mongodb.MongoDBPlugin -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-servlet/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.servlet.ServletPlugin -------------------------------------------------------------------------------- /chaosblade-exec-bootstrap/chaosblade-exec-bootstrap-jvmsandbox/src/main/resources/META-INF/services/com.alibaba.jvm.sandbox.api.Module: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.bootstrap.jvmsandbox.SandboxModule -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-redisson/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.redisson.RedissonPlugin -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-security/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.security.SecurityPlugin -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-druid/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.druid.DruidDataSourcePlugin 18 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-gateway/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.gateway.GatewayPlugin 18 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-rocketmq/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.rocketmq.RocketMqPlugin 18 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-tars/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.tars.client.TarsClientPlugin 18 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-postgrelsql/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.postgrelsql.PostgrelsqlPlugin -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-zookeeper/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.zookeeper.ZookeeperPlugin 18 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-clickhouse/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | 18 | 19 | com.alibaba.chaosblade.exec.plugin.clickhouse.ClickhousePlugin -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-elasticsearch/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.elasticsearch.ElasticSearchPlugin 18 | -------------------------------------------------------------------------------- /chaosblade-exec-bootstrap/chaosblade-exec-bootstrap-jvmsandbox/src/main/resources/META-INF/services/com.alibaba.jvm.sandbox.api.spi.ModuleJarUnLoadSpi: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.bootstrap.jvmsandbox.OnJarUnloadCompleted 18 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-log/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.log.logback.LogbackPlugin 18 | com.alibaba.chaosblade.exec.plugin.log.log4j2.Log4j2Plugin 19 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-dubbo/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.dubbo.consumer.DubboConsumerPlugin 18 | com.alibaba.chaosblade.exec.plugin.dubbo.provider.DubboProviderPlugin -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-hdfs/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2023 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.hdfs.restful.httpfs.HdfsHttpFSPlugin 18 | com.alibaba.chaosblade.exec.plugin.hdfs.restful.webhdfs.HdfsWebHdfsPlugin 19 | -------------------------------------------------------------------------------- /chaosblade-exec-spi/src/main/java/com/alibaba/chaosblade/exec/spi/BusinessDataGetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.spi; 18 | 19 | /** 20 | * @author wufunc@gmail.com 21 | */ 22 | public interface BusinessDataGetter { 23 | String get(String key) throws Exception; 24 | } -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-kafka/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.kafka.producer.KafkaProducerPlugin 18 | com.alibaba.chaosblade.exec.plugin.kafka.consumer.KafkaConsumerPlugin 19 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-rabbitmq/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.rabbitmq.producer.RabbitMqProducerPlugin 18 | com.alibaba.chaosblade.exec.plugin.rabbitmq.consumer.RabbitMqConsumerPlugin 19 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/constant/DelimiterConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.constant; 18 | 19 | /** @author Changjun Xiao */ 20 | public interface DelimiterConstant { 21 | 22 | String BETWEEN_TARGET_PLUGIN_NAME = "-"; 23 | } 24 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/util/RedisParserUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.util; 18 | 19 | /** 20 | * @author guoping.yao 21 | *

redis protocol 22 | */ 23 | public class RedisParserUtil {} 24 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/thread/ThreadRunStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.thread; 18 | 19 | public interface ThreadRunStrategy { 20 | 21 | void start(int count); 22 | 23 | void stop(); 24 | } 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled source # 2 | ################### 3 | *.com 4 | *.class 5 | *.dll 6 | *.exe 7 | *.o 8 | *.so 9 | 10 | # Packages # 11 | ############ 12 | # it's better to unpack these files and commit the raw source 13 | # git has its own built in compression methods 14 | *.7z 15 | *.dmg 16 | *.gz 17 | *.iso 18 | *.jar 19 | *.rar 20 | *.tar 21 | *.zip 22 | *.classpath 23 | *.project 24 | diamond_config_data.log 25 | diamond_config_data.log.* 26 | 27 | 28 | #ignore these files 29 | */.settings/* 30 | .settings/* 31 | */bin/* 32 | */target/* 33 | bin/* 34 | target/* 35 | **/target/** 36 | */.idea/* 37 | .idea/* 38 | *.iml 39 | */*.iml 40 | build-target 41 | .vscode 42 | # Logs and databases # 43 | ###################### 44 | *.log 45 | *.sql 46 | *.sqlite 47 | 48 | # OS generated files # 49 | ###################### 50 | .DS_Store 51 | .DS_Store? 52 | ._* 53 | .Spotlight-V100 54 | .Trashes 55 | ehthumbs.db 56 | Thumbs.db 57 | 58 | # project 59 | /plugins 60 | /cp.sh 61 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/ModelException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model; 18 | 19 | /** @author Changjun Xiao */ 20 | public class ModelException extends Exception { 21 | public ModelException(String message) { 22 | super(message); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/script/base/DefaultScriptEngineService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.script.base; 18 | 19 | /** @author RinaisSuper */ 20 | public class DefaultScriptEngineService extends AbstractScriptEngineService {} 21 | -------------------------------------------------------------------------------- /chaosblade-exec-service/src/main/java/com/alibaba/chaosblade/exec/service/handler/ParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.service.handler; 18 | 19 | /** @author Changjun Xiao */ 20 | public class ParseException extends Exception { 21 | public ParseException(String message) { 22 | super(message); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/center/SPIServiceManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.center; 18 | 19 | import java.util.List; 20 | 21 | public interface SPIServiceManager extends ManagerService { 22 | List getServices(String className, ClassLoader classLoader); 23 | } 24 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/FlagSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model; 18 | 19 | /** @author Changjun Xiao */ 20 | public interface FlagSpec { 21 | 22 | String getName(); 23 | 24 | String getDesc(); 25 | 26 | boolean noArgs(); 27 | 28 | boolean required(); 29 | } 30 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-druid/src/main/java/com/alibaba/chaosblade/exec/plugin/druid/DruidConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.druid; 18 | 19 | /** @author Changjun Xiao */ 20 | public interface DruidConstant { 21 | 22 | String DRUID_DS_PLUGIN_NAME = "druid-ds"; 23 | String TARGET_NAME = "druid"; 24 | } 25 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/center/ManagerService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.center; 18 | 19 | /** @author Changjun Xiao */ 20 | public interface ManagerService { 21 | 22 | /** Load service */ 23 | void load(); 24 | 25 | /** Close service, release resource */ 26 | void unload(); 27 | } 28 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-log/src/main/java/com/alibaba/chaosblade/exec/plugin/log/LogConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.log; 18 | 19 | /** @author shizhi.zhu@qunar.com */ 20 | public interface LogConstant { 21 | String TARGET = "log"; 22 | 23 | String LOGBACK_KEY = "logback"; 24 | 25 | String LOG4J2_KEY = "log4j2"; 26 | } 27 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/plugin/MethodConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.plugin; 18 | 19 | /** @author Changjun Xiao */ 20 | public interface MethodConstant { 21 | String CLASS_MATCHER_NAME = "classname"; 22 | String METHOD_MATCHER_NAME = "methodname"; 23 | String AFTER_METHOD_FLAG = "after"; 24 | } 25 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/script/base/DefaultScriptMetrics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.script.base; 18 | 19 | /** @author RinaisSuper */ 20 | public class DefaultScriptMetrics implements ScriptMetrics { 21 | 22 | @Override 23 | public void incrCompiledScript() {} 24 | } 25 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/script/base/ScriptMetrics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.script.base; 18 | 19 | /** 20 | * Script metrics 21 | * 22 | * @author RinaisSuper 23 | */ 24 | public interface ScriptMetrics { 25 | 26 | /** Increase count */ 27 | void incrCompiledScript(); 28 | } 29 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/returnv/compiler/CompilerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.returnv.compiler; 18 | 19 | /** @author Muxin Sun 2019/09/23 */ 20 | public class CompilerException extends Exception { 21 | public CompilerException(String message) { 22 | super(message); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/util/ObjectsUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.util; 18 | 19 | /** @author Changjun Xiao */ 20 | public class ObjectsUtil { 21 | 22 | public static T requireNonNull(T obj) { 23 | if (obj == null) { 24 | throw new NullPointerException(); 25 | } 26 | return obj; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/returnv/UnsupportedReturnTypeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.returnv; 18 | 19 | /** @author Changjun Xiao */ 20 | public class UnsupportedReturnTypeException extends Exception { 21 | public UnsupportedReturnTypeException(String message) { 22 | super(message); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/returnv/compiler/ConstantType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.returnv.compiler; 18 | 19 | public enum ConstantType { 20 | /** @author Muxin Sun */ 21 | STRING, 22 | NUMERIC, 23 | FUNCTION, 24 | SYMBOL, 25 | BOOLEAN, 26 | ORIGINAL, 27 | VARIATE, 28 | NULL, 29 | ARRAY 30 | } 31 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/script/base/ExecutableScript.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.script.base; 18 | 19 | /** @author RinaisSuper */ 20 | public interface ExecutableScript { 21 | 22 | /** 23 | * Run script by invoking the run method in script. 24 | * 25 | * @return 26 | */ 27 | Object run(); 28 | } 29 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-redisson/src/main/java/com/alibaba/chaosblade/exec/plugin/redisson/RedissonConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.redisson; 18 | 19 | /** @author xueshaoyi @Date 2020/11/23 上午11:36 */ 20 | public interface RedissonConstant { 21 | 22 | String TARGET_NAME = "redisson"; 23 | 24 | String KEY_MATCHER_NAME = "key"; 25 | String COMMAND_TYPE_MATCHER_NAME = "cmd"; 26 | } 27 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/util/StringUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.util; 18 | 19 | /** @author Changjun Xiao */ 20 | public class StringUtil { 21 | 22 | /** 23 | * Is not null or not empty 24 | * 25 | * @param value 26 | * @return 27 | */ 28 | public static boolean isBlank(String value) { 29 | return value == null || (value.trim()).length() == 0; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/script/base/ScriptFinder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.script.base; 18 | 19 | /** 20 | * Script finder 21 | * 22 | * @author RinaisSuper 23 | */ 24 | public interface ScriptFinder { 25 | 26 | /** 27 | * Find script by id 28 | * 29 | * @param scriptId 30 | * @return 31 | */ 32 | Script find(String scriptId); 33 | } 34 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/exception/ExperimentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.exception; 18 | 19 | /** @author Changjun Xiao */ 20 | public class ExperimentException extends Exception { 21 | public ExperimentException(String message) { 22 | super(message); 23 | } 24 | 25 | public ExperimentException(String message, Throwable cause) { 26 | super(message, cause); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-mongodb/src/main/java/com/alibaba/chaosblade/exec/plugin/mongodb/MongoDBConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.mongodb; 18 | 19 | /** @author Lingjian Xu */ 20 | public interface MongoDBConstant { 21 | 22 | String TARGET_NAME = "mongodb"; 23 | String COLLECTION_MATCHER_NAME = "collection"; 24 | String DATABASE_MATCHER_NAME = "database"; 25 | String SQL_TYPE_MATCHER_NAME = "sqltype"; 26 | } 27 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-http/src/main/java/com/alibaba/chaosblade/exec/plugin/http/enhancer/InternalPointCut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.http.enhancer; 18 | 19 | import java.lang.annotation.*; 20 | 21 | /** @author shizhi.zhu@qunar.com */ 22 | @Target(ElementType.TYPE) 23 | @Retention(RetentionPolicy.RUNTIME) 24 | @Documented 25 | public @interface InternalPointCut { 26 | String className(); 27 | 28 | String methodName(); 29 | } 30 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-hdfs/src/main/java/com/alibaba/chaosblade/exec/plugin/hdfs/common/HdfsPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.hdfs.common; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Plugin; 20 | import com.alibaba.chaosblade.exec.common.model.ModelSpec; 21 | 22 | public abstract class HdfsPlugin implements Plugin { 23 | @Override 24 | public ModelSpec getModelSpec() { 25 | return new HdfsModelSpec(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /chaosblade-exec-service/src/test/java/com/alibaba/chaosblade/exec/service/build/PluginUtilTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.service.build; 18 | 19 | /** @author Changjun Xiao */ 20 | public class PluginUtilTest { 21 | // @Test 22 | // public void dump() { 23 | // DubboConsumerPlugin dubboConsumerPlugin = new DubboConsumerPlugin(); 24 | // String file = BuildUtil.generatePluginSpec(dubboConsumerPlugin); 25 | // System.out.println(file); 26 | // } 27 | } 28 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-gateway/src/main/java/com/alibaba/chaosblade/exec/plugin/gateway/GatewayConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.gateway; 18 | 19 | /** 20 | * @Author wb-shd671576 21 | * 22 | * @package: com.alibaba.chaosblade.exec.plugin.gateway @Date 2021-07-29 23 | */ 24 | public class GatewayConstant { 25 | public static final String TARGET_NAME = "gateway"; 26 | public static final String GET_REQUST_PATH = "requestPath"; 27 | } 28 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-http/src/main/resources/META-INF/services/com.alibaba.chaosblade.exec.common.aop.Plugin: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 1999-2019 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | com.alibaba.chaosblade.exec.plugin.http.resttemplate.RestTemplatePlugin 18 | com.alibaba.chaosblade.exec.plugin.http.httpclient4.HttpClient4Plugin 19 | com.alibaba.chaosblade.exec.plugin.http.httpclient3.HttpClient3Plugin 20 | com.alibaba.chaosblade.exec.plugin.http.okhttp3.Okhttp3Plugin 21 | com.alibaba.chaosblade.exec.plugin.http.asynchttpclient.AsyncHttpClientPlugin -------------------------------------------------------------------------------- /chaosblade-exec-service/src/main/java/com/alibaba/chaosblade/exec/service/handler/RequestHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.service.handler; 18 | 19 | import com.alibaba.chaosblade.exec.common.transport.Request; 20 | import com.alibaba.chaosblade.exec.common.transport.Response; 21 | 22 | /** @author Changjun Xiao */ 23 | public interface RequestHandler { 24 | String getHandlerName(); 25 | 26 | Response handle(Request paramRequest); 27 | 28 | void unload(); 29 | } 30 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/Predicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.Model; 20 | import com.alibaba.chaosblade.exec.common.transport.Response; 21 | 22 | /** @author Changjun Xiao */ 23 | public interface Predicate { 24 | 25 | /** 26 | * Assert the model 27 | * 28 | * @param model 29 | * @return 30 | */ 31 | Response predicate(Model model); 32 | } 33 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/PluginLifecycleListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop; 18 | 19 | /** @author Changjun Xiao */ 20 | public interface PluginLifecycleListener { 21 | 22 | /** 23 | * Add plugin bean 24 | * 25 | * @param plugin 26 | */ 27 | void add(PluginBean plugin); 28 | 29 | /** 30 | * Delete plugin bean 31 | * 32 | * @param plugin 33 | */ 34 | void delete(PluginBean plugin); 35 | } 36 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/matcher/busi/BusinessParamPatternMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop.matcher.busi; 18 | 19 | import com.alibaba.chaosblade.exec.common.util.BusinessParamUtil; 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | public interface BusinessParamPatternMatcher { 24 | boolean match( 25 | Map businessData, List businessParams); 26 | } 27 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/ActionExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.EnhancerModel; 20 | 21 | /** @author Changjun Xiao */ 22 | public interface ActionExecutor { 23 | 24 | /** 25 | * Run executor 26 | * 27 | * @param enhancerModel 28 | * @throws Exception 29 | */ 30 | void run(EnhancerModel enhancerModel) throws Exception; 31 | } 32 | -------------------------------------------------------------------------------- /chaosblade-exec-service/src/main/java/com/alibaba/chaosblade/exec/service/handler/DispatchService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.service.handler; 18 | 19 | import com.alibaba.chaosblade.exec.common.transport.Request; 20 | import com.alibaba.chaosblade.exec.common.transport.Response; 21 | 22 | /** @author Changjun Xiao */ 23 | public interface DispatchService { 24 | Response dispatch(String paramString, Request paramRequest); 25 | 26 | void unload(); 27 | 28 | void load(); 29 | } 30 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/script/model/ScriptTypeEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.script.model; 18 | 19 | /** @author Changjun Xiao */ 20 | public enum ScriptTypeEnum { 21 | JAVA("java"), 22 | GROOVY("groovy"); 23 | 24 | private String name; 25 | 26 | ScriptTypeEnum(String name) { 27 | this.name = name; 28 | } 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-elasticsearch/src/main/java/com/alibaba/chaosblade/exec/plugin/elasticsearch/ElasticSearchConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.elasticsearch; 18 | 19 | /** 20 | * @Author yuhan 21 | * 22 | * @package: com.alibaba.chaosblade.exec.plugin.elasticsearch @Date 2019-05-22 16:28 23 | */ 24 | public class ElasticSearchConstant { 25 | 26 | public static final String TARGET_NAME = "es"; 27 | public static final String INDEX = "index"; 28 | } 29 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-feign/src/main/java/com/alibaba/chaosblade/exec/plugin/feign/FeignConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.feign; 18 | 19 | /** @author guoyu486@gmail.com */ 20 | public interface FeignConstant { 21 | 22 | String TARGET_NAME = "feign"; 23 | 24 | String ENHANCER_CLASS = "feign.SynchronousMethodHandler"; 25 | 26 | String METHOD = "executeAndDecode"; 27 | 28 | String SERVICE_NAME = "service-name"; 29 | 30 | String TEMPLATE_URL = "url"; 31 | } 32 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/matcher/clazz/ClassMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop.matcher.clazz; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.matcher.ClassInfo; 20 | 21 | /** @author Changjun Xiao */ 22 | public interface ClassMatcher { 23 | /** 24 | * 判断是否匹配 25 | * 26 | * @param className 类名,格式:xxx.xxx.xxx 27 | * @param classInfo 类信息 28 | * @return 匹配返回 true,否则返回 false 29 | */ 30 | boolean isMatched(String className, ClassInfo classInfo); 31 | } 32 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/Target.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | 23 | /** @author Changjun Xiao */ 24 | @java.lang.annotation.Target(ElementType.TYPE) 25 | @Retention(RetentionPolicy.RUNTIME) 26 | public @interface Target { 27 | 28 | /** 29 | * Name of the component 30 | * 31 | * @return 32 | */ 33 | String value(); 34 | } 35 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/delay/DelayExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.delay; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.action.ActionExecutor; 20 | 21 | /** @author Changjun Xiao */ 22 | public interface DelayExecutor extends ActionExecutor { 23 | 24 | /** 25 | * Execute sleep 26 | * 27 | * @param timeInMillis sleep time 28 | * @param offsetInMillis sleep offset 29 | */ 30 | void sleep(long timeInMillis, int offsetInMillis); 31 | } 32 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/threadpool/InterruptableRunnable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.threadpool; 18 | 19 | /** @author Changjun Xiao */ 20 | public class InterruptableRunnable implements Runnable { 21 | 22 | public static final long MAX_SLEEP_TIME_IN_MILLS = 24 * 60 * 60 * 60 * 1000L; 23 | 24 | @Override 25 | public void run() { 26 | try { 27 | Thread.sleep(MAX_SLEEP_TIME_IN_MILLS); 28 | } catch (InterruptedException e) { 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jedis/src/main/java/com/alibaba/chaosblade/exec/plugin/jedis/JedisConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jedis; 18 | 19 | /** @author guoping.yao */ 20 | public interface JedisConstant { 21 | 22 | String TARGET_NAME = "jedis"; 23 | 24 | String HOST_MATCHER_NAME = "host"; 25 | String DATABASE_INDEX_MATCHER_NAME = "database"; 26 | String PORT_MATCHER_NAME = "port"; 27 | String KEY_MATCHER_NAME = "key"; 28 | String COMMAND_TYPE_MATCHER_NAME = "cmd"; 29 | } 30 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-log/src/main/java/com/alibaba/chaosblade/exec/plugin/log/LogPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.log; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Plugin; 20 | import com.alibaba.chaosblade.exec.common.model.ModelSpec; 21 | import com.alibaba.chaosblade.exec.plugin.log.model.LogModelSpec; 22 | 23 | /** @author shizhi.zhu@qunar.com */ 24 | public abstract class LogPlugin implements Plugin { 25 | @Override 26 | public ModelSpec getModelSpec() { 27 | return new LogModelSpec(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/matcher/MatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.matcher; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.PredicateResult; 20 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 21 | 22 | /** @author Changjun Xiao */ 23 | public interface MatcherSpec extends FlagSpec { 24 | 25 | /** 26 | * Predicate the matcher model 27 | * 28 | * @param matcherModel 29 | * @return 30 | */ 31 | PredicateResult predicate(MatcherModel matcherModel); 32 | } 33 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-tars/src/main/java/com/alibaba/chaosblade/exec/plugin/tars/TarsConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.tars; 18 | 19 | /** 20 | * @author saikei 21 | * @email lishiji@huya.com 22 | */ 23 | public interface TarsConstant { 24 | 25 | String TIMEOUT_EXCEPTION_MSG = "from chaosblade mock timeout"; 26 | 27 | String SERVANT_NAME = "servantname"; 28 | String FUNCTION_NAME = "functionname"; 29 | 30 | String TARGET_NAME = "tars"; 31 | 32 | String CLIENT = "client"; 33 | String SERVANT = "servant"; 34 | } 35 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/matcher/method/MethodMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop.matcher.method; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.matcher.MethodInfo; 20 | 21 | /** @author Changjun Xiao */ 22 | public interface MethodMatcher { 23 | 24 | /** 25 | * Assert the method matched or not 26 | * 27 | * @param methodName 28 | * @param methodInfo 29 | * @return true if matched, otherwise false 30 | */ 31 | boolean isMatched(String methodName, MethodInfo methodInfo); 32 | } 33 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-zookeeper/src/main/java/com/alibaba/chaosblade/exec/plugin/zookeeper/ZookeeperConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.zookeeper; 18 | 19 | /** @author liuhq @Date 2020/11/23 上午11:36 */ 20 | public interface ZookeeperConstant { 21 | String TARGET_NAME = "zk"; 22 | String PATH_MATCHER_NAME = "path"; 23 | String PARAM_CLASS_NAME = "org.apache.jute.Record"; 24 | String ZK_CLASS = "org.apache.zookeeper.ClientCnxn"; 25 | String ZK_SEND_METHOD = "sendPacket"; 26 | String ZK_SUBMIT_METHOD = "submitRequest"; 27 | } 28 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-dubbo/src/main/java/com/alibaba/chaosblade/exec/plugin/dubbo/DubboPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.dubbo; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Plugin; 20 | import com.alibaba.chaosblade.exec.common.model.ModelSpec; 21 | import com.alibaba.chaosblade.exec.plugin.dubbo.model.DubboModelSpec; 22 | 23 | /** @author Changjun Xiao */ 24 | public abstract class DubboPlugin implements Plugin { 25 | 26 | @Override 27 | public ModelSpec getModelSpec() { 28 | return new DubboModelSpec(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-postgrelsql/src/main/java/com/alibaba/chaosblade/exec/plugin/postgrelsql/PostgrelsqlConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.postgrelsql; 18 | 19 | /** @author guoping.yao */ 20 | public interface PostgrelsqlConstant { 21 | 22 | String TARGET_NAME = "psql"; 23 | 24 | String HOST_MATCHER_NAME = "host"; 25 | String TABLE_MATCHER_NAME = "table"; 26 | String DATABASE_MATCHER_NAME = "database"; 27 | String SQL_TYPE_MATCHER_NAME = "sqltype"; 28 | String PORT_MATCHER_NAME = "port"; 29 | } 30 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-lettuce/src/main/java/com/alibaba/chaosblade/exec/plugin/lettuce/LettuceConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.lettuce; 18 | 19 | /** 20 | * @author yefei 21 | * @create 2020-11-23 14:58 22 | */ 23 | public class LettuceConstants { 24 | 25 | public static final String KEY = "key"; 26 | public static final String VALUE = "value"; 27 | public static final String CMD = "cmd"; 28 | 29 | public static final String CLASS = "io.lettuce.core.protocol.CommandHandler"; 30 | public static final String METHOD = "write"; 31 | } 32 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/util/ThreadUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.util; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.action.threadpool.NamedThreadFactory; 20 | import java.util.concurrent.Executors; 21 | import java.util.concurrent.ScheduledExecutorService; 22 | 23 | /** @author Changjun Xiao */ 24 | public class ThreadUtil { 25 | public static ScheduledExecutorService createScheduledExecutorService() { 26 | return Executors.newScheduledThreadPool(1, new NamedThreadFactory("ChaosBlade-Executor")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/script/base/finder/ScriptEngineFinder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.script.base.finder; 18 | 19 | import com.alibaba.chaosblade.exec.plugin.jvm.script.base.ScriptEngine; 20 | 21 | /** 22 | * Script engine finder 23 | * 24 | * @author RinaisSuper 25 | */ 26 | public interface ScriptEngineFinder { 27 | 28 | /** 29 | * Find script engine by script type 30 | * 31 | * @param language 32 | * @return 33 | */ 34 | ScriptEngine findByLang(String language); 35 | } 36 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-kafka/src/main/java/com/alibaba/chaosblade/exec/plugin/kafka/KafkaPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.kafka; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Plugin; 20 | import com.alibaba.chaosblade.exec.common.model.ModelSpec; 21 | import com.alibaba.chaosblade.exec.plugin.kafka.model.KafkaModelSpec; 22 | 23 | /** @author ljzhxx@gmail.com */ 24 | public abstract class KafkaPlugin implements Plugin, KafkaConstant { 25 | 26 | @Override 27 | public ModelSpec getModelSpec() { 28 | return new KafkaModelSpec(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/CustomMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop; 18 | 19 | /** @author yefei */ 20 | public interface CustomMatcher { 21 | 22 | /** 23 | * match 24 | * 25 | * @param commandValue 26 | * @param originValue 27 | * @return 28 | */ 29 | boolean match(String commandValue, Object originValue); 30 | 31 | /** 32 | * regex match 33 | * 34 | * @param commandValue 35 | * @param originValue 36 | * @return 37 | */ 38 | boolean regexMatch(String commandValue, Object originValue); 39 | } 40 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-http/src/main/java/com/alibaba/chaosblade/exec/plugin/http/UrlUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.http; 18 | 19 | /** @author pengpj */ 20 | public class UrlUtils { 21 | 22 | private static final String QUERY_SYMBOL = "?"; 23 | 24 | /** Get the URL and exclude the query parameters */ 25 | public static String getUrlExcludeQueryParameters(String path) { 26 | if (path.contains(QUERY_SYMBOL)) { 27 | return path.substring(0, path.indexOf(QUERY_SYMBOL)); 28 | } 29 | return path; 30 | } 31 | 32 | private UrlUtils() {} 33 | } 34 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-tars/src/main/java/com/alibaba/chaosblade/exec/plugin/tars/TarsPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.tars; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Plugin; 20 | import com.alibaba.chaosblade.exec.common.model.ModelSpec; 21 | import com.alibaba.chaosblade.exec.plugin.tars.model.TarsModelSpec; 22 | 23 | /** 24 | * @author saikei 25 | * @email lishiji@huya.com 26 | */ 27 | public abstract class TarsPlugin implements Plugin { 28 | @Override 29 | public ModelSpec getModelSpec() { 30 | return new TarsModelSpec(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /chaosblade-exec-service/src/main/java/com/alibaba/chaosblade/exec/service/build/SpecMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.service.build; 18 | 19 | /** @author Changjun Xiao */ 20 | public class SpecMain { 21 | public static void main(String[] args) { 22 | if (args.length == 0) { 23 | throw new RuntimeException("less plugin path"); 24 | } 25 | String pluginPath = args[0]; 26 | String specFileName = "chaosblade-jvm-spec.yaml"; 27 | if (args.length > 1) { 28 | specFileName = args[1]; 29 | } 30 | BuildUtil.generatePluginSpec(pluginPath, specFileName); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/PointCut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.matcher.clazz.ClassMatcher; 20 | import com.alibaba.chaosblade.exec.common.aop.matcher.method.MethodMatcher; 21 | 22 | /** @author Changjun Xiao */ 23 | public interface PointCut { 24 | 25 | /** 26 | * Class matcher 27 | * 28 | * @return 29 | */ 30 | ClassMatcher getClassMatcher(); 31 | 32 | /** 33 | * Method matcher 34 | * 35 | * @return 36 | */ 37 | MethodMatcher getMethodMatcher(); 38 | } 39 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/constant/CategoryConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.constant; 18 | 19 | /** @author Changjun Xiao */ 20 | public interface CategoryConstants { 21 | 22 | String JAVA = "java"; 23 | String JAVA_DELAY = "java_delay"; 24 | String JAVA_EXCEPTION = "java_exception"; 25 | String JAVA_CUSTOM = "java_custom"; 26 | String JAVA_DATA_TAMPER = "java_data_tamper"; 27 | String JAVA_RESOURCE = "java_resource"; 28 | String JAVA_RESOURCE_CPU = "java_resource_cpu"; 29 | String JAVA_RESOURCE_MEMORY = "java_resource_mem"; 30 | } 31 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/util/JsonUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.util; 18 | 19 | import com.fasterxml.jackson.databind.ObjectMapper; 20 | import com.fasterxml.jackson.databind.ObjectReader; 21 | import com.fasterxml.jackson.databind.ObjectWriter; 22 | 23 | /** @author Changjun Xiao */ 24 | public class JsonUtil { 25 | static final ObjectMapper mapper = new ObjectMapper(); 26 | 27 | public static ObjectReader reader() { 28 | return mapper.reader(); 29 | } 30 | 31 | public static ObjectWriter writer() { 32 | return mapper.writer(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-rabbitmq/src/main/java/com/alibaba/chaosblade/exec/plugin/rabbitmq/RabbitMqPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.rabbitmq; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Plugin; 20 | import com.alibaba.chaosblade.exec.common.model.ModelSpec; 21 | import com.alibaba.chaosblade.exec.plugin.rabbitmq.model.RabbitMqModelSpec; 22 | 23 | /** @author raygenyang@163.com */ 24 | public abstract class RabbitMqPlugin implements Plugin, RabbitMqConstant { 25 | 26 | @Override 27 | public ModelSpec getModelSpec() { 28 | return new RabbitMqModelSpec(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/ScopeModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model; 18 | 19 | /** @author Changjun Xiao */ 20 | public class ScopeModel { 21 | 22 | private String type; 23 | private String value; 24 | 25 | public ScopeModel(String name, String value) { 26 | this.type = name; 27 | this.value = value; 28 | } 29 | 30 | public String getType() { 31 | return type; 32 | } 33 | 34 | public String getValue() { 35 | return value; 36 | } 37 | 38 | @Override 39 | public String toString() { 40 | return type + "=" + value; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-hdfs/src/main/java/com/alibaba/chaosblade/exec/plugin/hdfs/common/HdfsConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.hdfs.common; 18 | 19 | public class HdfsConstant { 20 | public static final String TARGET_NAME = "hdfs"; 21 | 22 | public static final String PLUGIN_RESTFUL_HTTPFS_NAME = "restful_httpfs"; 23 | public static final String PLUGIN_RESTFUL_WEBHDFS_NAME = "restful_webhdfs"; 24 | 25 | public static final String FLAG_COMMON_FILE = "file"; 26 | public static final String FLAG_RESTFUL_OPERATION = "op"; 27 | 28 | public static final String HDFS_ROOT_PATH = "/"; 29 | } 30 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/center/ListenerManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.center; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.PluginLifecycleListener; 20 | 21 | /** @author Changjun Xiao */ 22 | public interface ListenerManager extends ManagerService { 23 | 24 | /** 25 | * Get plugin listener 26 | * 27 | * @return 28 | */ 29 | PluginLifecycleListener getPluginLifecycleListener(); 30 | 31 | /** 32 | * Set plugin listener 33 | * 34 | * @param listener 35 | */ 36 | void setPluginLifecycleListener(PluginLifecycleListener listener); 37 | } 38 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/center/ModelSpecManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.center; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.ModelSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public interface ModelSpecManager extends ManagerService { 23 | 24 | /** 25 | * Get experiment model specification 26 | * 27 | * @param target 28 | * @return 29 | */ 30 | ModelSpec getModelSpec(String target); 31 | 32 | /** 33 | * Register experiment model 34 | * 35 | * @param modelSpec 36 | */ 37 | void registerModelSpec(ModelSpec modelSpec); 38 | } 39 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-security/src/main/java/com/alibaba/chaosblade/exec/plugin/security/SecurityConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.security; 18 | 19 | /** @author liubin@njzfit.cn */ 20 | public class SecurityConstant { 21 | 22 | public static final String PLUGIN_NAME = "security"; 23 | 24 | public static final String PARAM_USERNAME = "username"; 25 | 26 | public static final String CLASS_UserDetailsService = 27 | "org.springframework.security.core.userdetails.UserDetailsService"; 28 | public static final String METHOD_UserDetailsService$loadUserByUsername = "loadUserByUsername"; 29 | } 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![logo](https://chaosblade.oss-cn-hangzhou.aliyuncs.com/doc/image/chaosblade-logo.png) 2 | 3 | # Chaosblade-exec-jvm: Chaosblade executor for chaos experiments on Java applications 4 | 5 | 6 | ## Introduction 7 | The project is a chaosblade executor based on [jvm-sandbox](https://github.com/alibaba/jvm-sandbox) for chaos 8 | experiments on Java applications by enhancing classes. The drill can be implemented through the blade cli, see 9 | [chaosblade](https://github.com/chaosblade-io/chaosblade) project for details. 10 | 11 | 12 | ## Compiling 13 | You can view the help using the following command in the project root directory 14 | ```bash 15 | make help 16 | ``` 17 | 18 | ## Contributing 19 | We welcome every contribution, even if it is just a punctuation. See details of [CONTRIBUTING](CONTRIBUTING.md) 20 | 21 | 22 | ## Bugs and Feedback 23 | For bug report, questions and discussions please submit [GitHub Issues](https://github.com/chaosblade-io/chaosblade/issues). 24 | 25 | DingDing: 23177705 26 | 27 | Slack: https://chaosblade-io.slack.com/archives/CRTNFPWE8 28 | 29 | Gitter room: [chaosblade community](https://gitter.im/chaosblade-io/community) 30 | 31 | 32 | ## License 33 | Chaosblade-exec-jvm is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text. 34 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/matcher/method/NameMethodMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop.matcher.method; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.matcher.MethodInfo; 20 | 21 | /** @author Changjun Xiao */ 22 | public class NameMethodMatcher implements MethodMatcher { 23 | 24 | private String methodName; 25 | 26 | public NameMethodMatcher(String methodName) { 27 | this.methodName = methodName; 28 | } 29 | 30 | @Override 31 | public boolean isMatched(String methodName, MethodInfo methodInfo) { 32 | return this.methodName.equals(methodName); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/delay/TimeoutExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.delay; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.action.ActionExecutor; 20 | 21 | /** @author Changjun Xiao */ 22 | public interface TimeoutExecutor extends ActionExecutor { 23 | 24 | /** 25 | * Get timeout 26 | * 27 | * @return 28 | */ 29 | long getTimeoutInMillis(); 30 | 31 | /** 32 | * Create timeout exception 33 | * 34 | * @param classLoader 35 | * @return 36 | */ 37 | Exception generateTimeoutException(ClassLoader classLoader); 38 | } 39 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/PluginBeans.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop; 18 | 19 | import java.util.Set; 20 | 21 | public class PluginBeans { 22 | 23 | private boolean load; 24 | 25 | private Set pluginBeans; 26 | 27 | public boolean isLoad() { 28 | return load; 29 | } 30 | 31 | public void setLoad(boolean load) { 32 | this.load = load; 33 | } 34 | 35 | public Set getPluginBeans() { 36 | return pluginBeans; 37 | } 38 | 39 | public void setPluginBeans(Set pluginBeans) { 40 | this.pluginBeans = pluginBeans; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/context/TimerTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.context; 18 | 19 | import java.util.concurrent.TimeUnit; 20 | 21 | /** 22 | * A task which is executed after the delay specified with {@link Timer#newTimeout(TimerTask, long, 23 | * TimeUnit)} (TimerTask, long, TimeUnit)}. 24 | */ 25 | public interface TimerTask { 26 | 27 | /** 28 | * Executed after the delay specified with {@link Timer#newTimeout(TimerTask, long, TimeUnit)}. 29 | * 30 | * @param timeout a handle which is associated with this task 31 | */ 32 | void run(Timeout timeout) throws Exception; 33 | } 34 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/returnv/ReturnValueExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.returnv; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.action.ActionExecutor; 20 | import java.lang.reflect.Method; 21 | 22 | /** @author Changjun Xiao */ 23 | public interface ReturnValueExecutor extends ActionExecutor { 24 | 25 | /** 26 | * Only support primitive type 27 | * 28 | * @param classLoader 29 | * @param method 30 | * @param value 31 | * @return 32 | */ 33 | Object generateReturnValue(ClassLoader classLoader, Method method, String value); 34 | } 35 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/StoppableActionExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.EnhancerModel; 20 | import com.alibaba.chaosblade.exec.common.model.action.ActionExecutor; 21 | 22 | /** 23 | * @author RinaisSuper 24 | * @date 2019-04-23 25 | */ 26 | public interface StoppableActionExecutor extends ActionExecutor { 27 | 28 | /** 29 | * stop action executor 30 | * 31 | * @param enhancerModel 32 | * @throws Exception 33 | */ 34 | void stop(EnhancerModel enhancerModel) throws Exception; 35 | } 36 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-druid/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | chaosblade-exec-plugin 24 | com.alibaba.chaosblade 25 | 1.8.0 26 | 27 | 4.0.0 28 | 29 | chaosblade-exec-plugin-druid 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-tars/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | chaosblade-exec-plugin 24 | com.alibaba.chaosblade 25 | 1.8.0 26 | 27 | 4.0.0 28 | 29 | chaosblade-exec-plugin-tars 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /chaosblade-exec-service/src/main/java/com/alibaba/chaosblade/exec/service/build/ProcessIdBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.service.build; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class ProcessIdBean implements FlagSpec { 23 | 24 | @Override 25 | public String getName() { 26 | return "pid"; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "The process id"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-http/src/main/java/com/alibaba/chaosblade/exec/plugin/http/HttpPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.http; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Plugin; 20 | import com.alibaba.chaosblade.exec.common.model.ModelSpec; 21 | import com.alibaba.chaosblade.exec.plugin.http.model.HttpModelSpec; 22 | 23 | /** 24 | * @Author yuhan 25 | * 26 | * @package: com.alibaba.chaosblade.exec.plugin.restTemplate @Date 2019-05-10 10:25 27 | */ 28 | public abstract class HttpPlugin implements Plugin { 29 | 30 | @Override 31 | public ModelSpec getModelSpec() { 32 | return new HttpModelSpec(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-rabbitmq/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | chaosblade-exec-plugin 24 | com.alibaba.chaosblade 25 | 1.8.0 26 | 27 | 4.0.0 28 | 29 | chaosblade-exec-plugin-rabbitmq 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-security/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | chaosblade-exec-plugin 24 | com.alibaba.chaosblade 25 | 1.8.0 26 | 27 | 4.0.0 28 | 29 | chaosblade-exec-plugin-security 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/delay/TimeFlagSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.delay; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class TimeFlagSpec implements FlagSpec { 23 | @Override 24 | public String getName() { 25 | return "time"; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "delay time"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return true; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-elasticsearch/src/main/java/com/alibaba/chaosblade/exec/plugin/elasticsearch/index/RequestIndex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.elasticsearch.index; 18 | 19 | import java.util.List; 20 | 21 | /** 22 | * @Author Yuhan Tang 23 | * 24 | * @package: com.alibaba.chaosblade.exec.plugin.elasticsearch.index.impl @Date 2020-10-30 16:16 25 | */ 26 | public interface RequestIndex { 27 | /** 28 | * 获取名称 29 | * 30 | * @return 31 | */ 32 | String getName(); 33 | 34 | /** 35 | * 获取index名称 36 | * 37 | * @param target 38 | * @return 39 | */ 40 | List getIndex(Object target) throws Exception; 41 | } 42 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/matcher/clazz/NameClassMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop.matcher.clazz; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.matcher.ClassInfo; 20 | 21 | /** 22 | * Match class by name 23 | * 24 | * @author Changjun Xiao 25 | */ 26 | public class NameClassMatcher implements ClassMatcher { 27 | 28 | private String className; 29 | 30 | public NameClassMatcher(String className) { 31 | this.className = className; 32 | } 33 | 34 | @Override 35 | public boolean isMatched(String className, ClassInfo classInfo) { 36 | return this.className.equals(className); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-redisson/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | chaosblade-exec-plugin 24 | com.alibaba.chaosblade 25 | 1.8.0 26 | 27 | 4.0.0 28 | 29 | com.alibaba.chaosblade 30 | chaosblade-exec-plugin-redisson 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /chaosblade-exec-service/src/main/java/com/alibaba/chaosblade/exec/service/build/ProcessFlagBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.service.build; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class ProcessFlagBean implements FlagSpec { 23 | 24 | @Override 25 | public String getName() { 26 | return "process"; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "Application process name"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/util/ClassUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.util; 18 | 19 | /** @author shizhi.zhu@qunar.com */ 20 | public class ClassUtils { 21 | 22 | private static final char PACKAGE_SEPARATOR_CHAR = '.'; 23 | 24 | public static String simpleClassName(Class clazz) { 25 | if (clazz == null) { 26 | throw new NullPointerException("clazz"); 27 | } 28 | String className = clazz.getName(); 29 | final int lastDotIdx = className.lastIndexOf(PACKAGE_SEPARATOR_CHAR); 30 | if (lastDotIdx > -1) { 31 | return className.substring(lastDotIdx + 1); 32 | } 33 | return className; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /chaosblade-exec-service/src/main/java/com/alibaba/chaosblade/exec/service/build/RefreshFlagBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.service.build; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class RefreshFlagBean implements FlagSpec { 23 | 24 | @Override 25 | public String getName() { 26 | return "refresh"; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "Uninstall java agent and reload it"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return true; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-hbase/src/main/java/com/alibaba/chaosblade/exec/plugin/hbase/HbaseConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.hbase; 18 | 19 | import java.lang.reflect.Method; 20 | import java.util.HashMap; 21 | import java.util.Map; 22 | 23 | /** 24 | * @Author yuhan 25 | * 26 | * @package: com.alibaba.chaosblade.exec.plugin.http @Date 2019-05-22 16:28 27 | */ 28 | public class HbaseConstant { 29 | 30 | public static final String TARGET_NAME = "hbase"; 31 | public static final String TABLE = "table"; 32 | public static final String Column = "column"; 33 | 34 | public static final Map methodMap = new HashMap(); 35 | } 36 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-http/src/main/java/com/alibaba/chaosblade/exec/plugin/http/model/UriMatcherDefSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.http.model; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | public class UriMatcherDefSpec extends BasePredicateMatcherSpec { 22 | 23 | @Override 24 | public String getName() { 25 | return "uri"; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "url"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return true; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jedis/src/main/java/com/alibaba/chaosblade/exec/plugin/jedis/JedisMultiVersionStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jedis; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.EnhancerModel; 20 | 21 | /** @author liuhq */ 22 | public interface JedisMultiVersionStrategy { 23 | /** 24 | * jedis multi version strategy process 25 | * 26 | * @param classLoader classLoader 27 | * @param methodArguments jedis method argument array 28 | * @return EnhancerModel 29 | * @throws Exception 30 | */ 31 | EnhancerModel process(ClassLoader classLoader, Object[] methodArguments) throws Exception; 32 | } 33 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-servlet/src/main/java/com/alibaba/chaosblade/exec/plugin/servlet/code/HttpCodeFlagSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.servlet.code; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | 21 | /** @author yefei */ 22 | public class HttpCodeFlagSpec implements FlagSpec { 23 | 24 | @Override 25 | public String getName() { 26 | return "code"; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "http code"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/matcher/method/ManyNameMethodMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop.matcher.method; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.matcher.MethodInfo; 20 | import java.util.Set; 21 | 22 | /** @author Changjun Xiao */ 23 | public class ManyNameMethodMatcher implements MethodMatcher { 24 | 25 | private Set methodNames; 26 | 27 | public ManyNameMethodMatcher(Set methodNames) { 28 | this.methodNames = methodNames; 29 | } 30 | 31 | @Override 32 | public boolean isMatched(String methodName, MethodInfo methodInfo) { 33 | return methodNames.contains(methodName); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/delay/TimeOffsetFlagSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.delay; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class TimeOffsetFlagSpec implements FlagSpec { 23 | @Override 24 | public String getName() { 25 | return "offset"; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "delay offset for the time"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-service/src/main/java/com/alibaba/chaosblade/exec/service/build/JavaHomeFlagBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.service.build; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class JavaHomeFlagBean implements FlagSpec { 23 | 24 | @Override 25 | public String getName() { 26 | return "javaHome"; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "Specify the JAVA_HOME variable to loading jre lib"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/matcher/BasePredicateMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.matcher; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.PredicateResult; 20 | 21 | /** @author Changjun Xiao */ 22 | public abstract class BasePredicateMatcherSpec implements MatcherSpec { 23 | 24 | @Override 25 | public PredicateResult predicate(MatcherModel matcherModel) { 26 | String value = matcherModel.get(getName()); 27 | if (value == null) { 28 | if (required()) { 29 | return PredicateResult.fail("less necessary " + getName() + " value"); 30 | } 31 | } 32 | return PredicateResult.success(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-kafka/src/main/java/com/alibaba/chaosblade/exec/plugin/kafka/KafkaConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.kafka; 18 | 19 | /** @author ljzhxx@gmail.com */ 20 | public interface KafkaConstant { 21 | 22 | String TARGET_NAME = "kafka"; 23 | 24 | String PRODUCER_KEY = "producer"; 25 | 26 | String CONSUMER_KEY = "consumer"; 27 | 28 | String TOPIC_KEY = "topic"; 29 | 30 | String GROUP_ID_KEY = "groupId"; 31 | 32 | String PRODUCER_CLASS = "org.apache.kafka.clients.producer.KafkaProducer"; 33 | 34 | String SEND = "send"; 35 | 36 | String CONSUMER_CLASS = "org.apache.kafka.clients.consumer.KafkaConsumer"; 37 | 38 | String POLL = "poll"; 39 | } 40 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/transport/Context.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.transport; 18 | 19 | import java.util.HashMap; 20 | import java.util.Map; 21 | 22 | /** @author Changjun Xiao */ 23 | public class Context { 24 | private Map ctx; 25 | 26 | public Context() { 27 | this.ctx = new HashMap(); 28 | } 29 | 30 | public String get(String key) { 31 | return ctx.get(key); 32 | } 33 | 34 | public Context set(String key, String value) { 35 | ctx.put(key, value); 36 | return this; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return "Context{" + "ctx=" + ctx + '}'; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/script/base/cache/ScriptCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.script.base.cache; 18 | 19 | /** @author RinaisSuper */ 20 | public interface ScriptCache { 21 | 22 | /** 23 | * Put operation 24 | * 25 | * @param key 26 | * @param value 27 | */ 28 | void put(Key key, Value value); 29 | 30 | /** 31 | * Get operation 32 | * 33 | * @param key 34 | * @return 35 | */ 36 | Value get(Key key); 37 | 38 | /** 39 | * Evict(Delete) Operation 40 | * 41 | * @param key 42 | */ 43 | boolean evict(Key key); 44 | 45 | /** Delete all key */ 46 | void clean(); 47 | } 48 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/exception/ExceptionFlagSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.exception; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class ExceptionFlagSpec implements FlagSpec { 23 | @Override 24 | public String getName() { 25 | return "exception"; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "Exception class inherit java.lang.Exception"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return true; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-hbase/src/main/java/com/alibaba/chaosblade/exec/plugin/hbase/HbaseColumnMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.hbase; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | public class HbaseColumnMatcherSpec extends BasePredicateMatcherSpec { 22 | @Override 23 | public String getName() { 24 | return HbaseConstant.Column; 25 | } 26 | 27 | @Override 28 | public String getDesc() { 29 | return "The hbase column which used"; 30 | } 31 | 32 | @Override 33 | public boolean noArgs() { 34 | return false; 35 | } 36 | 37 | @Override 38 | public boolean required() { 39 | return false; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/prepare/PrepareSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.prepare; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | import java.util.List; 21 | 22 | /** 23 | * Prepare for creating experiment 24 | * 25 | * @author Changjun Xiao 26 | */ 27 | public interface PrepareSpec { 28 | /** 29 | * The prepare type, for example, jvm 30 | * 31 | * @return 32 | */ 33 | String getType(); 34 | 35 | /** 36 | * Get the prepare flags 37 | * 38 | * @return 39 | */ 40 | List getFlags(); 41 | 42 | /** 43 | * If necessary or not 44 | * 45 | * @return 46 | */ 47 | boolean required(); 48 | } 49 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/util/PluginUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.util; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Plugin; 20 | import com.alibaba.chaosblade.exec.common.constant.DelimiterConstant; 21 | 22 | /** @author Changjun Xiao */ 23 | public class PluginUtil { 24 | 25 | public static String getIdentifier(Plugin plugin) { 26 | return plugin.getModelSpec().getTarget() 27 | + DelimiterConstant.BETWEEN_TARGET_PLUGIN_NAME 28 | + plugin.getName(); 29 | } 30 | 31 | public static String getIdentifierForAfterEvent(Plugin plugin) { 32 | return getIdentifier(plugin) + DelimiterConstant.BETWEEN_TARGET_PLUGIN_NAME + "after"; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/threadpool/WaitThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.threadpool; 18 | 19 | /** 20 | * @Author qianfan 21 | * 22 | * @package: com.alibaba.chaosblade.exec.common.model.action.threadpool @Date 2020/12/22 11:44 上午 23 | */ 24 | public class WaitThread extends Thread { 25 | 26 | private final Object lock = new Object(); 27 | 28 | public void unlock() { 29 | synchronized (lock) { 30 | lock.notify(); 31 | } 32 | } 33 | 34 | @Override 35 | public void run() { 36 | synchronized (lock) { 37 | try { 38 | lock.wait(); 39 | } catch (InterruptedException e) { 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/connpool/ConnectionPoolFullExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.connpool; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.action.ActionExecutor; 20 | import javax.sql.DataSource; 21 | 22 | /** @author Changjun Xiao */ 23 | public interface ConnectionPoolFullExecutor extends ActionExecutor { 24 | 25 | /** 26 | * Trigger connection pool full. 27 | * 28 | * @param dataSource 29 | */ 30 | void full(DataSource dataSource); 31 | 32 | /** Revoke connection pool full. */ 33 | void revoke(); 34 | 35 | /** 36 | * Get max pool size from datasource 37 | * 38 | * @return 39 | */ 40 | int getMaxPoolSize(); 41 | } 42 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/plugin/ClassNameMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.plugin; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class ClassNameMatcherSpec extends BasePredicateMatcherSpec { 23 | 24 | @Override 25 | public String getName() { 26 | return MethodConstant.CLASS_MATCHER_NAME; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "The class name with package"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/constant/ModelConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.constant; 18 | 19 | /** @author Changjun Xiao */ 20 | public interface ModelConstant { 21 | String JVM_TARGET = "jvm"; 22 | 23 | String HTTP_TARGET = "http"; 24 | 25 | String HTTP_URL_MATCHER_NAME = "uri"; 26 | 27 | /** The name of effect percent matcher */ 28 | String EFFECT_PERCENT_MATCHER_NAME = "effect-percent"; 29 | 30 | /** The name of effect count matcher */ 31 | String EFFECT_COUNT_MATCHER_NAME = "effect-count"; 32 | 33 | /** The flag of regex pattern */ 34 | String REGEX_PATTERN_FLAG = "regex-pattern"; 35 | 36 | /** the flag of buisness params */ 37 | String BUSINESS_PARAMS = "b-params"; 38 | } 39 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/returnv/ValueFlagSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.returnv; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class ValueFlagSpec implements FlagSpec { 23 | 24 | @Override 25 | public String getName() { 26 | return "value"; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "Value returned, only support primitive type value. If you want return null, set --value null"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-mysql/src/main/java/com/alibaba/chaosblade/exec/plugin/mysql/MysqlHostMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.mysql; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class MysqlHostMatcherSpec extends BasePredicateMatcherSpec { 23 | 24 | @Override 25 | public String getName() { 26 | return MysqlConstant.HOST_MATCHER_NAME; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "The database host"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-mysql/src/main/java/com/alibaba/chaosblade/exec/plugin/mysql/MysqlPortMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.mysql; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class MysqlPortMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return MysqlConstant.PORT_MATCHER_NAME; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The database port which used"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-mysql/src/main/java/com/alibaba/chaosblade/exec/plugin/mysql/MysqlTableMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.mysql; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class MysqlTableMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return MysqlConstant.TABLE_MATCHER_NAME; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The first table name in sql."; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-security/src/main/java/com/alibaba/chaosblade/exec/plugin/security/SecurityMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.security; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author liubin@njzfit.cn */ 22 | public class SecurityMatcherSpec extends BasePredicateMatcherSpec { 23 | 24 | @Override 25 | public String getName() { 26 | return SecurityConstant.PARAM_USERNAME; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "login username"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-servlet/src/main/java/com/alibaba/chaosblade/exec/plugin/servlet/ServletRequestPathMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.servlet; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | public class ServletRequestPathMatcherSpec extends BasePredicateMatcherSpec { 22 | 23 | @Override 24 | public String getName() { 25 | return ServletConstant.REQUEST_PATH_KEY; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "equal RequestUri without ContextPath"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-lettuce/src/main/java/com/alibaba/chaosblade/exec/plugin/lettuce/LettuceValueFlagSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.lettuce; 18 | 19 | import static com.alibaba.chaosblade.exec.plugin.lettuce.LettuceConstants.VALUE; 20 | 21 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 22 | 23 | /** @author yefei */ 24 | public class LettuceValueFlagSpec implements FlagSpec { 25 | 26 | @Override 27 | public String getName() { 28 | return VALUE; 29 | } 30 | 31 | @Override 32 | public String getDesc() { 33 | return "value set"; 34 | } 35 | 36 | @Override 37 | public boolean noArgs() { 38 | return false; 39 | } 40 | 41 | @Override 42 | public boolean required() { 43 | return false; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-mysql/src/main/java/com/alibaba/chaosblade/exec/plugin/mysql/MysqlDatabaseMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.mysql; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class MysqlDatabaseMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return MysqlConstant.DATABASE_MATCHER_NAME; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The database name which used"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-elasticsearch/src/main/java/com/alibaba/chaosblade/exec/plugin/elasticsearch/index/impl/SearchRequestIndex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.elasticsearch.index.impl; 18 | 19 | import com.alibaba.chaosblade.exec.plugin.elasticsearch.index.AbstractRequestIndex; 20 | import java.util.List; 21 | 22 | /** 23 | * @Author Yuhan Tang 24 | * 25 | * @package: com.alibaba.chaosblade.exec.plugin.elasticsearch.index.impl @Date 2020-10-30 16:16 26 | */ 27 | public class SearchRequestIndex extends AbstractRequestIndex { 28 | @Override 29 | public String getName() { 30 | return "search"; 31 | } 32 | 33 | @Override 34 | public List getIndex0(Object target) throws Exception { 35 | return indexs(target, "indices"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/cpu/CpuCountFlagSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.cpu; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | import com.alibaba.chaosblade.exec.plugin.jvm.JvmConstant; 21 | 22 | /** @author Changjun Xiao */ 23 | public class CpuCountFlagSpec implements FlagSpec { 24 | 25 | @Override 26 | public String getName() { 27 | return JvmConstant.FLAG_NAME_CPU_COUNT; 28 | } 29 | 30 | @Override 31 | public String getDesc() { 32 | return "Binding cpu core count"; 33 | } 34 | 35 | @Override 36 | public boolean noArgs() { 37 | return false; 38 | } 39 | 40 | @Override 41 | public boolean required() { 42 | return false; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-mongodb/src/main/java/com/alibaba/chaosblade/exec/plugin/mongodb/MongoDBDatabaseMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.mongodb; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author Lingjian Xu */ 22 | public class MongoDBDatabaseMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return MongoDBConstant.DATABASE_MATCHER_NAME; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The database name which used"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-dubbo/src/main/java/com/alibaba/chaosblade/exec/plugin/dubbo/consumer/DubboConsumerPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.dubbo.consumer; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Enhancer; 20 | import com.alibaba.chaosblade.exec.common.aop.PointCut; 21 | import com.alibaba.chaosblade.exec.plugin.dubbo.DubboPlugin; 22 | 23 | /** @author Changjun Xiao */ 24 | public class DubboConsumerPlugin extends DubboPlugin { 25 | 26 | @Override 27 | public String getName() { 28 | return "consumer"; 29 | } 30 | 31 | @Override 32 | public PointCut getPointCut() { 33 | return new DubboConsumerPointCut(); 34 | } 35 | 36 | @Override 37 | public Enhancer getEnhancer() { 38 | return new DubboConsumerEnhancer(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-dubbo/src/main/java/com/alibaba/chaosblade/exec/plugin/dubbo/provider/DubboProviderPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.dubbo.provider; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Enhancer; 20 | import com.alibaba.chaosblade.exec.common.aop.PointCut; 21 | import com.alibaba.chaosblade.exec.plugin.dubbo.DubboPlugin; 22 | 23 | /** @author Changjun Xiao */ 24 | public class DubboProviderPlugin extends DubboPlugin { 25 | 26 | @Override 27 | public String getName() { 28 | return "provider"; 29 | } 30 | 31 | @Override 32 | public PointCut getPointCut() { 33 | return new DubboProviderPointCut(); 34 | } 35 | 36 | @Override 37 | public Enhancer getEnhancer() { 38 | return new DubboProviderEnhancer(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jedis/src/main/java/com/alibaba/chaosblade/exec/plugin/jedis/JedisHostMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jedis; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author guoping.yao */ 22 | public class JedisHostMatcherSpec extends BasePredicateMatcherSpec { 23 | 24 | @Override 25 | public String getName() { 26 | return JedisConstant.HOST_MATCHER_NAME; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "The database host"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jedis/src/main/java/com/alibaba/chaosblade/exec/plugin/jedis/JedisKeyMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jedis; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author guoping.yao */ 22 | public class JedisKeyMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return JedisConstant.KEY_MATCHER_NAME; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The key which command used"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-kafka/src/main/java/com/alibaba/chaosblade/exec/plugin/kafka/consumer/KafkaConsumerPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.kafka.consumer; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Enhancer; 20 | import com.alibaba.chaosblade.exec.common.aop.PointCut; 21 | import com.alibaba.chaosblade.exec.plugin.kafka.KafkaPlugin; 22 | 23 | /** @author ljzhxx@gmail.com */ 24 | public class KafkaConsumerPlugin extends KafkaPlugin { 25 | @Override 26 | public String getName() { 27 | return "consumer"; 28 | } 29 | 30 | @Override 31 | public PointCut getPointCut() { 32 | return new KafkaConsumerPointCut(); 33 | } 34 | 35 | @Override 36 | public Enhancer getEnhancer() { 37 | return new KafkaConsumerEnhancer(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-kafka/src/main/java/com/alibaba/chaosblade/exec/plugin/kafka/producer/KafkaProducerPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.kafka.producer; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Enhancer; 20 | import com.alibaba.chaosblade.exec.common.aop.PointCut; 21 | import com.alibaba.chaosblade.exec.plugin.kafka.KafkaPlugin; 22 | 23 | /** @author ljzhxx@gmail.com */ 24 | public class KafkaProducerPlugin extends KafkaPlugin { 25 | @Override 26 | public String getName() { 27 | return "producer"; 28 | } 29 | 30 | @Override 31 | public PointCut getPointCut() { 32 | return new KafkaProducerPointCut(); 33 | } 34 | 35 | @Override 36 | public Enhancer getEnhancer() { 37 | return new KafkaProducerEnhancer(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jedis/src/main/java/com/alibaba/chaosblade/exec/plugin/jedis/JedisPortMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jedis; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author guoping.yao */ 22 | public class JedisPortMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return JedisConstant.PORT_MATCHER_NAME; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The database port which used"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/thread/model/JvmThreadCountSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.thread.model; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | import com.alibaba.chaosblade.exec.plugin.jvm.JvmConstant; 21 | 22 | /** @author Changjun Xiao */ 23 | public class JvmThreadCountSpec implements FlagSpec { 24 | 25 | @Override 26 | public String getName() { 27 | return JvmConstant.ACTION_THREAD_COUNT; 28 | } 29 | 30 | @Override 31 | public String getDesc() { 32 | return "thread count"; 33 | } 34 | 35 | @Override 36 | public boolean noArgs() { 37 | return false; 38 | } 39 | 40 | @Override 41 | public boolean required() { 42 | return true; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-mongodb/src/main/java/com/alibaba/chaosblade/exec/plugin/mongodb/MongoDBCollectionMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.mongodb; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author Lingjian Xu */ 22 | public class MongoDBCollectionMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return MongoDBConstant.COLLECTION_MATCHER_NAME; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The first collection name in sql."; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-mysql/src/main/java/com/alibaba/chaosblade/exec/plugin/mysql/MysqlSqlTypeMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.mysql; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class MysqlSqlTypeMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return MysqlConstant.SQL_TYPE_MATCHER_NAME; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The sql type, for example, select, update and so on."; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-redisson/src/main/java/com/alibaba/chaosblade/exec/plugin/redisson/RedissonKeyMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.redisson; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author xueshaoyi @Date 2020/11/23 上午11:36 */ 22 | public class RedissonKeyMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return RedissonConstant.KEY_MATCHER_NAME; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The key which command used"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-bootstrap/chaosblade-exec-bootstrap-jvmsandbox/src/main/java/com/alibaba/chaosblade/exec/bootstrap/jvmsandbox/OnJarUnloadCompleted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.bootstrap.jvmsandbox; 18 | 19 | import ch.qos.logback.classic.LoggerContext; 20 | import com.alibaba.jvm.sandbox.api.spi.ModuleJarUnLoadSpi; 21 | import org.slf4j.LoggerFactory; 22 | 23 | /** @author Changjun Xiao */ 24 | public class OnJarUnloadCompleted implements ModuleJarUnLoadSpi { 25 | 26 | @Override 27 | public void onJarUnLoadCompleted() { 28 | closeLogback(); 29 | } 30 | 31 | /** Close logback */ 32 | private void closeLogback() { 33 | try { 34 | ((LoggerContext) LoggerFactory.getILoggerFactory()).stop(); 35 | } catch (Throwable cause) { 36 | cause.printStackTrace(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/aop/Plugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.aop; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.ModelSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public interface Plugin { 23 | 24 | /** 25 | * Plugin name used to generate plugin identifier 26 | * 27 | * @return 28 | */ 29 | String getName(); 30 | 31 | /** 32 | * Model spec used to define the experiment model 33 | * 34 | * @return 35 | */ 36 | ModelSpec getModelSpec(); 37 | 38 | /** 39 | * The point cut 40 | * 41 | * @return 42 | */ 43 | PointCut getPointCut(); 44 | 45 | /** 46 | * Enhancer used to cache necessary experiment model arguments 47 | * 48 | * @return 49 | */ 50 | Enhancer getEnhancer(); 51 | } 52 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/action/exception/ExceptionMessageFlagSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.action.exception; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | 21 | /** @author Changjun Xiao */ 22 | public class ExceptionMessageFlagSpec implements FlagSpec { 23 | 24 | @Override 25 | public String getName() { 26 | return "exception-message"; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "Specify exception message for exception experiment, default value is chaosblade-mock-exception"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-tars/src/main/java/com/alibaba/chaosblade/exec/plugin/tars/client/TarsClientPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.tars.client; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.Enhancer; 20 | import com.alibaba.chaosblade.exec.common.aop.PointCut; 21 | import com.alibaba.chaosblade.exec.plugin.tars.TarsPlugin; 22 | 23 | /** 24 | * @author saikei 25 | * @email lishiji@huya.com 26 | */ 27 | public class TarsClientPlugin extends TarsPlugin { 28 | @Override 29 | public String getName() { 30 | return "client"; 31 | } 32 | 33 | @Override 34 | public PointCut getPointCut() { 35 | return new TarsClientPointCut(); 36 | } 37 | 38 | @Override 39 | public Enhancer getEnhancer() { 40 | return new TarsClientEnhancer(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-zookeeper/src/main/java/com/alibaba/chaosblade/exec/plugin/zookeeper/ZookeeperPathMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.zookeeper; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author liuhq @Date 2020/11/23 上午11:36 */ 22 | public class ZookeeperPathMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return ZookeeperConstant.PATH_MATCHER_NAME; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The path which command used"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/gc/FullGCIntervalFlagSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.gc; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | import com.alibaba.chaosblade.exec.plugin.jvm.JvmConstant; 21 | 22 | /** @author shizhi.zhu@qunar.com */ 23 | public class FullGCIntervalFlagSpec implements FlagSpec { 24 | @Override 25 | public String getName() { 26 | return JvmConstant.FLAG_FULL_GC_INTERVAL; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return "Interval between full gc actions"; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jvm/src/main/java/com/alibaba/chaosblade/exec/plugin/jvm/script/model/ScriptFileFlagSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jvm.script.model; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.FlagSpec; 20 | import com.alibaba.chaosblade.exec.plugin.jvm.JvmConstant; 21 | 22 | /** @author Changjun Xiao */ 23 | public class ScriptFileFlagSpec implements FlagSpec { 24 | 25 | @Override 26 | public String getName() { 27 | return JvmConstant.FLAG_NAME_SCRIPT_FILE; 28 | } 29 | 30 | @Override 31 | public String getDesc() { 32 | return "The Script file full path"; 33 | } 34 | 35 | @Override 36 | public boolean noArgs() { 37 | return false; 38 | } 39 | 40 | @Override 41 | public boolean required() { 42 | return false; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-kafka/src/main/java/com/alibaba/chaosblade/exec/plugin/kafka/model/TopicMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.kafka.model; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | import com.alibaba.chaosblade.exec.plugin.kafka.KafkaConstant; 21 | 22 | /** @author ljzhxx@gmail.com */ 23 | public class TopicMatcherSpec extends BasePredicateMatcherSpec implements KafkaConstant { 24 | @Override 25 | public String getName() { 26 | return TOPIC_KEY; 27 | } 28 | 29 | @Override 30 | public String getDesc() { 31 | return ""; 32 | } 33 | 34 | @Override 35 | public boolean noArgs() { 36 | return false; 37 | } 38 | 39 | @Override 40 | public boolean required() { 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/center/PluginBeanManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.center; 18 | 19 | import com.alibaba.chaosblade.exec.common.aop.PluginBean; 20 | import com.alibaba.chaosblade.exec.common.aop.PluginBeans; 21 | 22 | public interface PluginBeanManager extends ManagerService { 23 | /** 24 | * Get experiment model specification 25 | * 26 | * @param target 27 | * @return PluginBean 28 | */ 29 | PluginBeans getPlugins(String target); 30 | 31 | /** 32 | * Register plugin bean 33 | * 34 | * @param plugin 35 | */ 36 | void registerPlugin(PluginBean plugin); 37 | 38 | /** 39 | * Set the load 40 | * 41 | * @param plugins 42 | * @param target 43 | */ 44 | void setLoad(PluginBeans plugins, String target); 45 | } 46 | -------------------------------------------------------------------------------- /chaosblade-exec-common/src/main/java/com/alibaba/chaosblade/exec/common/model/matcher/SimplePredicateMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.common.model.matcher; 18 | 19 | /** Author: xiaochangjun */ 20 | public class SimplePredicateMatcherSpec extends BasePredicateMatcherSpec { 21 | private String name; 22 | private String desc; 23 | 24 | public SimplePredicateMatcherSpec(String name, String desc) { 25 | this.name = name; 26 | this.desc = desc; 27 | } 28 | 29 | @Override 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | @Override 35 | public String getDesc() { 36 | return desc; 37 | } 38 | 39 | @Override 40 | public boolean noArgs() { 41 | return false; 42 | } 43 | 44 | @Override 45 | public boolean required() { 46 | return false; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-dubbo/src/main/java/com/alibaba/chaosblade/exec/plugin/dubbo/DubboConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.dubbo; 18 | 19 | import com.alibaba.chaosblade.exec.common.plugin.MethodConstant; 20 | 21 | /** @author Changjun Xiao */ 22 | public interface DubboConstant { 23 | 24 | String TIMEOUT_KEY = "timeout"; 25 | String TIMEOUT_EXCEPTION_MSG = "from chaosblade mock timeout"; 26 | 27 | String VERSION_KEY = "version"; 28 | String APP_KEY = "appname"; 29 | String SERVICE_KEY = "service"; 30 | String METHOD_KEY = MethodConstant.METHOD_MATCHER_NAME; 31 | String GROUP_KEY = "group"; 32 | 33 | String TARGET_NAME = "dubbo"; 34 | 35 | String CONSUMER_KEY = "consumer"; 36 | String PROVIDER_KEY = "provider"; 37 | 38 | String CALL_POINT_KEY = "call-point"; 39 | } 40 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-elasticsearch/src/main/java/com/alibaba/chaosblade/exec/plugin/elasticsearch/index/impl/GetRequestIndex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.elasticsearch.index.impl; 18 | 19 | import com.alibaba.chaosblade.exec.plugin.elasticsearch.index.AbstractRequestIndex; 20 | import java.util.Arrays; 21 | import java.util.List; 22 | 23 | /** 24 | * @Author Yuhan Tang 25 | * 26 | * @package: com.alibaba.chaosblade.exec.plugin.elasticsearch.index.impl @Date 2020-10-30 16:16 27 | */ 28 | public class GetRequestIndex extends AbstractRequestIndex { 29 | @Override 30 | public String getName() { 31 | return "get"; 32 | } 33 | 34 | @Override 35 | public List getIndex0(Object target) throws Exception { 36 | return Arrays.asList(index(target, "index")); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-feign/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | chaosblade-exec-plugin 24 | com.alibaba.chaosblade 25 | 1.8.0 26 | 27 | 4.0.0 28 | 29 | chaosblade-exec-plugin-feign 30 | chaosblade-exec-plugin-feign 31 | 32 | 33 | UTF-8 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-hdfs/src/main/java/com/alibaba/chaosblade/exec/plugin/hdfs/common/flag/HdfsFileMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.hdfs.common.flag; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | import com.alibaba.chaosblade.exec.plugin.hdfs.common.HdfsConstant; 21 | 22 | public class HdfsFileMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return HdfsConstant.FLAG_COMMON_FILE; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The target HDFS file path."; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /chaosblade-exec-plugin/chaosblade-exec-plugin-jedis/src/main/java/com/alibaba/chaosblade/exec/plugin/jedis/JedisDatabaseMatcherSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The ChaosBlade Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.chaosblade.exec.plugin.jedis; 18 | 19 | import com.alibaba.chaosblade.exec.common.model.matcher.BasePredicateMatcherSpec; 20 | 21 | /** @author guoping.yao */ 22 | public class JedisDatabaseMatcherSpec extends BasePredicateMatcherSpec { 23 | @Override 24 | public String getName() { 25 | return JedisConstant.DATABASE_INDEX_MATCHER_NAME; 26 | } 27 | 28 | @Override 29 | public String getDesc() { 30 | return "The database index which used"; 31 | } 32 | 33 | @Override 34 | public boolean noArgs() { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean required() { 40 | return false; 41 | } 42 | } 43 | --------------------------------------------------------------------------------