- 博客(174)
- 问答 (1)
- 收藏
- 关注
原创 枚举Enum
什么是枚举?为什么要用枚举?枚举可以怎么用?Pros VS Cons 1.什么是枚举首先我们从一个枚举类的反编译文件来认识一下枚举类Compiled from "ColorEnum.java"public final class com.james.learning.j2se.enums.ColorEnum extends java.lang.Enum<...
2016-12-21 11:01:03
194
原创 KAFKA
https://cwiki.apache.org/confluence/display/KAFKA/FAQ#FAQ-HowdoIgetexactly-oncemessagingfromKafka? How do I get exactly-once messaging from Kafka?Exactly once semantics has two parts: av...
2016-08-21 09:10:01
302
原创 系统监控
起因Mercury:唯品会全链路应用监控系统解决方案详解(含PPT)在里面看到这个好东西 Google DapperDapper, a Large-Scale Distributed Systems Tracing Infrastructure 那么我们来翻译一下Dapper到底是个啥。 首先是论文的概括: ...
2016-08-08 22:53:51
193
原创 认识 同步 异步 阻塞 非阻塞
学习NIO就必然会遇到几个概念: BIO NIO AIO想必说各个代表的含义大家都能说出来,但是有没有细想过BIO block了到底是什么,NIO N在哪里,AIO是怎么通过底层系统实现的? 说到这里,我想理一些概念,作为一个严谨的、相信科学的程序员我们如果要说术语那么就要说得精准。(PS:看了很多网上的定义,说明也有同道中人,但...
2016-07-08 10:44:08
175
原创 spring 新特性
https://spring.io/blog/2012/05/23/transactions-caching-and-aop-understanding-proxy-usage-in-spring https://spring.io/blog/2007/07/19/debunking-myths-proxies-impact-performance/
2016-04-12 15:49:55
117
原创 mongodb 3.2.1 下载提供
正版官方 下载地址 http://share.weiyun.com/9bee718fcaac437c0b09726bc8fa9958 不谢自取
2016-01-27 11:47:13
179
logback.xml immediate=false 到底缓存空间是多大
从logback官方网站上来,immediateFlush设置成false以后有5 quintuple倍吞吐量的提升,但是,会有部分缓存的日志不会输出到日志文件里,如果这时,appender遇到错误会导致缓存的部分丢失,但是,丢失到底是多少呢?官方没有说明了,那么只有深挖到logback里面去看一下到底是多少了,干起来! Immediate flushing of the o...
2015-12-19 14:54:18
3207
1
原创 httpclient 3.X 4.X 性能优化
3.Xhttp://hc.apache.org/httpclient-3.x/performance.html public class MultiThreadedExample { /** * Constructor for MultiThreadedExample. */ public MultiThreadedExample()...
2015-12-12 17:27:57
297
原创 JSON Config文件,另一种properties
http://blog.csdn.net/wsscy2004/article/details/24723905
2015-08-31 11:00:42
219
原创 Linux performance Monitoring
附件是全文件,现在根据文件来做笔记。 系统调优就是找出系统瓶颈,降低并消除瓶颈。操作系统调优从以下几方面出发:CPUMemoryIONetwork而且几方面相互依赖,一荣俱荣,一损俱损。 1.定性系统类型1.1 强IO型 例:数据库 1.2 强CPU型 例: web server,mail server,re...
2015-08-27 16:03:52
120
原创 Mysql refresh
Mysql Refresh1. KEY,INDEX,UNIQUE,PRIMARY,FULL-TEXT区别 DifferencesKEY or INDEX refers to a normal non-unique index. Non-distinct values for the index are allowed, so the index may contain r...
2015-08-10 14:34:10
401
原创 NIO learning
NIO Learning1.Selector api 解释http://tutorials.jenkov.com/java-nio/selectors.html
2015-08-09 20:24:12
107
原创 spring boot
1.微服务框架Spring Boot2.用起来非常方便,配置文件不用了,tomcat内置了http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-documentation3.mvn spring-boot:run 就可以奔跑了4.加入以下maven plugin就可以直接...
2015-08-07 14:25:46
125
原创 spring xsd load
1. http://stackoverflow.com/questions/20894695/spring-configuration-xml-schema-with-or-without-version2. http://blog.csdn.net/bluishglc/article/details/7596118
2015-07-08 16:47:20
107
原创 springmvc
DispatcherServlet RequestContextUtils can get WebApplicationContextHandlerMapping HandlerMapping是把一个URL指定到一个Controller上 HandlerAdapter HandlerAdapter是促进DispatcherServlet和第三方框架简单集成的系统级接口。除...
2015-05-14 16:58:01
129
原创 网络知识定向,扫盲
TCP/IP、Http、Socket的区别http://jingyan.baidu.com/article/08b6a591e07ecc14a80922f1.html 多播http://li-sir.iteye.com/blog/837344 心跳检测http://weixiaolu.iteye.com/blog/1544860http://weixiaolu....
2015-05-06 20:14:32
104
原创 java.net.socketinputstream.socketread0 hangs thread
http://javaeesupportpatterns.blogspot.jp/2011/04/javanetsocketinputstreamsocketread0.htmlhttp://thushw.blogspot.jp/2010/10/java-urlconnection-provides-no-fail.html
2015-04-29 16:25:33
332
原创 mybatis不输出sql原因
mybatis默认使用log4j,当有self4j这个日志jar包存在时会无法打印sql,请移除或者在工程启动时显示设置mybatis使用的日志类:log4j.logger.org.apache.ibatis=debug,stdout log4j.logger.java.sql=debug,stdout这样有时可能却不是个可行的办法,原因在于不可能移除self4j包,因...
2015-02-13 15:54:16
828
原创 RxJava 学习
RXJava 学习之路1. 上链接 http://blog.danlew.net/2014/09/15/grokking-rxjava-part-1/ Git Wiki https://github.com/ReactiveX/RxJava/wikiGit上演示的都是以Groovy或者是JAVA8的lamada表达式来写的,对JAVA6程序员来说不是那易看,(lamada...
2015-01-29 14:22:57
126
JMX远程监控tomcat
JMX远程监控tomcat1.tomcat下创建下setenv.sh #!/bin/shexport JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=xxx.xxx.xxx.xxx -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=xxxx -Dc...
2015-01-18 14:54:49
120
原创 log4j.xml里实现读取变量${variable} (spring容器篇)
log4j.xml里实现读取变量(spring容器篇)需求背景公司日志系统不太完善,集群的服务器日志散落在不同的服务器上,要从公司层面解决这个问题不太现实,目前的项目进度也不允许,当前系统会有很多对接,有上游下游,生产环境调试看日志太麻烦了, 所以准备自己动手做一个workaround。 另一方面,公司开发、上线有好几套环境,不可能每套环境都去改一次,用变量可以把对应信息写...
2015-01-16 13:35:54
7723
原创 ubuntu 设置分辨率
I was having the same issue with the resolution. I'm using VirtualBox and the resolution only had one resolution option.I went to the search bar and searched for "Additional drivers"Next, I clic...
2014-12-10 19:38:49
135
原创 对象mapping dozer,各种实现对比
DozerDozer is a Java Bean to Java Bean mapper that recursively copies data from one object to another. Typically, these Java Beans will be of different complex types.Dozer supports simple prope...
2014-12-03 11:25:21
442
原创 install mysql on linux
http://dev.mysql.com/doc/refman/5.1/en/linux-installation-native.html http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
2014-11-22 00:07:50
108
原创 js 时间格式化
$scope.getTimeString = function (longTimes){ var d = new Date (longTimes); var result =""; result += d.getFullYear(); result += "-"; result += d.getMonth(); r...
2014-11-14 10:08:55
97
原创 使用Hibernate Validator 完成 字段的自动验证
如题 1. maven 中引入 <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.2.0.Final</version&
2014-11-13 18:23:12
167
原创 httpclient 4.0.1 learning
HttpClient client = new DefaultHttpClient (); HttpPost post = new HttpPost(url); List<NameValuePair> data = Lists.newArrayList(); data.add(new BasicNameValuePair("sign","s...
2014-11-13 14:32:09
162
原创 Data truncation: Data too long for column 'name' at row 1
Data truncation: DData truncation: Data too long for column 'name' at row 1ata too long for column 'name' at row 1 解决方案:在connection url里加上 ?jdbcCompliantTruncation=false...
2014-09-25 17:14:55
217
原创 JAVA 序列化
再读序列化http://www.blogjava.net/jiangshachina/archive/2012/02/13/369898.html
2014-05-11 18:06:56
94
原创 synchronized (obj) 锁住不同的对象的话
Obj package com.james.thread.sync;public class SyncObject { byte[] lock1 = new byte[0]; byte[] lock2 = new byte[0]; int i = 1; public int minus() { try { synchronized...
2014-03-27 08:58:49
461
原创 redis 一个巧妙的存储方案
http://instagram-engineering.tumblr.com/post/12202313862/storing-hundreds-of-millions-of-simple-key-value-pairs
2014-03-24 23:12:28
100
原创 springMVC + velocity
java.lang.ClassNotFoundException: org.springframework.web.servlet.view.velocity.VelocityConfigurer 这个问题加入 spring-context-support-3.2.2.RELEASE.jar 就OK了 velocity eclipse插件https://code.googl...
2014-03-22 12:38:03
86
原创 Restful tutorial design
http://docs.oracle.com/javaee/6/tutorial/doc/giepu.htmlhttp://www.mastertheboss.com/resteasy/resteasy-tutorialhttp://www.jboss.org/resteasy/docshttp://www.vinaysahni.com/best-practices-f...
2014-02-12 10:25:21
76
原创 软件发布生命周期 GA BETA 啥意思
引自 http://en.wikipedia.org/wiki/Software_release_life_cycle Pre-alpha[edit]Pre-alpha refers to all activities performed during the software project before testing. These activities can inclu...
2014-01-14 10:20:50
1447
原创 windows 下安装,配置 mod_cluster
http://docs.jboss.org/mod_cluster/1.2.0/html/Quick_Start_Guide.html#d0e250安装download from http://www.jboss.org/mod_cluster/downloads/1-2-6-Final-bin windows httpd+ssl binariesunzip windo...
2013-10-11 09:04:34
195
原创 Spring MVC samples
SVNhttps://src.springframework.org/svn/spring-samples/ githubhttps://github.com/SpringSource/spring-webflow-samples
2013-08-18 23:06:48
116
原创 Spring MVC junit Test
samples http://blog.springsource.org/2012/11/12/spring-framework-3-2-rc1-spring-mvc-test-framework/ https://github.com/SpringSource/spring-mvc-showcase/blob/master/src/test/java/org/spring...
2013-08-18 22:03:32
84
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人