hector tips
hector-v2-client-doc.pdf 讀書筆記
LoadBalancingPolicy
Hector uses the slf4j logging API with the Log4J bridge to provide runtime logging.
Hector測試相關的類:
EmbeddedServerHelper
BaseEmbeddedServerTest
建立Keyspace:
Cluster cluster = HFactory.getCreateCluster("TestCluster",
new CassandraHostConfigurator("localhost:9160"));
Keyspace keyspace = HFactory.createKeyspace("Keyspace1",cluster);
StringSerializer
OrderPreservingPartitioner
IndexedSlicesQuery
HFactory.createIndexedSlicesQuery(keyspace, se, se,, LongSerializer.get());
indexedSlicesQuery.addEqualsExpression("birthyear", 1975L);
indexedSlicesQuery.setColumnNames("birthdate","firstname");
indexedSlicesQuery.setColumnFamily("Users");
indexedSlicesQuery.setStartKey("");
QueryResult
indexedSlicesQuery.execute();
IndexedSlicesQuery can also have expressions applied on other columns in conjunction with
the addEqualsExpression. There are two important points to note in using additional index
expressions:
● At least one equals expression against an indexed column must always be present via
addEqualsExpression
● The columns for additional clauses do not have have to be configured as indexed for the
ColumnFamily
Maven Repository for Dependencies
hector to store supercolumn:
Mutator
HFactory.createMutator(keyspace, stringSerializer);
mutator.insert("billing", "Super1", HFactory.createSuperColumn("jsmith",
Arrays.asList(HFactory.createStringColumn("first", "John")),
stringSerializer, stringSerializer, stringSerializer));
SuperColumnQuery
HFactory.createSuperColumnQuery(keyspace, stringSerializer,
stringSerializer, stringSerializer, stringSerializer);
superColumnQuery.setColumnFamily("Super1")
.setKey("billing").setSuperName("jsmith");
Result
To create your own approach to fail-over, for example to try the next three hosts pausing 200
milliseconds between each, you would construct the following FailoverPolicy:
FailoverPolicy failoverPolicy = new FailoverPolicy(3,200);
attributes exposed via JMX:
status and counters on the connections and pools
aggreate performance statics
If you do not want the overhead of having Pef4j running, it is possible to disable the statistics
gathering entirely by setting the system property com.prettyprint.cassandra.load_hector_log4j
to false at system startup and setting the level in your logging configuretion to WARN for the
appender named: me.prettyprint.hector.TimingLogger
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23937368/viewspace-1051381/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 看了四個小時hector guide,借用一個hector的使用清單來總結下hector的使用GUIIDE
- cassandra&hector版本問題
- [論文閱讀] Hector MappingAPP
- 簡單的hector連線casssandra測試
- 使用Hector和Scala持久化Cassandra資料庫持久化資料庫
- hector-v2-client-doc.pdf read notesclient
- Tips
- NPM TipsNPM
- AutoLayout Tips
- Tips HTMLHTML
- 前端 - tips前端
- Swift TipsSwift
- NumPy Tips
- Git TipsGit
- note tips
- PB Tips
- Tips for SD
- interview tipsView
- Mysql tipsMySql
- SAP Tips
- English Tips
- Docker TipsDocker
- ISPF tips
- 雜項 tips
- Tips: EloquentModel
- Linux TipsLinux
- typescript + amd tipsTypeScript
- jQuery tips and tricksjQuery
- 《iOS Tips 一》iOS
- GoldenGate TipsGo
- SELinux tipsLinux
- gulp some tips
- Some tips of Barcelona
- backup and restore tipsREST
- installation tips
- Sed Tips and Tricks
- layer小tips
- Troubleshooting tips