cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [05/26] cassandra git commit: Thrift removal
Date Tue, 13 Dec 2016 09:27:29 GMT
http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/CustomTNonBlockingServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/CustomTNonBlockingServer.java b/src/java/org/apache/cassandra/thrift/CustomTNonBlockingServer.java
deleted file mode 100644
index 8221a83..0000000
--- a/src/java/org/apache/cassandra/thrift/CustomTNonBlockingServer.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.thrift;
-
-import java.net.InetSocketAddress;
-
-import java.nio.channels.SelectionKey;
-
-import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.thrift.server.TNonblockingServer;
-import org.apache.thrift.server.TServer;
-import org.apache.thrift.transport.TNonblockingServerTransport;
-import org.apache.thrift.transport.TNonblockingSocket;
-import org.apache.thrift.transport.TNonblockingTransport;
-import org.apache.thrift.transport.TTransportException;
-
-public class CustomTNonBlockingServer extends TNonblockingServer
-{
-    public CustomTNonBlockingServer(Args args)
-    {
-        super(args);
-    }
-
-    @Override
-    @SuppressWarnings("resource")
-    protected boolean requestInvoke(FrameBuffer frameBuffer)
-    {
-        TNonblockingSocket socket = (TNonblockingSocket)((CustomFrameBuffer)frameBuffer).getTransport();
-        ThriftSessionManager.instance.setCurrentSocket(socket.getSocketChannel().socket().getRemoteSocketAddress());
-        frameBuffer.invoke();
-        return true;
-    }
-
-    public static class Factory implements TServerFactory
-    {
-        @SuppressWarnings("resource")
-        public TServer buildTServer(Args args)
-        {
-            if (DatabaseDescriptor.getClientEncryptionOptions().enabled)
-                throw new RuntimeException("Client SSL is not supported for non-blocking sockets. Please remove client ssl from the configuration.");
-
-            final InetSocketAddress addr = args.addr;
-            TNonblockingServerTransport serverTransport;
-            try
-            {
-                serverTransport = new TCustomNonblockingServerSocket(addr, args.keepAlive, args.sendBufferSize, args.recvBufferSize);
-            }
-            catch (TTransportException e)
-            {
-                throw new RuntimeException(String.format("Unable to create thrift socket to %s:%s", addr.getAddress(), addr.getPort()), e);
-            }
-
-            // This is single threaded hence the invocation will be all
-            // in one thread.
-            TNonblockingServer.Args serverArgs = new TNonblockingServer.Args(serverTransport).inputTransportFactory(args.inTransportFactory)
-                                                                                             .outputTransportFactory(args.outTransportFactory)
-                                                                                             .inputProtocolFactory(args.tProtocolFactory)
-                                                                                             .outputProtocolFactory(args.tProtocolFactory)
-                                                                                             .processor(args.processor);
-            return new CustomTNonBlockingServer(serverArgs);
-        }
-    }
-
-    public class CustomFrameBuffer extends FrameBuffer
-    {
-        public CustomFrameBuffer(final TNonblockingTransport trans,
-          final SelectionKey selectionKey,
-          final AbstractSelectThread selectThread)
-        {
-			super(trans, selectionKey, selectThread);
-        }
-
-        public TNonblockingTransport getTransport()
-        {
-            return this.trans_;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/CustomTThreadPoolServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/CustomTThreadPoolServer.java b/src/java/org/apache/cassandra/thrift/CustomTThreadPoolServer.java
deleted file mode 100644
index d1cdaed..0000000
--- a/src/java/org/apache/cassandra/thrift/CustomTThreadPoolServer.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.thrift;
-
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.net.SocketTimeoutException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.SynchronousQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.net.ssl.SSLServerSocket;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.cassandra.concurrent.NamedThreadFactory;
-import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.config.EncryptionOptions.ClientEncryptionOptions;
-import org.apache.cassandra.utils.JVMStabilityInspector;
-import org.apache.cassandra.security.SSLFactory;
-import org.apache.thrift.TException;
-import org.apache.thrift.TProcessor;
-import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.server.TServer;
-import org.apache.thrift.server.TThreadPoolServer;
-import org.apache.thrift.transport.TSSLTransportFactory;
-import org.apache.thrift.transport.TServerSocket;
-import org.apache.thrift.transport.TServerTransport;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-import org.apache.thrift.transport.TSSLTransportFactory.TSSLTransportParameters;
-
-import com.google.common.util.concurrent.Uninterruptibles;
-
-
-/**
- * Slightly modified version of the Apache Thrift TThreadPoolServer.
- * <p>
- * This allows passing an executor so you have more control over the actual
- * behavior of the tasks being run.
- * </p>
- * Newer version of Thrift should make this obsolete.
- */
-public class CustomTThreadPoolServer extends TServer
-{
-
-    private static final Logger logger = LoggerFactory.getLogger(CustomTThreadPoolServer.class.getName());
-
-    // Executor service for handling client connections
-    private final ExecutorService executorService;
-
-    // Flag for stopping the server
-    private volatile boolean stopped;
-
-    // Server options
-    private final TThreadPoolServer.Args args;
-
-    //Track and Limit the number of connected clients
-    private final AtomicInteger activeClients = new AtomicInteger(0);
-
-
-    public CustomTThreadPoolServer(TThreadPoolServer.Args args, ExecutorService executorService)
-    {
-        super(args);
-        this.executorService = executorService;
-        this.args = args;
-    }
-
-    @SuppressWarnings("resource")
-    public void serve()
-    {
-        try
-        {
-            serverTransport_.listen();
-        }
-        catch (TTransportException ttx)
-        {
-            logger.error("Error occurred during listening.", ttx);
-            return;
-        }
-
-        stopped = false;
-        while (!stopped)
-        {
-            // block until we are under max clients
-            while (activeClients.get() >= args.maxWorkerThreads)
-            {
-                Uninterruptibles.sleepUninterruptibly(10, TimeUnit.MILLISECONDS);
-            }
-
-            try
-            {
-                TTransport client = serverTransport_.accept();
-                activeClients.incrementAndGet();
-                WorkerProcess wp = new WorkerProcess(client);
-                executorService.execute(wp);
-            }
-            catch (TTransportException ttx)
-            {
-                if (ttx.getCause() instanceof SocketTimeoutException) // thrift sucks
-                    continue;
-
-                if (!stopped)
-                {
-                    logger.warn("Transport error occurred during acceptance of message.", ttx);
-                }
-            }
-            catch (RejectedExecutionException e)
-            {
-                // worker thread decremented activeClients but hadn't finished exiting
-                logger.trace("Dropping client connection because our limit of {} has been reached", args.maxWorkerThreads);
-                continue;
-            }
-
-            if (activeClients.get() >= args.maxWorkerThreads)
-                logger.warn("Maximum number of clients {} reached", args.maxWorkerThreads);
-        }
-
-        executorService.shutdown();
-        // Thrift's default shutdown waits for the WorkerProcess threads to complete.  We do not,
-        // because doing that allows a client to hold our shutdown "hostage" by simply not sending
-        // another message after stop is called (since process will block indefinitely trying to read
-        // the next meessage header).
-        //
-        // The "right" fix would be to update thrift to set a socket timeout on client connections
-        // (and tolerate unintentional timeouts until stopped is set).  But this requires deep
-        // changes to the code generator, so simply setting these threads to daemon (in our custom
-        // CleaningThreadPool) and ignoring them after shutdown is good enough.
-        //
-        // Remember, our goal on shutdown is not necessarily that each client request we receive
-        // gets answered first [to do that, you should redirect clients to a different coordinator
-        // first], but rather (1) to make sure that for each update we ack as successful, we generate
-        // hints for any non-responsive replicas, and (2) to make sure that we quickly stop
-        // accepting client connections so shutdown can continue.  Not waiting for the WorkerProcess
-        // threads here accomplishes (2); MessagingService's shutdown method takes care of (1).
-        //
-        // See CASSANDRA-3335 and CASSANDRA-3727.
-    }
-
-    public void stop()
-    {
-        stopped = true;
-        serverTransport_.interrupt();
-    }
-
-    private class WorkerProcess implements Runnable
-    {
-
-        /**
-         * Client that this services.
-         */
-        private TTransport client_;
-
-        /**
-         * Default constructor.
-         *
-         * @param client Transport to process
-         */
-        private WorkerProcess(TTransport client)
-        {
-            client_ = client;
-        }
-
-        /**
-         * Loops on processing a client forever
-         */
-        public void run()
-        {
-            TProcessor processor = null;
-            TProtocol inputProtocol = null;
-            TProtocol outputProtocol = null;
-            SocketAddress socket = null;
-            try (TTransport inputTransport = inputTransportFactory_.getTransport(client_);
-                 TTransport outputTransport = outputTransportFactory_.getTransport(client_))
-            {
-                socket = ((TCustomSocket) client_).getSocket().getRemoteSocketAddress();
-                ThriftSessionManager.instance.setCurrentSocket(socket);
-                processor = processorFactory_.getProcessor(client_);
-
-                inputProtocol = inputProtocolFactory_.getProtocol(inputTransport);
-                outputProtocol = outputProtocolFactory_.getProtocol(outputTransport);
-                // we check stopped first to make sure we're not supposed to be shutting
-                // down. this is necessary for graceful shutdown.  (but not sufficient,
-                // since process() can take arbitrarily long waiting for client input.
-                // See comments at the end of serve().)
-                while (!stopped && processor.process(inputProtocol, outputProtocol))
-                {
-                    inputProtocol = inputProtocolFactory_.getProtocol(inputTransport);
-                    outputProtocol = outputProtocolFactory_.getProtocol(outputTransport);
-                }
-            }
-            catch (TTransportException ttx)
-            {
-                // Assume the client died and continue silently
-                // Log at debug to allow debugging of "frame too large" errors (see CASSANDRA-3142).
-                logger.trace("Thrift transport error occurred during processing of message.", ttx);
-            }
-            catch (TException tx)
-            {
-                logger.error("Thrift error occurred during processing of message.", tx);
-            }
-            catch (Exception e)
-            {
-                JVMStabilityInspector.inspectThrowable(e);
-                logger.error("Error occurred during processing of message.", e);
-            }
-            finally
-            {
-                if (socket != null)
-                    ThriftSessionManager.instance.connectionComplete(socket);
-
-                activeClients.decrementAndGet();
-            }
-        }
-    }
-
-    public static class Factory implements TServerFactory
-    {
-        @SuppressWarnings("resource")
-        public TServer buildTServer(Args args)
-        {
-            final InetSocketAddress addr = args.addr;
-            TServerTransport serverTransport;
-            try
-            {
-                final ClientEncryptionOptions clientEnc = DatabaseDescriptor.getClientEncryptionOptions();
-                if (clientEnc.enabled)
-                {
-                    logger.info("enabling encrypted thrift connections between client and server");
-                    TSSLTransportParameters params = new TSSLTransportParameters(clientEnc.protocol, new String[0]);
-                    params.setKeyStore(clientEnc.keystore, clientEnc.keystore_password);
-                    if (clientEnc.require_client_auth)
-                    {
-                        params.setTrustStore(clientEnc.truststore, clientEnc.truststore_password);
-                        params.requireClientAuth(true);
-                    }
-                    TServerSocket sslServer = TSSLTransportFactory.getServerSocket(addr.getPort(), 0, addr.getAddress(), params);
-                    SSLServerSocket sslServerSocket = (SSLServerSocket) sslServer.getServerSocket();
-                    String[] suites = SSLFactory.filterCipherSuites(sslServerSocket.getSupportedCipherSuites(), clientEnc.cipher_suites);
-                    sslServerSocket.setEnabledCipherSuites(suites);
-                    serverTransport = new TCustomServerSocket(sslServerSocket, args.keepAlive, args.sendBufferSize, args.recvBufferSize);
-                }
-                else
-                {
-                    serverTransport = new TCustomServerSocket(addr, args.keepAlive, args.sendBufferSize, args.recvBufferSize, args.listenBacklog);
-                }
-            }
-            catch (TTransportException e)
-            {
-                throw new RuntimeException(String.format("Unable to create thrift socket to %s:%s", addr.getAddress(), addr.getPort()), e);
-            }
-            // ThreadPool Server and will be invocation per connection basis...
-            TThreadPoolServer.Args serverArgs = new TThreadPoolServer.Args(serverTransport)
-                                                                     .minWorkerThreads(DatabaseDescriptor.getRpcMinThreads())
-                                                                     .maxWorkerThreads(DatabaseDescriptor.getRpcMaxThreads())
-                                                                     .inputTransportFactory(args.inTransportFactory)
-                                                                     .outputTransportFactory(args.outTransportFactory)
-                                                                     .inputProtocolFactory(args.tProtocolFactory)
-                                                                     .outputProtocolFactory(args.tProtocolFactory)
-                                                                     .processor(args.processor);
-            ExecutorService executorService = new ThreadPoolExecutor(serverArgs.minWorkerThreads,
-                                                                     serverArgs.maxWorkerThreads,
-                                                                     60,
-                                                                     TimeUnit.SECONDS,
-                                                                     new SynchronousQueue<Runnable>(),
-                                                                     new NamedThreadFactory("Thrift"));
-            return new CustomTThreadPoolServer(serverArgs, executorService);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/ITransportFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/ITransportFactory.java b/src/java/org/apache/cassandra/thrift/ITransportFactory.java
deleted file mode 100644
index 7a65728..0000000
--- a/src/java/org/apache/cassandra/thrift/ITransportFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.cassandra.thrift;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.thrift.transport.TTransport;
-
-/**
- * Transport factory for establishing thrift connections from clients to a remote server.
- */
-public interface ITransportFactory
-{
-    static final String PROPERTY_KEY = "cassandra.client.transport.factory";
-
-    /**
-     * Opens a client transport to a thrift server.
-     * Example:
-     *
-     * <pre>
-     * TTransport transport = clientTransportFactory.openTransport(address, port);
-     * Cassandra.Iface client = new Cassandra.Client(new BinaryProtocol(transport));
-     * </pre>
-     *
-     * @param host fully qualified hostname of the server
-     * @param port RPC port of the server
-     * @return open and ready to use transport
-     * @throws Exception implementation defined; usually throws TTransportException or IOException
-     *         if the connection cannot be established
-     */
-    TTransport openTransport(String host, int port) throws Exception;
-
-    /**
-     * Sets an implementation defined set of options.
-     * Keys in this map must conform to the set set returned by ITransportFactory#supportedOptions.
-     * @param options option map
-     */
-    void setOptions(Map<String, String> options);
-
-    /**
-     * @return set of options supported by this transport factory implementation
-     */
-    Set<String> supportedOptions();
-}
-

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/SSLTransportFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/SSLTransportFactory.java b/src/java/org/apache/cassandra/thrift/SSLTransportFactory.java
deleted file mode 100644
index ea74b94..0000000
--- a/src/java/org/apache/cassandra/thrift/SSLTransportFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.thrift;
-
-import com.google.common.collect.Sets;
-import org.apache.thrift.transport.TFramedTransport;
-import org.apache.thrift.transport.TSSLTransportFactory;
-import org.apache.thrift.transport.TTransport;
-
-import java.util.Map;
-import java.util.Set;
-
-public class SSLTransportFactory implements ITransportFactory
-{
-    public static final int DEFAULT_MAX_FRAME_SIZE = 15 * 1024 * 1024; // 15 MiB
-
-    public static final String TRUSTSTORE = "enc.truststore";
-    public static final String TRUSTSTORE_PASSWORD = "enc.truststore.password";
-    public static final String KEYSTORE = "enc.keystore";
-    public static final String KEYSTORE_PASSWORD = "enc.keystore.password";
-    public static final String PROTOCOL = "enc.protocol";
-    public static final String CIPHER_SUITES = "enc.cipher.suites";
-    public static final int SOCKET_TIMEOUT = 0;
-
-    private static final Set<String> SUPPORTED_OPTIONS = Sets.newHashSet(TRUSTSTORE,
-                                                                         TRUSTSTORE_PASSWORD,
-                                                                         KEYSTORE,
-                                                                         KEYSTORE_PASSWORD,
-                                                                         PROTOCOL,
-                                                                         CIPHER_SUITES);
-
-    private String truststore;
-    private String truststorePassword;
-    private String keystore;
-    private String keystorePassword;
-    private String protocol;
-    private String[] cipherSuites;
-
-    @Override
-    @SuppressWarnings("resource")
-    public TTransport openTransport(String host, int port) throws Exception
-    {
-        TSSLTransportFactory.TSSLTransportParameters params = new TSSLTransportFactory.TSSLTransportParameters(protocol, cipherSuites);
-        params.setTrustStore(truststore, truststorePassword);
-        if (null != keystore)
-            params.setKeyStore(keystore, keystorePassword);
-        TTransport trans = TSSLTransportFactory.getClientSocket(host, port, SOCKET_TIMEOUT, params);
-        return new TFramedTransport(trans, DEFAULT_MAX_FRAME_SIZE);
-    }
-
-    @Override
-    public void setOptions(Map<String, String> options)
-    {
-        if (options.containsKey(TRUSTSTORE))
-            truststore = options.get(TRUSTSTORE);
-        if (options.containsKey(TRUSTSTORE_PASSWORD))
-            truststorePassword = options.get(TRUSTSTORE_PASSWORD);
-        if (options.containsKey(KEYSTORE))
-            keystore = options.get(KEYSTORE);
-        if (options.containsKey(KEYSTORE_PASSWORD))
-            keystorePassword = options.get(KEYSTORE_PASSWORD);
-        if (options.containsKey(PROTOCOL))
-            protocol = options.get(PROTOCOL);
-        if (options.containsKey(CIPHER_SUITES))
-            cipherSuites = options.get(CIPHER_SUITES).split(",");
-    }
-
-    @Override
-    public Set<String> supportedOptions()
-    {
-        return SUPPORTED_OPTIONS;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/TCustomNonblockingServerSocket.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/TCustomNonblockingServerSocket.java b/src/java/org/apache/cassandra/thrift/TCustomNonblockingServerSocket.java
deleted file mode 100644
index a430721..0000000
--- a/src/java/org/apache/cassandra/thrift/TCustomNonblockingServerSocket.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.thrift;
-
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.SocketException;
-
-import org.apache.thrift.transport.TNonblockingServerSocket;
-import org.apache.thrift.transport.TNonblockingSocket;
-import org.apache.thrift.transport.TTransportException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class TCustomNonblockingServerSocket extends TNonblockingServerSocket
-{
-    private static final Logger logger = LoggerFactory.getLogger(TCustomNonblockingServerSocket.class);
-    private final boolean keepAlive;
-    private final Integer sendBufferSize;
-    private final Integer recvBufferSize;
-
-    public TCustomNonblockingServerSocket(InetSocketAddress bindAddr, boolean keepAlive, Integer sendBufferSize, Integer recvBufferSize) throws TTransportException
-    {
-        super(bindAddr);
-        this.keepAlive = keepAlive;
-        this.sendBufferSize = sendBufferSize;
-        this.recvBufferSize = recvBufferSize;
-    }
-
-    @Override
-    @SuppressWarnings("resource")
-    protected TNonblockingSocket acceptImpl() throws TTransportException
-    {
-        TNonblockingSocket tsocket = super.acceptImpl();
-        if (tsocket == null || tsocket.getSocketChannel() == null)
-            return tsocket;
-        Socket socket = tsocket.getSocketChannel().socket();
-        try
-        {
-            socket.setKeepAlive(this.keepAlive);
-        }
-        catch (SocketException se)
-        {
-            logger.warn("Failed to set keep-alive on Thrift socket.", se);
-        }
-
-        if (this.sendBufferSize != null)
-        {
-            try
-            {
-                socket.setSendBufferSize(this.sendBufferSize.intValue());
-            }
-            catch (SocketException se)
-            {
-                logger.warn("Failed to set send buffer size on Thrift socket.", se);
-            }
-        }
-
-        if (this.recvBufferSize != null)
-        {
-            try
-            {
-                socket.setReceiveBufferSize(this.recvBufferSize.intValue());
-            }
-            catch (SocketException se)
-            {
-                logger.warn("Failed to set receive buffer size on Thrift socket.", se);
-            }
-        }
-        return tsocket;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/TCustomServerSocket.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/TCustomServerSocket.java b/src/java/org/apache/cassandra/thrift/TCustomServerSocket.java
deleted file mode 100644
index 8e27481..0000000
--- a/src/java/org/apache/cassandra/thrift/TCustomServerSocket.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.thrift;
-
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.SocketException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.thrift.transport.TServerTransport;
-import org.apache.thrift.transport.TTransportException;
-
-/**
- * Extends Thrift's TServerSocket to allow customization of various desirable TCP properties.
- */
-public class TCustomServerSocket extends TServerTransport
-{
-
-    private static final Logger logger = LoggerFactory.getLogger(TCustomServerSocket.class);
-
-    /**
-     * Underlying serversocket object
-     */
-    private ServerSocket serverSocket = null;
-
-    private final boolean keepAlive;
-    private final Integer sendBufferSize;
-    private final Integer recvBufferSize;
-
-    /**
-     * Allows fine-tuning of the server socket including keep-alive, reuse of addresses, send and receive buffer sizes.
-     *
-     * @param bindAddr
-     * @param keepAlive
-     * @param sendBufferSize
-     * @param recvBufferSize
-     * @throws TTransportException
-     */
-    public TCustomServerSocket(InetSocketAddress bindAddr, boolean keepAlive, Integer sendBufferSize,
-            Integer recvBufferSize, Integer listenBacklog)
-            throws TTransportException
-    {
-        try
-        {
-            // Make server socket
-            serverSocket = new ServerSocket();
-            // Prevent 2MSL delay problem on server restarts
-            serverSocket.setReuseAddress(true);
-            // Bind to listening port
-            serverSocket.bind(bindAddr, listenBacklog);
-        }
-        catch (IOException ioe)
-        {
-            serverSocket = null;
-            throw new TTransportException("Could not create ServerSocket on address " + bindAddr + ".");
-        }
-
-        this.keepAlive = keepAlive;
-        this.sendBufferSize = sendBufferSize;
-        this.recvBufferSize = recvBufferSize;
-    }
-
-    public TCustomServerSocket(ServerSocket socket, boolean keepAlive, Integer sendBufferSize, Integer recvBufferSize)
-    {
-        this.serverSocket = socket;
-        this.keepAlive = keepAlive;
-        this.sendBufferSize = sendBufferSize;
-        this.recvBufferSize = recvBufferSize;
-    }
-
-    @Override
-    @SuppressWarnings("resource")
-    protected TCustomSocket acceptImpl() throws TTransportException
-    {
-
-        if (serverSocket == null)
-            throw new TTransportException(TTransportException.NOT_OPEN, "No underlying server socket.");
-
-        TCustomSocket tsocket = null;
-        Socket socket = null;
-        try
-        {
-            socket = serverSocket.accept();
-            tsocket = new TCustomSocket(socket);
-            tsocket.setTimeout(0);
-        }
-        catch (IOException iox)
-        {
-            throw new TTransportException(iox);
-        }
-
-        try
-        {
-            socket.setKeepAlive(this.keepAlive);
-        }
-        catch (SocketException se)
-        {
-            logger.warn("Failed to set keep-alive on Thrift socket.", se);
-        }
-
-        if (this.sendBufferSize != null)
-        {
-            try
-            {
-                socket.setSendBufferSize(this.sendBufferSize.intValue());
-            }
-            catch (SocketException se)
-            {
-                logger.warn("Failed to set send buffer size on Thrift socket.", se);
-            }
-        }
-
-        if (this.recvBufferSize != null)
-        {
-            try
-            {
-                socket.setReceiveBufferSize(this.recvBufferSize.intValue());
-            }
-            catch (SocketException se)
-            {
-                logger.warn("Failed to set receive buffer size on Thrift socket.", se);
-            }
-        }
-
-        return tsocket;
-    }
-
-    @Override
-    public void listen() throws TTransportException
-    {
-        // Make sure not to block on accept
-        if (serverSocket != null)
-        {
-            try
-            {
-                serverSocket.setSoTimeout(100);
-            }
-            catch (SocketException sx)
-            {
-                logger.error("Could not set socket timeout.", sx);
-            }
-        }
-    }
-
-    @Override
-    public void close()
-    {
-        if (serverSocket != null)
-        {
-            try
-            {
-                serverSocket.close();
-            }
-            catch (IOException iox)
-            {
-                logger.warn("Could not close server socket.", iox);
-            }
-            serverSocket = null;
-        }
-    }
-
-    @Override
-    public void interrupt()
-    {
-        // The thread-safeness of this is dubious, but Java documentation suggests
-        // that it is safe to do this from a different thread context
-        close();
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/TCustomSocket.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/TCustomSocket.java b/src/java/org/apache/cassandra/thrift/TCustomSocket.java
deleted file mode 100644
index 08a9770..0000000
--- a/src/java/org/apache/cassandra/thrift/TCustomSocket.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.thrift;
-
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.SocketException;
-
-import org.apache.thrift.transport.TIOStreamTransport;
-import org.apache.thrift.transport.TTransportException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Socket implementation of the TTransport interface.
- *
- * Adds socket buffering
- *
- */
-public class TCustomSocket extends TIOStreamTransport
-{
-
-  private static final Logger LOGGER = LoggerFactory.getLogger(TCustomSocket.class.getName());
-
-  /**
-   * Wrapped Socket object
-   */
-  private Socket socket = null;
-
-  /**
-   * Remote host
-   */
-  private String host  = null;
-
-  /**
-   * Remote port
-   */
-  private int port = 0;
-
-  /**
-   * Socket timeout
-   */
-  private int timeout = 0;
-
-  /**
-   * Constructor that takes an already created socket.
-   *
-   * @param socket Already created socket object
-   * @throws TTransportException if there is an error setting up the streams
-   */
-  public TCustomSocket(Socket socket) throws TTransportException
-  {
-    this.socket = socket;
-    try
-    {
-      socket.setSoLinger(false, 0);
-      socket.setTcpNoDelay(true);
-    }
-    catch (SocketException sx)
-    {
-      LOGGER.warn("Could not configure socket.", sx);
-    }
-
-    if (isOpen())
-    {
-      try
-      {
-        inputStream_ = new BufferedInputStream(socket.getInputStream(), 1024);
-        outputStream_ = new BufferedOutputStream(socket.getOutputStream(), 1024);
-      }
-      catch (IOException iox)
-      {
-        close();
-        throw new TTransportException(TTransportException.NOT_OPEN, iox);
-      }
-    }
-  }
-
-  /**
-   * Creates a new unconnected socket that will connect to the given host
-   * on the given port.
-   *
-   * @param host Remote host
-   * @param port Remote port
-   */
-  public TCustomSocket(String host, int port)
-  {
-    this(host, port, 0);
-  }
-
-  /**
-   * Creates a new unconnected socket that will connect to the given host
-   * on the given port.
-   *
-   * @param host    Remote host
-   * @param port    Remote port
-   * @param timeout Socket timeout
-   */
-  public TCustomSocket(String host, int port, int timeout)
-  {
-    this.host = host;
-    this.port = port;
-    this.timeout = timeout;
-    initSocket();
-  }
-
-  /**
-   * Initializes the socket object
-   */
-  private void initSocket()
-  {
-    socket = new Socket();
-    try
-    {
-      socket.setSoLinger(false, 0);
-      socket.setTcpNoDelay(true);
-      socket.setSoTimeout(timeout);
-    }
-    catch (SocketException sx)
-    {
-      LOGGER.error("Could not configure socket.", sx);
-    }
-  }
-
-  /**
-   * Sets the socket timeout
-   *
-   * @param timeout Milliseconds timeout
-   */
-  public void setTimeout(int timeout)
-  {
-    this.timeout = timeout;
-    try
-    {
-      socket.setSoTimeout(timeout);
-    }
-    catch (SocketException sx)
-    {
-      LOGGER.warn("Could not set socket timeout.", sx);
-    }
-  }
-
-  /**
-   * Returns a reference to the underlying socket.
-   */
-  public Socket getSocket()
-  {
-    if (socket == null)
-    {
-      initSocket();
-    }
-    return socket;
-  }
-
-  /**
-   * Checks whether the socket is connected.
-   */
-  public boolean isOpen()
-  {
-    if (socket == null)
-    {
-      return false;
-    }
-    return socket.isConnected();
-  }
-
-  /**
-   * Connects the socket, creating a new socket object if necessary.
-   */
-  public void open() throws TTransportException
-  {
-    if (isOpen())
-    {
-      throw new TTransportException(TTransportException.ALREADY_OPEN, "Socket already connected.");
-    }
-
-    if (host.length() == 0)
-    {
-      throw new TTransportException(TTransportException.NOT_OPEN, "Cannot open null host.");
-    }
-    if (port <= 0)
-    {
-      throw new TTransportException(TTransportException.NOT_OPEN, "Cannot open without port.");
-    }
-
-    if (socket == null)
-    {
-      initSocket();
-    }
-
-    try
-    {
-      socket.connect(new InetSocketAddress(host, port), timeout);
-      inputStream_ = new BufferedInputStream(socket.getInputStream(), 1024);
-      outputStream_ = new BufferedOutputStream(socket.getOutputStream(), 1024);
-    }
-    catch (IOException iox)
-    {
-      close();
-      throw new TTransportException(TTransportException.NOT_OPEN, iox);
-    }
-  }
-
-  /**
-   * Closes the socket.
-   */
-  public void close()
-  {
-    // Close the underlying streams
-    super.close();
-
-    // Close the socket
-    if (socket != null)
-    {
-      try
-      {
-        socket.close();
-      }
-      catch (IOException iox)
-      {
-        LOGGER.warn("Could not close socket.", iox);
-      }
-      socket = null;
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/TFramedTransportFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/TFramedTransportFactory.java b/src/java/org/apache/cassandra/thrift/TFramedTransportFactory.java
deleted file mode 100644
index 7bf0b96..0000000
--- a/src/java/org/apache/cassandra/thrift/TFramedTransportFactory.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.cassandra.thrift;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.thrift.transport.TFramedTransport;
-import org.apache.thrift.transport.TSocket;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-
-public class TFramedTransportFactory implements ITransportFactory
-{
-    private static final String THRIFT_FRAMED_TRANSPORT_SIZE_IN_MB = "cassandra.thrift.framed.size_mb";
-    private int thriftFramedTransportSizeMb = 15; // 15Mb is the default for C* & Hadoop ConfigHelper
-
-    @SuppressWarnings("resource")
-    public TTransport openTransport(String host, int port) throws TTransportException
-    {
-        TSocket socket = new TSocket(host, port);
-        TTransport transport = new TFramedTransport(socket, thriftFramedTransportSizeMb * 1024 * 1024);
-        transport.open();
-        return transport;
-    }
-
-    public void setOptions(Map<String, String> options)
-    {
-        if (options.containsKey(THRIFT_FRAMED_TRANSPORT_SIZE_IN_MB))
-            thriftFramedTransportSizeMb = Integer.parseInt(options.get(THRIFT_FRAMED_TRANSPORT_SIZE_IN_MB));
-    }
-
-    public Set<String> supportedOptions()
-    {
-        return Collections.singleton(THRIFT_FRAMED_TRANSPORT_SIZE_IN_MB);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/THsHaDisruptorServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/THsHaDisruptorServer.java b/src/java/org/apache/cassandra/thrift/THsHaDisruptorServer.java
deleted file mode 100644
index 37bc440..0000000
--- a/src/java/org/apache/cassandra/thrift/THsHaDisruptorServer.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cassandra.thrift;
-
-import java.net.InetSocketAddress;
-import java.util.concurrent.SynchronousQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-import com.thinkaurelius.thrift.Message;
-import com.thinkaurelius.thrift.TDisruptorServer;
-import org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutor;
-import org.apache.cassandra.concurrent.NamedThreadFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.thrift.server.TServer;
-import org.apache.thrift.transport.TNonblockingServerTransport;
-import org.apache.thrift.transport.TNonblockingSocket;
-import org.apache.thrift.transport.TTransportException;
-
-public class THsHaDisruptorServer extends TDisruptorServer
-{
-    private static final Logger logger = LoggerFactory.getLogger(THsHaDisruptorServer.class.getName());
-
-    /**
-     * All the arguments to Non Blocking Server will apply here. In addition,
-     * executor pool will be responsible for creating the internal threads which
-     * will process the data. threads for selection usually are equal to the
-     * number of cpu's
-     */
-    public THsHaDisruptorServer(Args args)
-    {
-        super(args);
-        logger.info("Starting up {}", this);
-    }
-
-    @Override
-    protected void beforeInvoke(Message buffer)
-    {
-        TNonblockingSocket socket = (TNonblockingSocket) buffer.transport;
-        ThriftSessionManager.instance.setCurrentSocket(socket.getSocketChannel().socket().getRemoteSocketAddress());
-    }
-
-    public void beforeClose(Message buffer)
-    {
-        TNonblockingSocket socket = (TNonblockingSocket) buffer.transport;
-        ThriftSessionManager.instance.connectionComplete(socket.getSocketChannel().socket().getRemoteSocketAddress());
-    }
-
-    public static class Factory implements TServerFactory
-    {
-        @SuppressWarnings("resource")
-        public TServer buildTServer(Args args)
-        {
-            if (DatabaseDescriptor.getClientEncryptionOptions().enabled)
-                throw new RuntimeException("Client SSL is not supported for non-blocking sockets (hsha). Please remove client ssl from the configuration.");
-
-            final InetSocketAddress addr = args.addr;
-            TNonblockingServerTransport serverTransport;
-            try
-            {
-                serverTransport = new TCustomNonblockingServerSocket(addr, args.keepAlive, args.sendBufferSize, args.recvBufferSize);
-            }
-            catch (TTransportException e)
-            {
-                throw new RuntimeException(String.format("Unable to create thrift socket to %s:%s", addr.getAddress(), addr.getPort()), e);
-            }
-
-            ThreadPoolExecutor invoker = new JMXEnabledThreadPoolExecutor(DatabaseDescriptor.getRpcMinThreads(),
-                                                                          DatabaseDescriptor.getRpcMaxThreads(),
-                                                                          60L,
-                                                                          TimeUnit.SECONDS,
-                                                                          new SynchronousQueue<Runnable>(),
-                                                                          new NamedThreadFactory("RPC-Thread"), "RPC-THREAD-POOL");
-
-            com.thinkaurelius.thrift.util.TBinaryProtocol.Factory protocolFactory = new com.thinkaurelius.thrift.util.TBinaryProtocol.Factory(true, true);
-
-            TDisruptorServer.Args serverArgs = new TDisruptorServer.Args(serverTransport).useHeapBasedAllocation(true)
-                                                                                         .inputTransportFactory(args.inTransportFactory)
-                                                                                         .outputTransportFactory(args.outTransportFactory)
-                                                                                         .inputProtocolFactory(protocolFactory)
-                                                                                         .outputProtocolFactory(protocolFactory)
-                                                                                         .processor(args.processor)
-                                                                                         .maxFrameSizeInBytes(DatabaseDescriptor.getThriftFramedTransportSize())
-                                                                                         .invocationExecutor(invoker)
-                                                                                         .alwaysReallocateBuffers(true);
-
-            return new THsHaDisruptorServer(serverArgs);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/TServerCustomFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/TServerCustomFactory.java b/src/java/org/apache/cassandra/thrift/TServerCustomFactory.java
deleted file mode 100644
index 5a272dd..0000000
--- a/src/java/org/apache/cassandra/thrift/TServerCustomFactory.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cassandra.thrift;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.thrift.server.TServer;
-
-/**
- * Helper implementation to create a thrift TServer based on one of the common types we support (sync, hsha),
- * or a custom type by setting the fully qualified java class name in the rpc_server_type setting.
- */
-public class TServerCustomFactory implements TServerFactory
-{
-    private static Logger logger = LoggerFactory.getLogger(TServerCustomFactory.class);
-    private final String serverType;
-
-    public TServerCustomFactory(String serverType)
-    {
-        assert serverType != null;
-        this.serverType = serverType;
-    }
-
-    public TServer buildTServer(TServerFactory.Args args)
-    {
-        TServer server;
-        if (ThriftServer.ThriftServerType.SYNC.equalsIgnoreCase(serverType))
-        {
-            server = new CustomTThreadPoolServer.Factory().buildTServer(args);
-        }
-        else if(ThriftServer.ThriftServerType.ASYNC.equalsIgnoreCase(serverType))
-        {
-            server = new CustomTNonBlockingServer.Factory().buildTServer(args);
-            logger.info("Using non-blocking/asynchronous thrift server on {} : {}", args.addr.getHostName(), args.addr.getPort());
-        }
-        else if(ThriftServer.ThriftServerType.HSHA.equalsIgnoreCase(serverType))
-        {
-            server = new THsHaDisruptorServer.Factory().buildTServer(args);
-            logger.info("Using custom half-sync/half-async thrift server on {} : {}", args.addr.getHostName(), args.addr.getPort());
-        }
-        else
-        {
-            TServerFactory serverFactory;
-            try
-            {
-                serverFactory = (TServerFactory) Class.forName(serverType).newInstance();
-            }
-            catch (Exception e)
-            {
-                throw new RuntimeException("Failed to instantiate server factory:" + serverType, e);
-            }
-            server = serverFactory.buildTServer(args);
-            logger.info("Using custom thrift server {} on {} : {}", server.getClass().getName(), args.addr.getHostName(), args.addr.getPort());
-        }
-        return server;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/TServerFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/TServerFactory.java b/src/java/org/apache/cassandra/thrift/TServerFactory.java
deleted file mode 100644
index 09014ce..0000000
--- a/src/java/org/apache/cassandra/thrift/TServerFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cassandra.thrift;
-
-import java.net.InetSocketAddress;
-
-import org.apache.thrift.TProcessor;
-import org.apache.thrift.protocol.TProtocolFactory;
-import org.apache.thrift.server.TServer;
-import org.apache.thrift.transport.TTransportFactory;
-
-public interface TServerFactory
-{
-    TServer buildTServer(Args args);
-
-    public static class Args
-    {
-        public InetSocketAddress addr;
-        public Integer listenBacklog;
-        public TProcessor processor;
-        public TProtocolFactory tProtocolFactory;
-        public TTransportFactory inTransportFactory;
-        public TTransportFactory outTransportFactory;
-        public Integer sendBufferSize;
-        public Integer recvBufferSize;
-        public boolean keepAlive;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4881d9c3/src/java/org/apache/cassandra/thrift/ThriftClientState.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/ThriftClientState.java b/src/java/org/apache/cassandra/thrift/ThriftClientState.java
deleted file mode 100644
index 6a3c50f..0000000
--- a/src/java/org/apache/cassandra/thrift/ThriftClientState.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.thrift;
-
-import java.net.InetSocketAddress;
-
-import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.service.ClientState;
-import org.apache.cassandra.service.QueryState;
-
-/**
- * ClientState used by thrift that also provide a QueryState.
- *
- * Thrift is intrinsically synchronous so there could be only one query per
- * client at a given time. So ClientState and QueryState can be merge into the
- * same object.
- */
-public class ThriftClientState extends ClientState
-{
-    private final QueryState queryState;
-
-    public ThriftClientState(InetSocketAddress remoteAddress)
-    {
-        super(remoteAddress);
-        this.queryState = new QueryState(this);
-    }
-
-    public QueryState getQueryState()
-    {
-        return queryState;
-    }
-
-    public String getSchedulingValue()
-    {
-        switch(DatabaseDescriptor.getRequestSchedulerId())
-        {
-            case keyspace: return getRawKeyspace();
-        }
-        return "default";
-    }
-}


Mime
View raw message