DATAES-495 - Deprecate TransportClient support.

Original PR: #306
This commit is contained in:
Peter-Josef Meisch 2019-08-17 22:49:34 +02:00
parent 165e02d6e7
commit 4bb7b5ef56
6 changed files with 30 additions and 14 deletions

View File

@ -11,7 +11,7 @@ This project is lead and maintained by the community.
== Features
* Spring configuration support using Java based `@Configuration` classes or an XML namespace for a ES clients instances.
* `ElasticsearchTemplate` helper class that increases productivity performing common ES operations. Includes integrated object mapping between documents and POJOs.
* `ElasticsearchRestTemplate` helper class that increases productivity performing common ES operations. Includes integrated object mapping between documents and POJOs.
* Feature Rich Object Mapping integrated with Springs Conversion Service
* Annotation based mapping metadata but extensible to support other metadata formats
* Automatic implementation of `Repository` interfaces including support for custom finder methods.
@ -60,6 +60,9 @@ public class MyService {
Using Node Client
NOTE: Usage of the Node Client is deprecated as of version 4.0, use RestClient instead.
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
@ -80,6 +83,9 @@ Using Node Client
Using Transport Client
NOTE: Usage of the Transport Client is deprecated as of version 4.0, use RestClient instead.
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>

View File

@ -12,6 +12,8 @@ The default implementations of the interfaces offer:
[[elasticsearch.operations.template]]
== ElasticsearchTemplate
NOTE: Usage of the ElasticsearchTemplate is deprecated as of version 4.0, use ElasticsearchRestTemplate instead.
The `ElasticsearchTemplate` is an implementation of the `ElasticsearchOperations` interface using the <<elasticsearch.clients.transport>>.
.ElasticsearchTemplate configuration
@ -45,7 +47,7 @@ public class TransportClientConfig extends ElasticsearchConfigurationSupport {
}
}
----
<1> Setting up the <<elasticsearch.clients.transport>>.
<1> Setting up the <<elasticsearch.clients.transport>>. Deprecatedas of version 4.0.
<2> Creating the `ElasticsearchTemplate` bean, offering both names, _elasticsearchOperations_ and _elasticsearchTemplate_.
<3> Using the <<elasticsearch.mapping.meta-model>> ElasticsearchMapper.
====

View File

@ -35,7 +35,10 @@ import org.springframework.beans.factory.InitializingBean;
* @author Piotr Betkier
* @author Ilkang Na
* @author Oliver Gierke
* @author Peter-Josef Meisch
* @deprecated as of 4.0
*/
@Deprecated
public class TransportClientFactoryBean implements FactoryBean<TransportClient>, InitializingBean, DisposableBean {
private static final Logger logger = LoggerFactory.getLogger(TransportClientFactoryBean.class);
@ -101,13 +104,10 @@ public class TransportClientFactoryBean implements FactoryBean<TransportClient>,
return builder.build();
}
return Settings.builder()
.put("cluster.name", clusterName)
.put("client.transport.sniff", clientTransportSniff)
return Settings.builder().put("cluster.name", clusterName).put("client.transport.sniff", clientTransportSniff)
.put("client.transport.ignore_cluster_name", clientIgnoreClusterName)
.put("client.transport.ping_timeout", clientPingTimeout)
.put("client.transport.nodes_sampler_interval", clientNodesSamplerInterval)
.build();
.put("client.transport.nodes_sampler_interval", clientNodesSamplerInterval).build();
}
public void setClusterNodes(String clusterNodes) {

View File

@ -27,8 +27,9 @@ import org.w3c.dom.Element;
*
* @author Rizwan Idrees
* @author Mohsin Husen
* @deprecated as of 4.0
*/
@Deprecated
public class TransportClientBeanDefinitionParser extends AbstractBeanDefinitionParser {
@Override

View File

@ -124,9 +124,10 @@ import org.springframework.util.StringUtils;
* @author Martin Choraine
* @author Farid Azaza
* @author Gyula Attila Csorogi
* @deprecated as of 4.0
*/
public class ElasticsearchTemplate extends AbstractElasticsearchTemplate
implements ElasticsearchOperations, EsClient<Client>, ApplicationContextAware {
@Deprecated
public class ElasticsearchTemplate extends AbstractElasticsearchTemplate implements ElasticsearchOperations, EsClient<Client>, ApplicationContextAware {
private static final Logger QUERY_LOGGER = LoggerFactory
.getLogger("org.springframework.data.elasticsearch.core.QUERY");

View File

@ -15,11 +15,15 @@
*/
package org.springframework.data.elasticsearch.repository.config;
import java.lang.annotation.*;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Import;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
import org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean;
import org.springframework.data.repository.config.DefaultRepositoryBaseClass;
import org.springframework.data.repository.query.QueryLookupStrategy.Key;
@ -31,6 +35,7 @@ import org.springframework.data.repository.query.QueryLookupStrategy.Key;
* @author Rizwan Idrees
* @author Mohsin Husen
* @author Kevin Leturc
* @author Peter-Josef Meisch
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@ -114,8 +119,9 @@ public @interface EnableElasticsearchRepositories {
// Elasticsearch specific configuration
/**
* Configures the name of the {@link ElasticsearchTemplate} bean definition to be used to create repositories
* discovered through this annotation. Defaults to {@code elasticsearchTemplate}.
* Configures the name of the {@link org.springframework.data.elasticsearch.core.ElasticsearchOperations} bean
* definition to be used to create repositories discovered through this annotation. Defaults to
* {@code elasticsearchTemplate}.
*
* @return
*/