cassandra hector使用方法

来源:互联网 发布:刺客信条3a卡优化 编辑:程序博客网 时间:2024/05/16 02:03

1.hector jar包下载

   如果不想自己编译,那么可以直接从这个地址下载jar包:https://github.com/hector-client/hector/downloads

(也可以下载源码自己编译,后续测试成功后加上来)

2.在eclipse中新建一个空的java工程,导入下载打的jar包

3.下载一个例子工程:https://github.com/zznate/hector-examples

    把例子代码导入2的工程中,在Cofigure build path中选择source -->> add folder-->>选择src/java/main作为包的起始目录

4.下载mavon,把bin目录加入到系统path中,进入2的工程根目录,根据3的readme文档,执行


5.启动cassandra后,启动hector后可能有一些keyspace和columnfamily不存在,需要使用自带的客户端手动创建



hector源代码编译:

1.下载源码:https://github.com/rantav/hector

2.新建eclipse工程,在pom.xml文件中添加:

<dependency>    <groupId>me.prettyprint</groupId>    <artifactId>hector-core</artifactId>    <version>0.8.0-2</version></dependency>

3.进入工程根目录,运行:

mvn install -Dmaven.test.skip=true -DperformRelease=true

执行完成后,如下图:


4.如何使用?

  网站上这么写的:

 

At folder target you will find last build of Hector :)

About needed runtime jars you find in Rapitano doc.

 但是我还是不会用,留做以后慢慢研究吧


原创粉丝点击