DATACASS-834 - Default to datacenter1 in AbstractSessionConfiguration.getLocalDataCenter.
Align with Cassandra defaults when starting a new server. Also, improve Javadoc explaining when the localDataCenter setting is required.
This commit is contained in:
@@ -90,7 +90,7 @@ public abstract class AbstractSessionConfiguration implements BeanFactoryAware {
|
||||
/**
|
||||
* Gets a required bean of the provided {@link Class type} from the {@link BeanFactory}.
|
||||
*
|
||||
* @param <T> {@link Class parameterized clas type} of the bean.
|
||||
* @param <T> {@link Class parameterized class type} of the bean.
|
||||
* @param beanType {@link Class type} of the bean.
|
||||
* @return a required bean of the given {@link Class type} from the {@link BeanFactory}.
|
||||
* @see org.springframework.beans.factory.BeanFactory#getBean(Class)
|
||||
@@ -122,13 +122,14 @@ public abstract class AbstractSessionConfiguration implements BeanFactoryAware {
|
||||
|
||||
/**
|
||||
* Returns the local data center name used for
|
||||
* {@link com.datastax.oss.driver.api.core.loadbalancing.LoadBalancingPolicy}.
|
||||
* {@link com.datastax.oss.driver.api.core.loadbalancing.LoadBalancingPolicy}, defaulting to {@code datacenter1}.
|
||||
* Typically required when connecting a Cassandra cluster. Not required when using an Astra connection bundle.
|
||||
*
|
||||
* @return the local data center name.
|
||||
* @return the local data center name. Can be {@literal null} when using an Astra connection bundle.
|
||||
*/
|
||||
@Nullable
|
||||
protected String getLocalDataCenter() {
|
||||
return null;
|
||||
return "datacenter1";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,11 +46,6 @@ public class CqlTemplateConfigIntegrationTests extends AbstractEmbeddedCassandra
|
||||
return "system";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getLocalDataCenter() {
|
||||
return "datacenter1";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPort() {
|
||||
return cassandraEnvironment.getPort();
|
||||
|
||||
@@ -34,8 +34,4 @@ public abstract class AbstractTestJavaConfig extends AbstractSessionConfiguratio
|
||||
return PROPERTIES.getCassandraPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getLocalDataCenter() {
|
||||
return "datacenter1";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user