From 5c1aa6a90f2933bb4a0426ce3a99aad0c404c59f Mon Sep 17 00:00:00 2001 From: "mishail.mishail@gmail.com" Date: Fri, 28 Jun 2013 16:50:55 -0700 Subject: [PATCH] ref hector-client/hector#600 If CQL version is set for a query, then enforce that for each execution --- .../java/me/prettyprint/cassandra/model/CqlQuery.java | 5 +---- .../cassandra/model/ExecutingKeyspace.java | 11 ----------- .../main/java/me/prettyprint/hector/api/Keyspace.java | 3 --- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/core/src/main/java/me/prettyprint/cassandra/model/CqlQuery.java b/core/src/main/java/me/prettyprint/cassandra/model/CqlQuery.java index 21dc6496d..0790d9d4b 100644 --- a/core/src/main/java/me/prettyprint/cassandra/model/CqlQuery.java +++ b/core/src/main/java/me/prettyprint/cassandra/model/CqlQuery.java @@ -109,11 +109,8 @@ public QueryResult> execute() { public CqlRows execute(Client cassandra) throws HectorException { CqlRows rows = null; try { - if (cqlVersion != null){ - if (! cqlVersion.equals(keyspace.cqlVersion)){ + if (cqlVersion != null) { cassandra.set_cql_version(cqlVersion); - keyspace.setCqlVersion(cqlVersion); - } } CqlResult result = cassandra.execute_cql_query(query, useCompression ? Compression.GZIP : Compression.NONE); diff --git a/core/src/main/java/me/prettyprint/cassandra/model/ExecutingKeyspace.java b/core/src/main/java/me/prettyprint/cassandra/model/ExecutingKeyspace.java index fbfa21f1f..68fda6941 100644 --- a/core/src/main/java/me/prettyprint/cassandra/model/ExecutingKeyspace.java +++ b/core/src/main/java/me/prettyprint/cassandra/model/ExecutingKeyspace.java @@ -81,17 +81,6 @@ public long createClock() { return connectionManager.createClock(); } - public String getCqlVersion() { - return cqlVersion; - } - - @Override - public void setCqlVersion(String cqlVersion) { - this.cqlVersion = cqlVersion; - } - - - public ExecutionResult doExecute(KeyspaceOperationCallback koc) throws HectorException { KeyspaceService ks = null; diff --git a/core/src/main/java/me/prettyprint/hector/api/Keyspace.java b/core/src/main/java/me/prettyprint/hector/api/Keyspace.java index 3a824901c..d9a32feab 100644 --- a/core/src/main/java/me/prettyprint/hector/api/Keyspace.java +++ b/core/src/main/java/me/prettyprint/hector/api/Keyspace.java @@ -15,7 +15,4 @@ public interface Keyspace { String getKeyspaceName(); long createClock(); - - void setCqlVersion(String version); - } \ No newline at end of file