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
@Configuration | |
public class CommonConfig { | |
@Bean | |
public static PropertySourcesPlaceholderConfigurer propertyConfigurer() { | |
return new PropertySourcesPlaceholderConfigurer(); | |
} | |
@Value("${streaming.nsq.lookupd_addresses}") | |
private String[] nsqLookupAddresses; |
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
final CassandraHostConfigurator hostConfigurator = new CassandraHostConfigurator(cassandraHosts); | |
hostConfigurator.setClientFactoryClass(HVersionEnforcingClientFactory.class.getName()); | |
final Cluster cluster = HFactory.getOrCreateCluster(clusterName, hostConfigurator); | |
cluster.onStartup(); | |
// use the resulting cluster... |
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}. |
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 java.util.Map; | |
import me.prettyprint.cassandra.connection.client.HClient; | |
import me.prettyprint.cassandra.service.CassandraHost; | |
import me.prettyprint.cassandra.service.ExceptionsTranslator; | |
import me.prettyprint.cassandra.service.ExceptionsTranslatorImpl; | |
import org.apache.cassandra.thrift.Cassandra.Client; |