You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2013/06/06 21:24:47 UTC

[1/3] git commit: r/m unused ITransportFactory and rename TClientTransportFactory -> ITransportFactory

Updated Branches:
  refs/heads/cassandra-1.2 56e0ad1be -> b973a3336
  refs/heads/trunk 90052d5a4 -> 0eb048f23


r/m unused ITransportFactory and rename TClientTransportFactory -> ITransportFactory


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b973a333
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b973a333
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b973a333

Branch: refs/heads/cassandra-1.2
Commit: b973a3336949be81dc10ca16dca29e4b2fb237ec
Parents: 56e0ad1
Author: Jonathan Ellis <jb...@apache.org>
Authored: Thu Jun 6 14:24:27 2013 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Thu Jun 6 14:24:27 2013 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/hadoop/ConfigHelper.java  |   10 +-
 .../apache/cassandra/thrift/ITransportFactory.java |   43 ++++++++-
 .../cassandra/thrift/TClientTransportFactory.java  |   70 ---------------
 .../cassandra/thrift/TFramedTransportFactory.java  |   11 +--
 4 files changed, 46 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b973a333/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/ConfigHelper.java b/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
index 3dcfdd7..36228cf 100644
--- a/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
+++ b/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
@@ -566,21 +566,21 @@ public class ConfigHelper
         }
     }
 
-    public static TClientTransportFactory getClientTransportFactory(Configuration conf)
+    public static ITransportFactory getClientTransportFactory(Configuration conf)
     {
         String factoryClassName = conf.get(
-                TClientTransportFactory.PROPERTY_KEY,
+                ITransportFactory.PROPERTY_KEY,
                 TFramedTransportFactory.class.getName());
-        TClientTransportFactory factory = getClientTransportFactory(factoryClassName);
+        ITransportFactory factory = getClientTransportFactory(factoryClassName);
         Map<String, String> options = getOptions(conf, factory.supportedOptions());
         factory.setOptions(options);
         return factory;
     }
 
-    private static TClientTransportFactory getClientTransportFactory(String factoryClassName) {
+    private static ITransportFactory getClientTransportFactory(String factoryClassName) {
         try
         {
-            return (TClientTransportFactory) Class.forName(factoryClassName).newInstance();
+            return (ITransportFactory) Class.forName(factoryClassName).newInstance();
         }
         catch (Exception e)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b973a333/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
index e3e87c2..98b1c03 100644
--- a/src/java/org/apache/cassandra/thrift/ITransportFactory.java
+++ b/src/java/org/apache/cassandra/thrift/ITransportFactory.java
@@ -22,14 +22,49 @@ package org.apache.cassandra.thrift;
  */
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.thrift.transport.TSocket;
 import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
 
-import javax.security.auth.login.LoginException;
+import java.util.Map;
+import java.util.Set;
 
 
+/**
+ * Transport factory for establishing thrift connections from clients to a remote server.
+ */
 public interface ITransportFactory
 {
-    TTransport openTransport(TSocket socket, Configuration conf) throws LoginException, TTransportException;
+    static final String PROPERTY_KEY = "cassandra.client.transport.factory";
+    static final String LONG_OPTION = "transport-factory";
+    static final String SHORT_OPTION = "tr";
+
+    /**
+     * 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
+     * @param conf Hadoop configuration
+     * @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, Configuration conf) throws Exception;
+
+    /**
+     * Sets an implementation defined set of options.
+     * Keys in this map must conform to the set set returned by TClientTransportFactory#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/b973a333/src/java/org/apache/cassandra/thrift/TClientTransportFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/TClientTransportFactory.java b/src/java/org/apache/cassandra/thrift/TClientTransportFactory.java
deleted file mode 100644
index 0a73043..0000000
--- a/src/java/org/apache/cassandra/thrift/TClientTransportFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.apache.cassandra.thrift;
-
-/*
- *
- * 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.
- *
- */
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.thrift.transport.TTransport;
-
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * Transport factory for establishing thrift connections from clients to a remote server.
- */
-public interface TClientTransportFactory
-{
-    static final String PROPERTY_KEY = "cassandra.client.transport.factory";
-    static final String LONG_OPTION = "transport-factory";
-    static final String SHORT_OPTION = "tr";
-
-    /**
-     * 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
-     * @param conf Hadoop configuration
-     * @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, Configuration conf) throws Exception;
-
-    /**
-     * Sets an implementation defined set of options.
-     * Keys in this map must conform to the set set returned by TClientTransportFactory#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/b973a333/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
index 5905f4a..6907900 100644
--- a/src/java/org/apache/cassandra/thrift/TFramedTransportFactory.java
+++ b/src/java/org/apache/cassandra/thrift/TFramedTransportFactory.java
@@ -32,17 +32,10 @@ import org.apache.thrift.transport.TTransport;
 import org.apache.thrift.transport.TTransportException;
 
 import org.apache.hadoop.conf.Configuration;
+import sun.plugin2.message.transport.TransportFactory;
 
-public class TFramedTransportFactory implements ITransportFactory, TClientTransportFactory
+public class TFramedTransportFactory implements ITransportFactory
 {
-    public TTransport openTransport(TSocket socket, Configuration conf) throws TTransportException
-    {
-        TTransport transport = new TFramedTransport(socket, ConfigHelper.getThriftFramedTransportSize(conf));
-        transport.open();
-        return transport;
-    }
-
-    //
     public TTransport openTransport(String host, int port, Configuration conf) throws TTransportException
     {
         TSocket socket = new TSocket(host, port);


[2/3] git commit: r/m unused ITransportFactory and rename TClientTransportFactory -> ITransportFactory

Posted by jb...@apache.org.
r/m unused ITransportFactory and rename TClientTransportFactory -> ITransportFactory


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b973a333
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b973a333
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b973a333

Branch: refs/heads/trunk
Commit: b973a3336949be81dc10ca16dca29e4b2fb237ec
Parents: 56e0ad1
Author: Jonathan Ellis <jb...@apache.org>
Authored: Thu Jun 6 14:24:27 2013 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Thu Jun 6 14:24:27 2013 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/hadoop/ConfigHelper.java  |   10 +-
 .../apache/cassandra/thrift/ITransportFactory.java |   43 ++++++++-
 .../cassandra/thrift/TClientTransportFactory.java  |   70 ---------------
 .../cassandra/thrift/TFramedTransportFactory.java  |   11 +--
 4 files changed, 46 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b973a333/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/ConfigHelper.java b/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
index 3dcfdd7..36228cf 100644
--- a/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
+++ b/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
@@ -566,21 +566,21 @@ public class ConfigHelper
         }
     }
 
-    public static TClientTransportFactory getClientTransportFactory(Configuration conf)
+    public static ITransportFactory getClientTransportFactory(Configuration conf)
     {
         String factoryClassName = conf.get(
-                TClientTransportFactory.PROPERTY_KEY,
+                ITransportFactory.PROPERTY_KEY,
                 TFramedTransportFactory.class.getName());
-        TClientTransportFactory factory = getClientTransportFactory(factoryClassName);
+        ITransportFactory factory = getClientTransportFactory(factoryClassName);
         Map<String, String> options = getOptions(conf, factory.supportedOptions());
         factory.setOptions(options);
         return factory;
     }
 
-    private static TClientTransportFactory getClientTransportFactory(String factoryClassName) {
+    private static ITransportFactory getClientTransportFactory(String factoryClassName) {
         try
         {
-            return (TClientTransportFactory) Class.forName(factoryClassName).newInstance();
+            return (ITransportFactory) Class.forName(factoryClassName).newInstance();
         }
         catch (Exception e)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b973a333/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
index e3e87c2..98b1c03 100644
--- a/src/java/org/apache/cassandra/thrift/ITransportFactory.java
+++ b/src/java/org/apache/cassandra/thrift/ITransportFactory.java
@@ -22,14 +22,49 @@ package org.apache.cassandra.thrift;
  */
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.thrift.transport.TSocket;
 import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
 
-import javax.security.auth.login.LoginException;
+import java.util.Map;
+import java.util.Set;
 
 
+/**
+ * Transport factory for establishing thrift connections from clients to a remote server.
+ */
 public interface ITransportFactory
 {
-    TTransport openTransport(TSocket socket, Configuration conf) throws LoginException, TTransportException;
+    static final String PROPERTY_KEY = "cassandra.client.transport.factory";
+    static final String LONG_OPTION = "transport-factory";
+    static final String SHORT_OPTION = "tr";
+
+    /**
+     * 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
+     * @param conf Hadoop configuration
+     * @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, Configuration conf) throws Exception;
+
+    /**
+     * Sets an implementation defined set of options.
+     * Keys in this map must conform to the set set returned by TClientTransportFactory#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/b973a333/src/java/org/apache/cassandra/thrift/TClientTransportFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/TClientTransportFactory.java b/src/java/org/apache/cassandra/thrift/TClientTransportFactory.java
deleted file mode 100644
index 0a73043..0000000
--- a/src/java/org/apache/cassandra/thrift/TClientTransportFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.apache.cassandra.thrift;
-
-/*
- *
- * 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.
- *
- */
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.thrift.transport.TTransport;
-
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * Transport factory for establishing thrift connections from clients to a remote server.
- */
-public interface TClientTransportFactory
-{
-    static final String PROPERTY_KEY = "cassandra.client.transport.factory";
-    static final String LONG_OPTION = "transport-factory";
-    static final String SHORT_OPTION = "tr";
-
-    /**
-     * 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
-     * @param conf Hadoop configuration
-     * @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, Configuration conf) throws Exception;
-
-    /**
-     * Sets an implementation defined set of options.
-     * Keys in this map must conform to the set set returned by TClientTransportFactory#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/b973a333/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
index 5905f4a..6907900 100644
--- a/src/java/org/apache/cassandra/thrift/TFramedTransportFactory.java
+++ b/src/java/org/apache/cassandra/thrift/TFramedTransportFactory.java
@@ -32,17 +32,10 @@ import org.apache.thrift.transport.TTransport;
 import org.apache.thrift.transport.TTransportException;
 
 import org.apache.hadoop.conf.Configuration;
+import sun.plugin2.message.transport.TransportFactory;
 
-public class TFramedTransportFactory implements ITransportFactory, TClientTransportFactory
+public class TFramedTransportFactory implements ITransportFactory
 {
-    public TTransport openTransport(TSocket socket, Configuration conf) throws TTransportException
-    {
-        TTransport transport = new TFramedTransport(socket, ConfigHelper.getThriftFramedTransportSize(conf));
-        transport.open();
-        return transport;
-    }
-
-    //
     public TTransport openTransport(String host, int port, Configuration conf) throws TTransportException
     {
         TSocket socket = new TSocket(host, port);


[3/3] git commit: Merge branch 'cassandra-1.2' into trunk

Posted by jb...@apache.org.
Merge branch 'cassandra-1.2' into trunk


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/0eb048f2
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0eb048f2
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0eb048f2

Branch: refs/heads/trunk
Commit: 0eb048f2358f37565703fb70152fc066aed8cc73
Parents: 90052d5 b973a33
Author: Jonathan Ellis <jb...@apache.org>
Authored: Thu Jun 6 14:24:32 2013 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Thu Jun 6 14:24:32 2013 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/hadoop/ConfigHelper.java  |   10 +-
 .../apache/cassandra/thrift/ITransportFactory.java |   43 ++++++++-
 .../cassandra/thrift/TClientTransportFactory.java  |   70 ---------------
 .../cassandra/thrift/TFramedTransportFactory.java  |   11 +--
 4 files changed, 46 insertions(+), 88 deletions(-)
----------------------------------------------------------------------