- 博客(20)
- 收藏
- 关注
原创 jstorm 使用demo
结合fieldsGrouping分组模式的一个jstorm使用实例,指定分组模式可以保证被指定的字段,如果相同值 则tuple会分配给同个task处理。例如 一个tuple有两个字段field1、field2,如果指定field1为分组字段,现在有两个tuple分别是tuple1、tuple2,tuple1中filed1值为a、filed2值为b,tuple2的filed1值为a、filed2值...
2019-03-15 20:58:50 457
原创 spring 函数式获取properties配置文件属性的值
在加了<context:property-placeholder location="classpath*:*.properties"/>后,这种@Value("${name}") 等注解式就可以获取属性值,但是有些场景想要用函数式方式获取属性值,如:getValueByKey(String key)。两步骤即可实现1.继承PropertyPlaceholderConfigure...
2019-03-07 11:09:15 233
原创 在文件指定行插入一段内容
public class Main { public static void main(String[] args){ try { File file1 = new File("src/main/resources/test.txt"); File file2 = new File("src/main/resources/tm
2017-11-26 21:51:34 1137
原创 动态修改日志级别
public class Main { private static Logger logger = LoggerFactory.getLogger(Main.class); public static void main(String[] args) throws MessagingException { //1.logback Logger
2017-10-16 22:22:54 4522 2
原创 maven 插件和资源过滤
src/main/resources true maven-assembly-plugin jar-with-dependencies
2017-03-16 20:58:08 453
原创 context:property-placeholder ignore-unresolvable
同个模块中如果出现多个context:property-placeholder ,location properties文件后,运行时出现Could not resolve placeholder 'key' in string value${key}。原因是在加载第一个context:property-placeholder时会扫描所有的bean,而有的bean里面出现第二个 context:p
2017-01-10 12:22:09 11227
转载 java nio selector
java nio selector转载来源:http://blog.csdn.net/robinjwong/article/details/41792623
2016-11-09 21:40:49 181
原创 gcc编译出错
如果已经安装了gcc,编译时报错,执行 yum install -y glibc*checking for gcc... gccchecking whether the C compiler works... no
2016-08-03 18:42:38 802
原创 单线程生产,多线程消费
#include #include #include #include #include #include #include #include #include #define THREAD_NUM 10using namespace std;pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER;pthread_cond_
2016-06-04 20:39:04 333
转载 error while loading shared libraries: xxx.so.x" 错误的原因和解决办法
转载链接http://www.cnblogs.com/Anker/archive/2013/07/24/3209876.html如果共享库文件安装到了/usr/local/lib(很多开源的共享库都会安装到该目录下)或其它"非/lib或/usr/lib"目录下, 那么在执行ldconfig命令前, 还要把新共享库目录加入到共享库配置文件/etc/ld.so.conf中, 如下:# ca
2015-08-06 09:48:49 1100
原创 centos 下使用libpcap
安装步骤yum -y install *1.flex2.bison3.m44.libpcap-devel5.libpcap
2015-07-28 21:38:08 1155
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人