From c25dae0a2f5292661dcd90dd5ca68cd6cbaed3ed Mon Sep 17 00:00:00 2001 From: Prashant Malik Date: Tue, 24 Mar 2009 22:09:21 +0000 Subject: [PATCH] new thrift file changes git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@758048 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/cassandra/service/Cassandra.java | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/org/apache/cassandra/service/Cassandra.java b/src/org/apache/cassandra/service/Cassandra.java index 373eec7f57..9c01ca1b61 100644 --- a/src/org/apache/cassandra/service/Cassandra.java +++ b/src/org/apache/cassandra/service/Cassandra.java @@ -18,7 +18,7 @@ import com.facebook.thrift.transport.*; public class Cassandra { - public interface Iface extends com.facebook.fb303.FacebookService.Iface { + public interface Iface { public List get_slice(String tablename, String key, String columnFamily_column, int start, int count) throws CassandraException, TException; @@ -60,7 +60,7 @@ public class Cassandra { } - public static class Client extends com.facebook.fb303.FacebookService.Client implements Iface { + public static class Client implements Iface { public Client(TProtocol prot) { this(prot, prot); @@ -68,7 +68,23 @@ public class Cassandra { public Client(TProtocol iprot, TProtocol oprot) { - super(iprot, oprot); + iprot_ = iprot; + oprot_ = oprot; + } + + protected TProtocol iprot_; + protected TProtocol oprot_; + + protected int seqid_; + + public TProtocol getInputProtocol() + { + return this.iprot_; + } + + public TProtocol getOutputProtocol() + { + return this.oprot_; } public List get_slice(String tablename, String key, String columnFamily_column, int start, int count) throws CassandraException, TException @@ -669,10 +685,9 @@ public class Cassandra { } } - public static class Processor extends com.facebook.fb303.FacebookService.Processor implements TProcessor { + public static class Processor implements TProcessor { public Processor(Iface iface) { - super(iface); iface_ = iface; processMap_.put("get_slice", new get_slice()); processMap_.put("get_slice_by_names", new get_slice_by_names()); @@ -695,7 +710,12 @@ public class Cassandra { processMap_.put("executeQuery", new executeQuery()); } + protected static interface ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException; + } + private Iface iface_; + protected final HashMap processMap_ = new HashMap(); public boolean process(TProtocol iprot, TProtocol oprot) throws TException {