You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by Apache Wiki <wi...@apache.org> on 2011/01/04 19:03:55 UTC
[Cassandra Wiki] Trivial Update of "ScribeToCassandra" by mck
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for change notification.
The "ScribeToCassandra" page has been changed by mck.
http://wiki.apache.org/cassandra/ScribeToCassandra?action=diff&rev1=1&rev2=2
--------------------------------------------------
Here's a super simple example written in java and using Hector.
It uses a column family according to the LogEntry's category, and puts the payload directly into a column name "scribePayload".
{{{
+ #!java
class ScribeToCassandraService implements com.facebook.scribe.scribe.Iface {
private static final String CLUSTER_NAME = "myCluster";
@@ -15, +16 @@
public ResultCode Log(final List<LogEntry> logEntries) throws TException {
Cluster cluster = HFactory.getOrCreateCluster(CLUSTER_NAME, HOST_PORT);
- Mutator<UUID> mutator = HFactory.createMutator(HFactory.createKeyspace(KEYSPACE, cluster), UUIDSerializer.get());
+ Mutator<UUID> mutator = HFactory.createMutator(
+ HFactory.createKeyspace(KEYSPACE, cluster),
+ UUIDSerializer.get());
+
for (LogEntry logEntry : logEntries) {
try{