DATACOUCH-299 - Roll back to Java client 2.2.8.
This reverts commit 4b78715ed5.
Related ticket: DATACOUCH-290.
This commit is contained in:
4
pom.xml
4
pom.xml
@@ -21,8 +21,8 @@
|
||||
|
||||
<dist.key>DATACOUCH</dist.key>
|
||||
|
||||
<couchbase>2.4.4</couchbase>
|
||||
<couchbase.osgi>2.4.4</couchbase.osgi>
|
||||
<couchbase>2.2.8</couchbase>
|
||||
<couchbase.osgi>2.2.8</couchbase.osgi>
|
||||
<springdata.commons>1.13.3.BUILD-SNAPSHOT</springdata.commons>
|
||||
<validation>1.0.0.GA</validation>
|
||||
</properties>
|
||||
|
||||
@@ -134,9 +134,9 @@ public class CouchbaseRepositoryViewTests {
|
||||
String highKey = "uname-11";
|
||||
List<String> keys = Arrays.asList(lowKey, middleKey, highKey);
|
||||
|
||||
User u1 = repository.findByUsernameIs(lowKey).get(0);
|
||||
User u2 = repository.findByUsernameIs(middleKey).get(0);
|
||||
User u3 = repository.findByUsernameIs(highKey).get(0);
|
||||
User u1 = repository.findByUsernameIs(lowKey);
|
||||
User u2 = repository.findByUsernameIs(middleKey);
|
||||
User u3 = repository.findByUsernameIs(highKey);
|
||||
|
||||
|
||||
List<User> in = repository.findAllByUsernameIn(keys);
|
||||
|
||||
@@ -46,7 +46,7 @@ public interface CustomUserRepository extends CouchbaseRepository<User, String>
|
||||
long countByUsernameGreaterThanEqualAndUsernameLessThan(String lowBound, String highBound);
|
||||
|
||||
@View(viewName = "customFindByNameView")
|
||||
List<User> findByUsernameIs(String lowKey);
|
||||
User findByUsernameIs(String lowKey);
|
||||
|
||||
@View(viewName = "customFindByNameView")
|
||||
List<User> findAllByUsernameIn(List<String> keys);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.springframework.data.couchbase.repository.index;
|
||||
|
||||
import com.couchbase.client.java.Bucket;
|
||||
import com.couchbase.client.java.error.DesignDocumentDoesNotExistException;
|
||||
import com.couchbase.client.java.query.Index;
|
||||
import com.couchbase.client.java.query.N1qlQuery;
|
||||
|
||||
@@ -13,19 +12,14 @@ import org.springframework.test.context.support.DependencyInjectionTestExecution
|
||||
* A test listener that will remove the indexes created in {@link IndexedRepositoryTests} before test case is run.
|
||||
*
|
||||
* @author Simon Baslé
|
||||
* @author Subhashni Balakrishnan
|
||||
*/
|
||||
public class IndexedRepositoryTestListener extends DependencyInjectionTestExecutionListener {
|
||||
|
||||
@Override
|
||||
public void beforeTestClass(final TestContext testContext) throws Exception {
|
||||
Bucket client = (Bucket) testContext.getApplicationContext().getBean(BeanNames.COUCHBASE_BUCKET);
|
||||
try {
|
||||
client.bucketManager().removeDesignDocument(IndexedRepositoryTests.VIEW_DOC);
|
||||
client.bucketManager().removeDesignDocument("foo");
|
||||
} catch (DesignDocumentDoesNotExistException ex) {
|
||||
//ignore
|
||||
}
|
||||
client.bucketManager().removeDesignDocument(IndexedRepositoryTests.VIEW_DOC);
|
||||
client.bucketManager().removeDesignDocument("foo");
|
||||
client.query(N1qlQuery.simple(Index.dropPrimaryIndex(client.name())));
|
||||
client.query(N1qlQuery.simple(Index.dropIndex(client.name(), IndexedRepositoryTests.SECONDARY)));
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import static org.junit.Assert.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.couchbase.client.java.error.DesignDocumentDoesNotExistException;
|
||||
import com.couchbase.client.java.query.N1qlQuery;
|
||||
import com.couchbase.client.java.query.N1qlQueryResult;
|
||||
import com.couchbase.client.java.view.DesignDocument;
|
||||
@@ -137,15 +136,9 @@ public class IndexedRepositoryTests {
|
||||
public void shouldNotFindViewIndexWithIgnoringIndexManager() {
|
||||
AnotherIndexedUserRepository repository = ignoringIndexFactory.getRepository(AnotherIndexedUserRepository.class);
|
||||
|
||||
DesignDocument designDoc = null;
|
||||
|
||||
try {
|
||||
designDoc = template.getCouchbaseBucket()
|
||||
.bucketManager()
|
||||
.getDesignDocument(VIEW_DOC);
|
||||
} catch (DesignDocumentDoesNotExistException ex) {
|
||||
//ignore
|
||||
}
|
||||
DesignDocument designDoc = template.getCouchbaseBucket()
|
||||
.bucketManager()
|
||||
.getDesignDocument(VIEW_DOC);
|
||||
|
||||
if (designDoc != null) {
|
||||
for (View view : designDoc.views()) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors
|
||||
* Copyright 2012-2016 the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,7 +30,6 @@ import org.springframework.beans.factory.config.AbstractFactoryBean;
|
||||
*
|
||||
* @author Simon Baslé
|
||||
* @author Simon Bland
|
||||
* @author Subhashni Balakrishnan
|
||||
*/
|
||||
/*package*/ class CouchbaseEnvironmentFactoryBean extends AbstractFactoryBean<CouchbaseEnvironment> {
|
||||
|
||||
@@ -52,17 +51,6 @@ import org.springframework.beans.factory.config.AbstractFactoryBean;
|
||||
eventBus
|
||||
systemMetricsCollectorConfig
|
||||
networkLatencyMetricsCollectorConfig
|
||||
requestBufferWaitStrategy
|
||||
sslKeystore
|
||||
memcachedHashingStrategy
|
||||
kvIoPool
|
||||
queryIoPool
|
||||
searchIoPool
|
||||
viewIoPool
|
||||
kvServiceConfig
|
||||
queryServiceConfig
|
||||
searchServiceConfig
|
||||
viewServiceConfig
|
||||
*/
|
||||
|
||||
@Override
|
||||
@@ -135,6 +123,14 @@ import org.springframework.beans.factory.config.AbstractFactoryBean;
|
||||
this.couchbaseEnvBuilder.sslKeystorePassword(sslKeystorePassword);
|
||||
}
|
||||
|
||||
public void setQueryEnabled(boolean queryEnabled) {
|
||||
this.couchbaseEnvBuilder.queryEnabled(queryEnabled);
|
||||
}
|
||||
|
||||
public void setQueryPort(int queryPort) {
|
||||
this.couchbaseEnvBuilder.queryPort(queryPort);
|
||||
}
|
||||
|
||||
public void setBootstrapHttpEnabled(boolean bootstrapHttpEnabled) {
|
||||
this.couchbaseEnvBuilder.bootstrapHttpEnabled(bootstrapHttpEnabled);
|
||||
}
|
||||
@@ -210,8 +206,4 @@ import org.springframework.beans.factory.config.AbstractFactoryBean;
|
||||
public void setMutationTokensEnabled(boolean mutationTokensEnabled) {
|
||||
this.couchbaseEnvBuilder.mutationTokensEnabled(mutationTokensEnabled);
|
||||
}
|
||||
|
||||
public void setAnalyticsTimeout(long analyticsTimeout) {
|
||||
this.couchbaseEnvBuilder.analyticsTimeout(analyticsTimeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors
|
||||
* Copyright 2012-2016 the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,14 +16,9 @@
|
||||
|
||||
package org.springframework.data.couchbase.config;
|
||||
|
||||
import java.security.KeyStore;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.couchbase.client.core.env.*;
|
||||
import com.couchbase.client.core.event.EventBus;
|
||||
import com.couchbase.client.core.metrics.MetricsCollector;
|
||||
import com.couchbase.client.core.metrics.NetworkLatencyMetricsCollector;
|
||||
import com.couchbase.client.core.node.MemcachedHashingStrategy;
|
||||
import com.couchbase.client.core.retry.RetryStrategy;
|
||||
import com.couchbase.client.core.time.Delay;
|
||||
import com.couchbase.client.deps.io.netty.channel.EventLoopGroup;
|
||||
@@ -37,7 +32,6 @@ import rx.Scheduler;
|
||||
*
|
||||
* @author Simon Baslé
|
||||
* @author Jonathan Edwards
|
||||
* @author Subhashni Balakrishnan
|
||||
*/
|
||||
public class CouchbaseEnvironmentNoShutdownProxy implements CouchbaseEnvironment {
|
||||
|
||||
@@ -48,8 +42,8 @@ public class CouchbaseEnvironmentNoShutdownProxy implements CouchbaseEnvironment
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shutdown() {
|
||||
return false;
|
||||
public Observable<Boolean> shutdown() {
|
||||
return Observable.just(false);
|
||||
}
|
||||
|
||||
//===== DELEGATION METHODS =====
|
||||
@@ -89,6 +83,18 @@ public class CouchbaseEnvironmentNoShutdownProxy implements CouchbaseEnvironment
|
||||
return delegate.sslKeystorePassword();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean queryEnabled() {
|
||||
return delegate.queryEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int queryPort() {
|
||||
return delegate.queryPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean bootstrapHttpEnabled() {
|
||||
return delegate.bootstrapHttpEnabled();
|
||||
@@ -318,74 +324,4 @@ public class CouchbaseEnvironmentNoShutdownProxy implements CouchbaseEnvironment
|
||||
public long searchTimeout() {
|
||||
return delegate.searchTimeout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public WaitStrategyFactory requestBufferWaitStrategy() {
|
||||
return delegate.requestBufferWaitStrategy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventLoopGroup kvIoPool() {
|
||||
return delegate.kvIoPool();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventLoopGroup viewIoPool() {
|
||||
return delegate.viewIoPool();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventLoopGroup searchIoPool() {
|
||||
return delegate.searchIoPool();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventLoopGroup queryIoPool() {
|
||||
return delegate.queryIoPool();
|
||||
}
|
||||
|
||||
@Override
|
||||
public KeyStore sslKeystore() {
|
||||
return delegate.sslKeystore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shutdown(long timeout, TimeUnit timeUnit) {
|
||||
return delegate.shutdown(timeout, timeUnit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MemcachedHashingStrategy memcachedHashingStrategy() {
|
||||
return delegate.memcachedHashingStrategy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long analyticsTimeout() {
|
||||
return delegate.analyticsTimeout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long configPollInterval() {
|
||||
return delegate.configPollInterval();
|
||||
}
|
||||
|
||||
@Override
|
||||
public KeyValueServiceConfig kvServiceConfig() {
|
||||
return delegate.kvServiceConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryServiceConfig queryServiceConfig() {
|
||||
return delegate.queryServiceConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SearchServiceConfig searchServiceConfig() {
|
||||
return delegate.searchServiceConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewServiceConfig viewServiceConfig() {
|
||||
return delegate.viewServiceConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors
|
||||
* Copyright 2012-2015 the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -44,6 +44,8 @@ import org.springframework.util.StringUtils;
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#sslEnabled(boolean) sslEnabled}</li>
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#sslKeystoreFile(String) sslKeystoreFile}</li>
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#sslKeystorePassword(String) sslKeystorePassword}</li>
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#queryEnabled(boolean) queryEnabled}</li>
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#queryPort(int) queryPort}</li>
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#bootstrapHttpEnabled(boolean) bootstrapHttpEnabled}</li>
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#bootstrapCarrierEnabled(boolean) bootstrapCarrierEnabled}</li>
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#bootstrapHttpDirectPort(int) bootstrapHttpDirectPort}</li>
|
||||
@@ -64,11 +66,9 @@ import org.springframework.util.StringUtils;
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#bufferPoolingEnabled(boolean) bufferPoolingEnabled}</li>
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#tcpNodelayEnabled(boolean) tcpNodelayEnabled}</li>
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#mutationTokensEnabled(boolean) mutationTokensEnabled}</li>
|
||||
* <li>{@link DefaultCouchbaseEnvironment.Builder#analyticsTimeout(long) analyticsTimeout}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author Simon Baslé
|
||||
* @author Subhashni Balakrishnan
|
||||
*/
|
||||
public class CouchbaseEnvironmentParser extends AbstractSingleBeanDefinitionParser {
|
||||
|
||||
@@ -117,6 +117,8 @@ public class CouchbaseEnvironmentParser extends AbstractSingleBeanDefinitionPars
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "sslEnabled", "sslEnabled");
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "sslKeystoreFile", "sslKeystoreFile");
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "sslKeystorePassword", "sslKeystorePassword");
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "queryEnabled", "queryEnabled");
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "queryPort", "queryPort");
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "bootstrapHttpEnabled", "bootstrapHttpEnabled");
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "bootstrapCarrierEnabled", "bootstrapCarrierEnabled");
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "bootstrapHttpDirectPort", "bootstrapHttpDirectPort");
|
||||
@@ -136,7 +138,6 @@ public class CouchbaseEnvironmentParser extends AbstractSingleBeanDefinitionPars
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "bufferPoolingEnabled", "bufferPoolingEnabled");
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "tcpNodelayEnabled", "tcpNodelayEnabled");
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "mutationTokensEnabled", "mutationTokensEnabled");
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "analyticsTimeout", "analyticsTimeout");
|
||||
|
||||
//retry strategy is particular, in the xsd this is an enum (FailFast, BestEffort)
|
||||
setPropertyValue(envDefinitionBuilder, envElement, "retryStrategy", "retryStrategy");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors
|
||||
* Copyright 2012-2015 the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,7 +23,6 @@ import java.util.Collections;
|
||||
|
||||
import com.couchbase.client.java.bucket.BucketManager;
|
||||
import com.couchbase.client.java.document.json.JsonObject;
|
||||
import com.couchbase.client.java.error.DesignDocumentDoesNotExistException;
|
||||
import com.couchbase.client.java.query.AsyncN1qlQueryResult;
|
||||
import com.couchbase.client.java.query.Index;
|
||||
import com.couchbase.client.java.query.Statement;
|
||||
@@ -52,7 +51,6 @@ import org.springframework.data.repository.core.RepositoryInformation;
|
||||
* Index creation will be attempted in parallel using the asynchronous APIs, but the overall process is still blocking.
|
||||
*
|
||||
* @author Simon Baslé
|
||||
* @author Subhashni Balakrishnan
|
||||
*/
|
||||
public class IndexManager {
|
||||
|
||||
@@ -243,14 +241,7 @@ public class IndexManager {
|
||||
}
|
||||
|
||||
com.couchbase.client.java.view.View view = DefaultView.create(viewName, mapFunction, reduceFunction);
|
||||
DesignDocument doc = null;
|
||||
|
||||
try {
|
||||
doc = manager.getDesignDocument(config.designDoc());
|
||||
} catch (DesignDocumentDoesNotExistException ex) {
|
||||
//Ignore
|
||||
}
|
||||
|
||||
DesignDocument doc = manager.getDesignDocument(config.designDoc());
|
||||
if (doc != null) {
|
||||
for (com.couchbase.client.java.view.View existingView : doc.views()) {
|
||||
if (existingView.name().equals(viewName)) {
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
<xsd:attribute name="bufferPoolingEnabled" type="xsd:boolean"/>
|
||||
<xsd:attribute name="tcpNodelayEnabled" type="xsd:boolean"/>
|
||||
<xsd:attribute name="mutationTokensEnabled" type="xsd:boolean"/>
|
||||
<xsd:attribute name="analyticsTimeout" type="xsd:long"/>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors
|
||||
* Copyright 2012-2015 the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -79,6 +79,8 @@ public class CouchbaseEnvironmentParserTest {
|
||||
assertThat(env.sslEnabled(), allOf(equalTo(true), not(defaultEnv.sslEnabled())));
|
||||
assertThat(env.sslKeystoreFile(), is(equalTo("test")));
|
||||
assertThat(env.sslKeystorePassword(), is(equalTo("test")));
|
||||
assertThat(env.queryEnabled(), allOf(equalTo(true), not(defaultEnv.queryEnabled())));
|
||||
assertThat(env.queryPort(), is(equalTo(7)));
|
||||
assertThat(env.bootstrapHttpEnabled(), allOf(equalTo(false), not(defaultEnv.bootstrapHttpEnabled())));
|
||||
assertThat(env.bootstrapCarrierEnabled(), allOf(equalTo(false), not(defaultEnv.bootstrapCarrierEnabled())));
|
||||
assertThat(env.bootstrapHttpDirectPort(), is(equalTo(8)));
|
||||
@@ -99,7 +101,6 @@ public class CouchbaseEnvironmentParserTest {
|
||||
assertThat(env.bufferPoolingEnabled(), allOf(equalTo(false), not(defaultEnv.bufferPoolingEnabled())));
|
||||
assertThat(env.tcpNodelayEnabled(), allOf(equalTo(false), not(defaultEnv.tcpNodelayEnabled())));
|
||||
assertThat(env.mutationTokensEnabled(), allOf(equalTo(true), not(defaultEnv.mutationTokensEnabled())));
|
||||
assertThat(env.analyticsTimeout(), is(equalTo(30L)));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
sslEnabled="true"
|
||||
sslKeystoreFile="test"
|
||||
sslKeystorePassword="test"
|
||||
queryEnabled="true"
|
||||
queryPort="7"
|
||||
bootstrapHttpEnabled="false"
|
||||
bootstrapCarrierEnabled="false"
|
||||
bootstrapHttpDirectPort="8"
|
||||
@@ -43,7 +45,6 @@
|
||||
bufferPoolingEnabled="false"
|
||||
tcpNodelayEnabled="false"
|
||||
mutationTokensEnabled="true"
|
||||
analyticsTimeout="30"
|
||||
/>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user