You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by db...@apache.org on 2014/12/27 21:20:29 UTC
[1/2] cassandra git commit: move null guard to where it's useful
Repository: cassandra
Updated Branches:
refs/heads/trunk b5a232b04 -> 17d9791d6
move null guard to where it's useful
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/12b96915
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/12b96915
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/12b96915
Branch: refs/heads/trunk
Commit: 12b96915c3e37edc1ea6b584ebc406f44426d4ec
Parents: b53fefa
Author: Dave Brosius <db...@mebigfatguy.com>
Authored: Sat Dec 27 15:18:59 2014 -0500
Committer: Dave Brosius <db...@mebigfatguy.com>
Committed: Sat Dec 27 15:18:59 2014 -0500
----------------------------------------------------------------------
.../cassandra/hadoop/cql3/CqlRecordWriter.java | 26 +++++++++++---------
1 file changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/12b96915/src/java/org/apache/cassandra/hadoop/cql3/CqlRecordWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/cql3/CqlRecordWriter.java b/src/java/org/apache/cassandra/hadoop/cql3/CqlRecordWriter.java
index ff1989d..702cae3 100644
--- a/src/java/org/apache/cassandra/hadoop/cql3/CqlRecordWriter.java
+++ b/src/java/org/apache/cassandra/hadoop/cql3/CqlRecordWriter.java
@@ -104,23 +104,27 @@ class CqlRecordWriter extends AbstractColumnFamilyRecordWriter<Map<String, ByteB
try
{
Cassandra.Client client = ConfigHelper.getClientFromOutputAddressList(conf);
- client.set_keyspace(ConfigHelper.getOutputKeyspace(conf));
- String user = ConfigHelper.getOutputKeyspaceUserName(conf);
- String password = ConfigHelper.getOutputKeyspacePassword(conf);
- if ((user != null) && (password != null))
- AbstractColumnFamilyOutputFormat.login(user, password, client);
- retrievePartitionKeyValidator(client);
- String cqlQuery = CqlConfigHelper.getOutputCql(conf).trim();
- if (cqlQuery.toLowerCase().startsWith("insert"))
- throw new UnsupportedOperationException("INSERT with CqlRecordWriter is not supported, please use UPDATE/DELETE statement");
- cql = appendKeyWhereClauses(cqlQuery);
-
if (client != null)
{
+ client.set_keyspace(ConfigHelper.getOutputKeyspace(conf));
+ String user = ConfigHelper.getOutputKeyspaceUserName(conf);
+ String password = ConfigHelper.getOutputKeyspacePassword(conf);
+ if ((user != null) && (password != null))
+ AbstractColumnFamilyOutputFormat.login(user, password, client);
+ retrievePartitionKeyValidator(client);
+ String cqlQuery = CqlConfigHelper.getOutputCql(conf).trim();
+ if (cqlQuery.toLowerCase().startsWith("insert"))
+ throw new UnsupportedOperationException("INSERT with CqlRecordWriter is not supported, please use UPDATE/DELETE statement");
+ cql = appendKeyWhereClauses(cqlQuery);
+
TTransport transport = client.getOutputProtocol().getTransport();
if (transport.isOpen())
transport.close();
}
+ else
+ {
+ throw new IllegalArgumentException("Invalid configuration specified " + conf);
+ }
}
catch (Exception e)
{
[2/2] cassandra git commit: Merge branch 'cassandra-2.1' into trunk
Posted by db...@apache.org.
Merge branch 'cassandra-2.1' into trunk
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/17d9791d
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/17d9791d
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/17d9791d
Branch: refs/heads/trunk
Commit: 17d9791d63c4bfde657ac1c13b45d1a357ce44bd
Parents: b5a232b 12b9691
Author: Dave Brosius <db...@mebigfatguy.com>
Authored: Sat Dec 27 15:19:28 2014 -0500
Committer: Dave Brosius <db...@mebigfatguy.com>
Committed: Sat Dec 27 15:19:28 2014 -0500
----------------------------------------------------------------------
.../cassandra/hadoop/cql3/CqlRecordWriter.java | 26 +++++++++++---------
1 file changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/17d9791d/src/java/org/apache/cassandra/hadoop/cql3/CqlRecordWriter.java
----------------------------------------------------------------------