Created
March 15, 2013 14:44
-
-
Save malexejev/5170342 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.xxx.metadata.hector; | |
import me.prettyprint.cassandra.connection.client.HClient; | |
import me.prettyprint.cassandra.connection.factory.HThriftClientFactoryImpl; | |
import me.prettyprint.cassandra.service.CassandraHost; | |
import me.prettyprint.cassandra.service.CassandraHostConfigurator; | |
/** | |
* Custom client factory for use in {@link CassandraHostConfigurator}. | |
* Works by wrapping internally generated Thrift client with {@link HVersionEnforcingClient}. | |
* | |
* @author Max Alexejev | |
* Mar 13, 2013 | |
*/ | |
public class HVersionEnforcingClientFactory extends HThriftClientFactoryImpl { | |
public static final String CQL_VERSION = "3.0.0"; | |
@Override | |
public HClient createClient(CassandraHost ch) { | |
return new HVersionEnforcingClient(super.createClient(ch), CQL_VERSION); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment