Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature.arklet_v1' into feature.…
Browse files Browse the repository at this point in the history
…arklet_v1

# Conflicts:
#	arklet/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/HealthServiceImpl.java
  • Loading branch information
ColdClear committed Sep 10, 2023
2 parents 289d507 + ee2e8b0 commit c4615a9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
6 changes: 5 additions & 1 deletion arklet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ Arklet provides an operational interface for delivery of SofaArk bases and modul

Arklet is internally constructed by **ArkletComponent**

![png](https://user-images.githubusercontent.com/11410549/264982346-6a890bec-0c62-403a-81e4-ee0e6246ad23.png)
![image](https://github.com/sofastack/sofa-serverless/assets/11410549/a2740422-569e-4dd3-9c9a-1503996bd2f1)
- ApiClient: The core components responsible for interacting with the outside world
- CommandService: Arklet exposes capability instruction definition and extension
- OperationService: Ark Biz interacts with SofaArk to add, delete, modify, and encapsulate basic capabilities
- HealthService: Based on health and stability, base, Biz, system and other indicators are calculated

The collaboration between them is shown in the figure
![overview](https://user-images.githubusercontent.com/11410549/266193839-7865e417-6909-4e89-bd48-c926162eaf83.jpg)


Of course, you can also extend Arklet's component capabilities by implementing the **ArkletComponent** interface

# Command Extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import com.alipay.sofa.ark.spi.model.Biz;
import com.alipay.sofa.serverless.arklet.core.command.builtin.BuiltinCommand;
import com.alipay.sofa.serverless.arklet.core.command.builtin.model.BizModel;
import com.alipay.sofa.serverless.arklet.core.command.builtin.model.BizInfo;
import com.alipay.sofa.serverless.arklet.core.command.meta.AbstractCommandHandler;
import com.alipay.sofa.serverless.arklet.core.command.meta.Command;
import com.alipay.sofa.serverless.arklet.core.command.meta.Output;
Expand All @@ -32,22 +32,22 @@
* @author mingmen
* @date 2023/6/14
*/
public class QueryAllBizHandler extends AbstractCommandHandler<InputMeta, List<BizModel>> {
public class QueryAllBizHandler extends AbstractCommandHandler<InputMeta, List<BizInfo>> {

@Override
public Output<List<BizModel>> handle(InputMeta inputMeta) {
public Output<List<BizInfo>> handle(InputMeta inputMeta) {
List<Biz> bizList = getOperationService().queryBizList();
List<BizModel> bizModels = new ArrayList<>(bizList.size());
List<BizInfo> bizInfos = new ArrayList<>(bizList.size());
for (Biz biz : bizList) {
BizModel model = new BizModel();
BizInfo model = new BizInfo();
model.setBizName(biz.getBizName());
model.setBizVersion(biz.getBizVersion());
model.setBizState(biz.getBizState());
model.setMainClass(biz.getMainClass());
model.setWebContextPath(biz.getWebContextPath());
bizModels.add(model);
bizInfos.add(model);
}
return Output.ofSuccess(bizModels);
return Output.ofSuccess(bizInfos);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @author mingmen
* @date 2023/6/14
*/
public class BizModel {
public class BizInfo {
private String bizName;

private String bizVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.alipay.sofa.serverless.arklet.core.ArkletComponent;
import com.alipay.sofa.serverless.arklet.core.health.indicator.ArkletBaseIndicator;
import com.alipay.sofa.serverless.arklet.core.health.model.Health;
import com.alipay.sofa.serverless.arklet.core.command.builtin.model.BizModel;
import com.alipay.sofa.serverless.arklet.core.command.builtin.model.BizInfo;
import com.alipay.sofa.serverless.arklet.core.command.builtin.model.PluginModel;

/**
Expand All @@ -37,7 +37,7 @@ public interface HealthService extends ArkletComponent {

Health queryModuleInfo(String type, String name, String version);

Health queryModuleInfo(BizModel bizModel);
Health queryModuleInfo(BizInfo bizInfo);

Health queryModuleInfo(PluginModel pluginModel);

Expand Down

0 comments on commit c4615a9

Please sign in to comment.