/** * In initializing the cassandra datastore, read the mapping file, creates the basic connection to cassandra cluster, * according to the gora properties * * @param keyClass key class * @param persistentClass persistent class * @param properties properties */ @Override public void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties) { LOG.debug("Initializing Cassandra store"); String serializationType; try { this.keyClass = keyClass; this.persistentClass = persistentClass; if (this.beanFactory == null) { this.beanFactory = new BeanFactoryImpl<>(keyClass, persistentClass); } String mappingFile = DataStoreFactory.getMappingFile(properties, this, DEFAULT_MAPPING_FILE); serializationType = properties.getProperty(CassandraStoreParameters.CASSANDRA_SERIALIZATION_TYPE); CassandraMappingBuilder mappingBuilder = new CassandraMappingBuilder(this); mapping = mappingBuilder.readMapping(mappingFile); CassandraClient cassandraClient = new CassandraClient(); cassandraClient.initialize(properties, mapping); cassandraSerializer = CassandraSerializer.getSerializer(cassandraClient, serializationType, this, mapping); } catch (Exception e) { throw new RuntimeException("Error while initializing Cassandra store: " + e.getMessage(), e); } }
this.beanFactory = new BeanFactoryImpl<>(keyClass, persistentClass); String mappingFile = DataStoreFactory.getMappingFile(properties, this, DEFAULT_MAPPING_FILE); serializationType = properties.getProperty(CassandraStoreParameters.CASSANDRA_SERIALIZATION_TYPE); CassandraMappingBuilder mappingBuilder = new CassandraMappingBuilder(this);
String mappingFile = DataStoreFactory.getMappingFile(properties, this, DEFAULT_MAPPING_FILE); String user = DataStoreFactory.findProperty(properties, this, USERNAME_PROPERTY, null); String password = DataStoreFactory.findProperty(properties, this, PASSWORD_PROPERTY, null);
final String mappingFile = DataStoreFactory.getMappingFile(properties, this, DEFAULT_MAPPING_FILE); final HttpClient httpClient = new StdHttpClient.Builder() .url("http://" + params.getServer() + ":" + params.getPort())
super.initialize(keyClass, persistentClass, properties); try { String mappingFile = DataStoreFactory.getMappingFile(properties, this, DEFAULT_MAPPING_FILE); mapping = readMapping(mappingFile);
final String mappingFile = DataStoreFactory.getMappingFile(properties, this, DEFAULT_MAPPING_FILE); final HttpClient httpClient = new StdHttpClient.Builder() .url("http://" + params.getServer() + ":" + params.getPort())