摘要:
目前只有思路,过两天上代码。。。。。。 加权轮询 服务器 权重 A 5 B 3 C 2 1)总的权重是10,先随机出一个数字(肯定是10以内的数字) 2)然后遍历权重的数组[5,3,2]一个一个的去比较 核心代码 遍历ip 拿到权重weight if(offset<weight) return ip 阅读全文
摘要:
Spring Bean的生命周期 Bean的生命周期就是Bean创建—销毁—初始化的过程,这些都由容器管理 我们可以自定义销毁和初始化的方法,特别在配置数据源的时候很有用 @Bean(initMethod="init",destroyMethod="detory") public Car car() 阅读全文
摘要:
栈的概述 栈 Stack Each Java Virtual Machine thread has a private Java Virtual Mahine stack, created at the same time as the thread. A Java Virtual Machine 阅读全文