提交 plantuml 图, 对细节修改都要修改内容 有绩可循

This commit is contained in:
huangsimin 2022-07-05 13:59:07 +08:00
parent 790554d773
commit f9b1ca95d8
5 changed files with 75 additions and 7 deletions

43
design_com.puml Normal file
View File

@ -0,0 +1,43 @@
@startuml 数据流组件图
package "探针组" {
[探针1] - grpc1
[探针2] - grpc2
[探针3] - grpc3
[探针4] - grpc4
}
node "数据流" {
grpc1 --> [数据流1]
grpc2 --> [数据流2]
grpc3 --> [数据流3]
grpc4 --> [数据流4]
}
node "配置中心" {
nacos -left-> 数据流
nacos -left-> 探针组
nacos -down-> 大数据计算
}
database "mongodb" {
node "mongod-ori-master"
node "mongod-ori-slave"
node "mongod-bmp-master"
node "mongod-bmp-slave"
数据流 -down-> mongodb
}
node "大数据计算" {
[计算任务1]
[计算任务2]
[计算任务3]
[计算任务4]
}
mongodb -> 大数据计算
@enduml

26
design_main.puml Normal file
View File

@ -0,0 +1,26 @@
@startuml 时序图
配置中心 <- 探针组: 读取配置
数据流 -> 配置中心: 读取配置
group 数据流处理过程
探针组 -> 数据流: 数据流jraft(master) 通过 grpc protobuf数据
数据流 -> 数据流: 分配数据到jraft节点处理
数据流 -> 数据流: jraft状态机做状态同步
数据流 -> 数据流: 根据数据类型做处理
数据流 -> 配置中心: 更新配置
数据流 -> 数据存储: 入库 mongodb
end group
group 大数据计算过程
配置中心 -> 大数据计算: 读取相关配置
数据存储 <- 大数据计算: 读取需要的数据
大数据计算 -> 大数据计算: 计算需求
大数据计算 -> 配置中心: 更新配置
大数据计算 -> 数据存储: 提炼后的数据入库
end group
@enduml

View File

@ -197,7 +197,6 @@
<artifactId>protobuf-maven-plugin</artifactId> <artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version> <version>0.6.1</version>
<configuration> <configuration>
<pluginId>grpc-java</pluginId> <pluginId>grpc-java</pluginId>
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact> <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact> <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
@ -213,7 +212,6 @@
<goal>test-compile-custom</goal> <goal>test-compile-custom</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
@ -263,6 +261,7 @@
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo> <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

@ -49,14 +49,14 @@ public class CollectPackets extends CollectPacketsServerImplBase {
Config.UseConfig( (cnf) -> { Config.UseConfig( (cnf) -> {
var tid = cnf.get("test_id"); var tid = cnf.get("test_id");
log.info("{}",tid); log.info("config {}",tid);
return null; return null;
}); });
Map<String, Function<Any, Object>> domap = new HashMap(); Map<String, Function<Any, Object>> domap = new HashMap();
System.out.println( Any.pack(ApmBaseDataFlow.newBuilder().build()).getTypeUrl() ); log.info("{}", Any.pack(ApmBaseDataFlow.newBuilder().build()).getTypeUrl() );
System.out.println( AppFlow.class.hashCode() ); log.info("{}", AppFlow.class.hashCode() );
domap.put(Any.pack(ApmBaseDataFlow.newBuilder().build()).getTypeUrl(), (p)->{ domap.put(Any.pack(ApmBaseDataFlow.newBuilder().build()).getTypeUrl(), (p)->{
try { try {
@ -131,7 +131,7 @@ public class CollectPackets extends CollectPacketsServerImplBase {
// MyThing.Response response = blockingStub.sayHi(request); // MyThing.Response response = blockingStub.sayHi(request);
// System.out.println(response.getName()); // System.out.println(response.getName());
// } // }
var managedChannelBuilder = ManagedChannelBuilder.forAddress("10.1.1.117", 50051); var managedChannelBuilder = ManagedChannelBuilder.forAddress("10.1.1.117", 60010);
var channel = managedChannelBuilder.usePlaintext().build(); var channel = managedChannelBuilder.usePlaintext().build();
var stub = CollectPacketsServerGrpc.newBlockingStub(channel); var stub = CollectPacketsServerGrpc.newBlockingStub(channel);
// stub.withCompression("snappy"); // stub.withCompression("snappy");

View File

@ -3,7 +3,7 @@
class="ch.qos.logback.core.ConsoleAppender"> class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>
<pattern> <pattern>
%d{yyyyMMdd HH:mm:ss.SSS} %-5level%thread(%file:%line): %msg%n %d{yyyyMMdd HH:mm:ss.SSS} %-5level%thread\(%file:%line\): %msg%n
</pattern> </pattern>
</encoder> </encoder>
</appender> </appender>