- 博客(21)
- 资源 (3)
- 收藏
- 关注
原创 【知识库】--Mysql InnoDB数据库事务四种隔离级别(156)
Mysql InnoDB数据库 数据库事务隔离级别 1 read uncommitted 【no commit 】 2 read committed 【until other commit】 3 repeatable read 【until self commit】 4 serializable 【lock any read 】 参考: http://blog.csdn.net/wud
2017-03-29 21:30:01 457
原创 【知识库】--Use Zookeeper Cluster Server with Java(150)
单机模拟集群#定义配置文件如下 :三个端口 clientPort=2182 clientPort=2183 clientPort=2184 三个数据目录 dataDir=/home/zoo/z2/data dataDir=/home/zoo/z3/data dataDir=/home/zoo/z4/data# The number of milliseconds of each ticktick
2017-03-23 23:25:00 363
原创 【知识库 】--Coordinating Actors In Java Use Akka(150)
背景:统计系统目录文件大小设计: 使用Akka actors 不同角色 执行相应的职责 如下图表达 实现: 【1】首先定义 SizeCollector 类可以接受与的消息类型 【2】遍历和计算文件大小的处理器 FileProcessor 【3】总和执行的动作 【4】启动import akka.actor.UntypedActor;import akka.actor.UntypedA
2017-03-23 08:34:40 271
原创 【技能库】--mybatis 批量插入(149)
<insert id="insertList" parameterType="java.util.List"> INSERT INTO <include refid="tableName"/> (a,b) VALUES <foreach collection="list" item="item" index="index" separa
2017-03-22 21:10:01 413
原创 【知识库】为什么把占空间的字段单独存一张表--mysql表设计(146)
前提:mysql数据库&InnoDB引擎 InnoDB使用了B+树&聚簇索引 B+树: 直接上图: 聚簇索引: 所谓聚簇索引,就是指主索引文件和数据文件为同一份文件,聚簇索引主要用在Innodb存储引擎中。在该索引实现方式中B+Tree的叶子节点上的data就是数据本身,key为主键,如果是一般索引的话,data便会指向对应的主索引。解释blog题目: 因为InnoDB的ta
2017-03-19 11:15:51 1241 1
原创 【知识库】--mysql engines MyISAM vs InnoDB(146)
MyISAM vs InnoDB MyISAM:不支持事务,不支持行级锁; 支持 fullindex indexing ; 最多 64 keys per table; 不支持外键; 支持table level locking; three files: formate file (store table structure), data file store rows,index fi
2017-03-19 10:24:48 396
原创 【技能库】--完整的RPC框架示例(143)
1 首先了解java Proxy原理 2 了解Socket编程 接口interface DUODUO { String getInfos1(); String getInfos2(); void setInfo(String infos1, String infos2); void display(String play);}实现class DUODU
2017-03-16 07:57:36 526
原创 【技能库】@Cacheable @CachePut Spring 缓存示例(142)
配置 <!-- 启动缓存注解功能 --> <cache:annotation-driven/> <!--generic cache manager --> <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager"> <property name="
2017-03-15 22:53:54 1540
原创 【bug】previously initiated loading for a different type with name "javax/servlet/ServletContext"(142)
<dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>3.0</version> <scope>provided</scope> </dependency>要找
2017-03-15 21:39:48 5307
翻译 知识库--Working with Multiple Actors No Using Thread Pool (139)
1 Creating Actors 2 Sending and Receiving Messages 3 Working with Multiple Actors 4 Coordinating Actors 5 Using Typed Actors 6 Typed Actors and Murmurs 7 Mixing Actors and STM 8 Using Tra
2017-03-12 22:07:53 272
翻译 知识库--Sending and Receiving Messages By Akka Using Java(139)
1 Creating Actors 2 Sending and Receiving Messages 3 Working with Multiple Actors 4 Coordinating Actors 5 Using Typed Actors 6 Typed Actors and Murmurs 7 Mixing Actors and STM 8 Using Tra
2017-03-12 19:26:25 358
翻译 知识库--Creating Actors By Akka Using Java(139)
1 Creating Actors 2 Sending and Receiving Messages 3 Working with Multiple Actors 4 Coordinating Actors 5 Using Typed Actors 6 Typed Actors and Murmurs 7 Mixing Actors and STM 8 Using Transactor
2017-03-12 17:21:56 461
原创 技能库--线上jvm内存对象分析(137)
机器内存占用排序:ps -eo rss,pmem,pcpu,vsize | sort -k 1 -r -n参考: http://www.cnblogs.com/JemBai/archive/2011/06/21/2086184.htmljinfo:可以输出并修改运行时的java 进程的opts。 jps:与unix上的ps类似,用来显示本地的java进程,可以查看本地运行着几个java程序,并
2017-03-10 20:38:38 764
翻译 知识库--Limitations of STM 【高并发写 not in favor】(137)
STM的优点 STM eliminates explicit synchronization. We no longer have to worry if we forgot to synchronize or if we synchronized at the wrong level. There are no issues of failing to cross the memory barr
2017-03-10 08:32:58 485
翻译 知识库--The Write Skew Anomaly Fixed By Akka(136)
/** 两个账户总和大于等于1000才能取款 In Handling Write Skew Anomaly, we discussed write skew and how Clojure STM handles it. Akka also has support for dealing with write skew, *but we have to configure it*. OK, tha
2017-03-09 08:27:15 430
翻译 知识库--Collections and Transactions Using TransactionalMap(136)
Akka && Java && Collections && Transactions 集合事务 public class Scores { final private TransactionalMap<String, Integer> scoreValues = new TransactionalMap<String, Integer>(
2017-03-09 08:14:22 398
翻译 知识库--Akka Commit and Rollback Events in Java(136)
延迟:执行真正的 事务 补偿:回滚 补偿 public class Counter { private final Ref<Integer> value = new Ref<Integer>(1); public void decrement() { new Atomic<Integer>() { pu
2017-03-09 08:07:32 321
翻译 知识库--Akka 事务配置-using jvm(134)
Akka assumes a number of default settings, but it allows us to change these either programmatically or through the configuration file akka.conf.使用编程方式配置事务 We can programmatically change the settings o
2017-03-07 08:46:50 349
翻译 知识库--Creating Nested Transactions By Akka 内存嵌套事务(129)
public class Account { final private Ref<Integer> balance = new Ref<Integer>(); public Account(int initialBalance) { balance.swap(initialBalance);//自带事务 } public int getBalanc
2017-03-02 08:28:33 465
原创 知识库--本地缓存设计(128)
private LoadingCache<String, String> cCodeCache; private static final String qurl = "http://"; /** * http 请求 IO型计算 采用线程池 */ private static ExecutorService executor = new ThreadPoolE
2017-03-01 14:00:47 442
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人