comparison src/treecms/tree/cassandra/v1/CassandraForest.java @ 9:17ed97ca9960

commit
author shoshi
date Mon, 18 Apr 2011 01:07:27 +0900
parents f96193babac0
children bb9760760744
comparison
equal deleted inserted replaced
8:f96193babac0 9:17ed97ca9960
33 33
34 import treecms.api.Forest; 34 import treecms.api.Forest;
35 import treecms.api.Node; 35 import treecms.api.Node;
36 import treecms.api.NodeData; 36 import treecms.api.NodeData;
37 import treecms.api.NodeID; 37 import treecms.api.NodeID;
38 import treecms.tree.cassandra.v1.util.CassandraClientThreadFactory;
38 import treecms.tree.id.AbstractRandomNodeID; 39 import treecms.tree.id.AbstractRandomNodeID;
39 40
40 /** 41 /**
41 * Cassandra上で非破壊的木構造を実現するためのForestの実装です。 42 * Cassandra上で非破壊的木構造を実現するためのForestの実装です。
42 * 43 *
76 private ConcurrentHashMap<NodeID,CassandraNode> m_cache; 77 private ConcurrentHashMap<NodeID,CassandraNode> m_cache;
77 private ConcurrentHashMap<String,CassandraNode> m_tipCache; 78 private ConcurrentHashMap<String,CassandraNode> m_tipCache;
78 79
79 public CassandraForest(String _host,int _port,String _ks,int _threads) 80 public CassandraForest(String _host,int _port,String _ks,int _threads)
80 { 81 {
81 m_service = Executors.newFixedThreadPool(_threads,new ClientThreadFactory(_host,_port)); 82 m_service = Executors.newFixedThreadPool(_threads,new CassandraClientThreadFactory(_host,_port));
82 83
83 m_cache = new ConcurrentHashMap<NodeID,CassandraNode>(); 84 m_cache = new ConcurrentHashMap<NodeID,CassandraNode>();
84 m_tipCache = new ConcurrentHashMap<String,CassandraNode>(); 85 m_tipCache = new ConcurrentHashMap<String,CassandraNode>();
85 } 86 }
86 87