Mercurial > hg > Members > tatsuki > bbs
comparison src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/local/HectorSample.java @ 4:5acde010c6db
add jungle browsing system
author | tatsuki |
---|---|
date | Tue, 28 Jun 2016 19:45:55 +0900 |
parents | 64a72a7a0491 |
children |
comparison
equal
deleted
inserted
replaced
3:f3d30646c863 | 4:5acde010c6db |
---|---|
3 import me.prettyprint.cassandra.serializers.StringSerializer; | 3 import me.prettyprint.cassandra.serializers.StringSerializer; |
4 import me.prettyprint.cassandra.serializers.UUIDSerializer; | 4 import me.prettyprint.cassandra.serializers.UUIDSerializer; |
5 import me.prettyprint.cassandra.service.template.SuperCfUpdater; | 5 import me.prettyprint.cassandra.service.template.SuperCfUpdater; |
6 import me.prettyprint.cassandra.service.template.ThriftSuperCfTemplate; | 6 import me.prettyprint.cassandra.service.template.ThriftSuperCfTemplate; |
7 import me.prettyprint.cassandra.utils.TimeUUIDUtils; | 7 import me.prettyprint.cassandra.utils.TimeUUIDUtils; |
8 import me.prettyprint.hector.api.*; | 8 import me.prettyprint.hector.api.Cluster; |
9 import me.prettyprint.hector.api.Keyspace; | |
9 import me.prettyprint.hector.api.beans.*; | 10 import me.prettyprint.hector.api.beans.*; |
10 import me.prettyprint.hector.api.factory.HFactory; | 11 import me.prettyprint.hector.api.factory.HFactory; |
11 import me.prettyprint.hector.api.query.QueryResult; | 12 import me.prettyprint.hector.api.query.QueryResult; |
12 import me.prettyprint.hector.api.query.RangeSuperSlicesQuery; | 13 import me.prettyprint.hector.api.query.RangeSuperSlicesQuery; |
13 import me.prettyprint.hector.api.query.SuperSliceQuery; | 14 import me.prettyprint.hector.api.query.SuperSliceQuery; |
20 public static void main(String _args[]) | 21 public static void main(String _args[]) |
21 { | 22 { |
22 Cluster myCluster = HFactory.getOrCreateCluster("test-cluster","localhost:9160"); | 23 Cluster myCluster = HFactory.getOrCreateCluster("test-cluster","localhost:9160"); |
23 | 24 |
24 Keyspace ksp = HFactory.createKeyspace("cassaBBS",myCluster); | 25 Keyspace ksp = HFactory.createKeyspace("cassaBBS",myCluster); |
26 /* | |
27 ColumnFamilyDefinition newCF = HFactory.createColumnFamilyDefinition("DEMO","ccc",ComparatorType.UUIDTYPE); | |
28 newCF.setColumnType(ColumnType.SUPER); | |
29 myCluster.addColumnFamily(newCF); | |
30 */ | |
25 | 31 |
26 ThriftSuperCfTemplate<String,UUID,String> template = | 32 ThriftSuperCfTemplate<String,UUID,String> template = |
27 new ThriftSuperCfTemplate<String,UUID,String>(ksp,"boards",StringSerializer.get(), | 33 new ThriftSuperCfTemplate<String,UUID,String>(ksp,"boards",StringSerializer.get(), |
28 UUIDSerializer.get(),StringSerializer.get()); | 34 UUIDSerializer.get(),StringSerializer.get()); |
29 UUID time = TimeUUIDUtils.getUniqueTimeUUIDinMillis(); | 35 UUID time = TimeUUIDUtils.getUniqueTimeUUIDinMillis(); |