Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
If CQL version is set for a query, then enforce that for each execution
  • Loading branch information
mishail.mishail@gmail.com committed Jun 28, 2013
1 parent 1453892 commit 5c1aa6a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,8 @@ public QueryResult<CqlRows<K, N, V>> execute() {
public CqlRows<K, N, V> execute(Client cassandra) throws HectorException {
CqlRows<K, N, V> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <T> ExecutionResult<T> doExecute(KeyspaceOperationCallback<T> koc)
throws HectorException {
KeyspaceService ks = null;
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/me/prettyprint/hector/api/Keyspace.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@ public interface Keyspace {
String getKeyspaceName();

long createClock();

void setCqlVersion(String version);

}

1 comment on commit 5c1aa6a

@zznate
Copy link

@zznate zznate commented on 5c1aa6a Jun 29, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense - not sure why we put this on ExecutingKeyspace/Keyspace in the first place.

Thanks!

Please sign in to comment.