mirror of
				https://gitee.com/BDWare/cp.git
				synced 2025-06-12 10:44:02 +00:00 
			
		
		
		
	support interface
This commit is contained in:
		
							parent
							
								
									eb91d17982
								
							
						
					
					
						commit
						ac62f7bbf7
					
				@ -8,7 +8,7 @@ plugins {
 | 
				
			|||||||
apply from: '../spotless.gradle'
 | 
					apply from: '../spotless.gradle'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
group = "org.bdware.sc"
 | 
					group = "org.bdware.sc"
 | 
				
			||||||
version = "1.9.7"
 | 
					version = "1.9.9"
 | 
				
			||||||
tasks.withType(JavaCompile) {
 | 
					tasks.withType(JavaCompile) {
 | 
				
			||||||
    //   options.compilerArgs << '-Xlint:none'
 | 
					    //   options.compilerArgs << '-Xlint:none'
 | 
				
			||||||
    //   options.compilerArgs << '-Xlint:deprecation' << "-Werror"
 | 
					    //   options.compilerArgs << '-Xlint:deprecation' << "-Werror"
 | 
				
			||||||
@ -51,7 +51,7 @@ dependencies {
 | 
				
			|||||||
    implementation 'com.sun.mail:javax.mail:1.6.2'
 | 
					    implementation 'com.sun.mail:javax.mail:1.6.2'
 | 
				
			||||||
    implementation 'com.squareup.okhttp3:okhttp:4.9.1'
 | 
					    implementation 'com.squareup.okhttp3:okhttp:4.9.1'
 | 
				
			||||||
    implementation 'org.bdware.bdcontract:sdk-java:1.0.2'
 | 
					    implementation 'org.bdware.bdcontract:sdk-java:1.0.2'
 | 
				
			||||||
    implementation 'org.bdware.doip:doip-audit-tool:1.3.5'
 | 
					    implementation 'org.bdware.doip:doip-audit-tool:1.3.6'
 | 
				
			||||||
    implementation 'org.bdware.doip:doip-sdk:1.4.9'
 | 
					    implementation 'org.bdware.doip:doip-sdk:1.4.9'
 | 
				
			||||||
    implementation fileTree(dir: 'lib', include: '*.jar')
 | 
					    implementation fileTree(dir: 'lib', include: '*.jar')
 | 
				
			||||||
    testImplementation 'junit:junit:4.13.2'
 | 
					    testImplementation 'junit:junit:4.13.2'
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										23
									
								
								src/main/java/org/bdware/sc/compiler/ap/Fork.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								src/main/java/org/bdware/sc/compiler/ap/Fork.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,23 @@
 | 
				
			|||||||
 | 
					package org.bdware.sc.compiler.ap;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.bdware.sc.bean.ForkInfo;
 | 
				
			||||||
 | 
					import org.bdware.sc.bean.RouteInfo;
 | 
				
			||||||
 | 
					import org.bdware.sc.compiler.AnnotationProcessor;
 | 
				
			||||||
 | 
					import org.bdware.sc.node.AnnotationNode;
 | 
				
			||||||
 | 
					import org.bdware.sc.node.ContractNode;
 | 
				
			||||||
 | 
					import org.bdware.sc.node.FunctionNode;
 | 
				
			||||||
 | 
					import org.bdware.sc.node.InterfaceNode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class Fork extends AnnotationProcessor {
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public void processFunction(AnnotationNode anno, ContractNode contractNode,
 | 
				
			||||||
 | 
					            FunctionNode functionNode) {
 | 
				
			||||||
 | 
					        functionNode.setForkInfo(ForkInfo.create(anno, contractNode));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public void processInterface(AnnotationNode anno, ContractNode contractNode,
 | 
				
			||||||
 | 
					            InterfaceNode interfaceNode) {
 | 
				
			||||||
 | 
					        interfaceNode.setForkInfo(ForkInfo.create(anno, contractNode));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -91,13 +91,14 @@ public class DoipClusterServer extends DoipServerImpl {
 | 
				
			|||||||
        JsonObject methodRouteInfoMap = new JsonObject();
 | 
					        JsonObject methodRouteInfoMap = new JsonObject();
 | 
				
			||||||
        // doipOperationName和对应的routeFunctionName的对应关系,存储方式为doipOperationName: routeFunctionName
 | 
					        // doipOperationName和对应的routeFunctionName的对应关系,存储方式为doipOperationName: routeFunctionName
 | 
				
			||||||
        JsonObject methodJoinInfoMap = new JsonObject();
 | 
					        JsonObject methodJoinInfoMap = new JsonObject();
 | 
				
			||||||
 | 
					        JsonObject methodForkInfoMap = new JsonObject();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // 所有Router中用得到的函数(例如Route函数和Route函数依赖的相关函数)
 | 
					        // 所有Router中用得到的函数(例如Route函数和Route函数依赖的相关函数)
 | 
				
			||||||
        JsonObject functions = new JsonObject();
 | 
					        JsonObject functions = new JsonObject();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // 维护RouteInfo,将RouteInfo和doipOperationName的映射关系,以及所有Router中用得到的函数都维护好
 | 
					        // 维护RouteInfo,将RouteInfo和doipOperationName的映射关系,以及所有Router中用得到的函数都维护好
 | 
				
			||||||
        // TODO 移除这部分逻辑?
 | 
					        // TODO 移除这部分逻辑?
 | 
				
			||||||
        cn.maintainRouteJoinInfo(methodRouteInfoMap, methodJoinInfoMap, functions);
 | 
					        cn.maintainRouteJoinInfo(methodRouteInfoMap, methodJoinInfoMap, methodForkInfoMap, functions);
 | 
				
			||||||
        if (clusterInfo != null)
 | 
					        if (clusterInfo != null)
 | 
				
			||||||
            repoHandleValues.add("clusterInfo", clusterInfo);
 | 
					            repoHandleValues.add("clusterInfo", clusterInfo);
 | 
				
			||||||
        if (functions.size() > 0)
 | 
					        if (functions.size() > 0)
 | 
				
			||||||
@ -106,6 +107,8 @@ public class DoipClusterServer extends DoipServerImpl {
 | 
				
			|||||||
            repoHandleValues.add("routeInfo", methodRouteInfoMap);
 | 
					            repoHandleValues.add("routeInfo", methodRouteInfoMap);
 | 
				
			||||||
        if (methodJoinInfoMap.size() > 0)
 | 
					        if (methodJoinInfoMap.size() > 0)
 | 
				
			||||||
            repoHandleValues.add("joinInfo", methodJoinInfoMap);
 | 
					            repoHandleValues.add("joinInfo", methodJoinInfoMap);
 | 
				
			||||||
 | 
					        if (methodForkInfoMap.size() > 0)
 | 
				
			||||||
 | 
					            repoHandleValues.add("forkInfo", methodForkInfoMap);
 | 
				
			||||||
        repoInfo.handleValues.addProperty("cluster", repoHandleValues.toString());
 | 
					        repoInfo.handleValues.addProperty("cluster", repoHandleValues.toString());
 | 
				
			||||||
        String updateRepoInfoRes = repoIrpClient.reRegister(repoInfo);
 | 
					        String updateRepoInfoRes = repoIrpClient.reRegister(repoInfo);
 | 
				
			||||||
        if (updateRepoInfoRes.equals("success")) {
 | 
					        if (updateRepoInfoRes.equals("success")) {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,7 +1,18 @@
 | 
				
			|||||||
package org.bdware.analysis;
 | 
					package org.bdware.analysis;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.bdware.sc.boundry.utils.RocksDBUtil;
 | 
				
			||||||
 | 
					import org.rocksdb.RocksIterator;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class DataBaseProcess {
 | 
					public class DataBaseProcess {
 | 
				
			||||||
 | 
					    private static RocksDBUtil db;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static void main(String[] args) {
 | 
					    public static void main(String[] args) {
 | 
				
			||||||
 | 
					      db =   RocksDBUtil.loadDB("abc",false);
 | 
				
			||||||
 | 
					        RocksIterator iter = db.newIterator();
 | 
				
			||||||
 | 
					        iter.seekToFirst();;
 | 
				
			||||||
 | 
					      for (;iter.isValid();){
 | 
				
			||||||
 | 
					           db.getNext(iter);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
        // long timeJava;
 | 
					        // long timeJava;
 | 
				
			||||||
        // try {
 | 
					        // try {
 | 
				
			||||||
        // // start a process before
 | 
					        // // start a process before
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user