Disconf source code interpretation

Disconf is mainly divided into three projects:
    1-disconf.core mainly provides resful retry of the helper class http, etc., zk wather encapsulates, strengthens the retry mechanism, and does very thin things.
   2-disconf.client is strongly dependent on spring, provides package scanning, custom annotation parsing and assembly, facet logic processing aspectj, obtaining remote configuration, and landing. There are many things to do and many dependencies.
   3-disconf.web is a web application for background management, implemented by spring mvc restful api, a development mode with front-end and back-end separation, providing login, background management functions, and a little more business things, maybe because of open source reasons, many small functions The bug does not provide the function of permission management.


Problem: private Map<String, DisconfCenterFile> confFileMap = new HashMap<String, DisconfCenterFile>();

the internal implementation is a hashMap


"main" prio=5 tid=0x00007fa423805800 nid=0x1703 runnable [0x0000700000219000]
   java.lang.Thread.State: RUNNABLE
at java.util.HashMap.addEntry(HashMap.java:884)
at java.util.HashMap.put(HashMap.java:505)
at com.baidu.disconf.client.common.model.DisconfCenterFile.getKV(DisconfCenterFile.java:134)
at com.baidu.disconf.client.usertools.impl.DisconfDataGetterDefaultImpl.getByFile(DisconfDataGetterDefaultImpl.java:28)
at com.baidu.disconf.client.usertools.DisconfDataGetter.getByFile(DisconfDataGetter.java:22)
at com.example.disconf.demo.task.DisconfDemoTask$1.run(DisconfDemoTask.java:80)
at java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy.rejectedExecution(ThreadPoolExecutor.java:2025)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372)
at com.example.disconf.demo.task.DisconfDemoTask.run(DisconfDemoTask.java:77)
at com.example.disconf.demo.DisconfDemoMain.main(DisconfDemoMain.java:36)



aspctj 
"main" prio=5 tid=0x00007fd6ac007000 nid=0x1703 runnable [0x0000700000219000]
   java.lang.Thread.State: RUNNABLE
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.aspectj.weaver.reflect.Java15AnnotationFinder.getAnnotationFromMember(Java15AnnotationFinder.java:100)
at org.aspectj.weaver.reflect.ReflectionVar.getBindingAtJoinPoint(ReflectionVar.java:162)
at org.aspectj.weaver.reflect.ShadowMatchImpl.getPointcutParameters(ShadowMatchImpl.java:108)
at org.aspectj.weaver.reflect.ShadowMatchImpl.matchesJoinPoint(ShadowMatchImpl.java:88)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:336)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:167)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)
at com.example.disconf.demo.config.CodeConfig$$EnhancerBySpringCGLIB$$2495de40.getCodeError(<generated>)
at com.example.disconf.demo.task.DisconfDemoTask.run(DisconfDemoTask.java:71)
at com.example.disconf.demo.DisconfDemoMain.main(DisconfDemoMain.java:36)



java.lang.Thread.State: RUNNABLE
at sun.reflect.Reflection.getCallerClass(Native Method)
at java.lang.Class.getDeclaredFields(Class.java:1810)
at com.baidu.disconf.client.store.aspect.DisconfAspectJ.decideAccess(DisconfAspectJ.java:60)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)
at com.example.disconf.demo.config.JedisConfig$$EnhancerBySpringCGLIB$$ce8fc02a.getPort(<generated>)
at com.example.disconf.demo.task.DisconfDemoTask.run(DisconfDemoTask.java:70)
at com.example.disconf.demo.DisconfDemoMain.main(DisconfDemoMain.java:36)

The code of DISCCONF itself is very badly written, the process of using Problems often occur in , and it is not recommended to use it.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326540750&siteId=291194637