rename native client to basic client
This commit is contained in:
parent
c4562bb681
commit
be2f18446b
9 changed files with 13 additions and 14 deletions
|
@ -10,7 +10,7 @@ import java.util.concurrent.TimeUnit;
|
|||
/**
|
||||
* Interface for extended managing and indexing methods of an Elasticsearch client.
|
||||
*/
|
||||
public interface AdminClient extends NativeClient {
|
||||
public interface AdminClient extends BasicClient {
|
||||
|
||||
/**
|
||||
* Build index definition from settings.
|
||||
|
|
|
@ -4,10 +4,9 @@ import org.elasticsearch.client.ElasticsearchClient;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public interface NativeClient extends Closeable {
|
||||
public interface BasicClient extends Closeable {
|
||||
|
||||
/**
|
||||
* Set an Elasticsearch client to extend from it. May be null for TransportClient.
|
|
@ -11,7 +11,7 @@ import java.io.IOException;
|
|||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public interface BulkClient extends NativeClient, Flushable {
|
||||
public interface BulkClient extends BasicClient, Flushable {
|
||||
|
||||
/**
|
||||
* Get bulk metric.
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.Optional;
|
|||
import java.util.function.Consumer;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public interface SearchClient {
|
||||
public interface SearchClient extends BasicClient {
|
||||
|
||||
Optional<GetResponse> get(Consumer<GetRequestBuilder> getRequestBuilder);
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class AbstractAdminClient extends AbstractNativeClient implements AdminClient {
|
||||
public abstract class AbstractAdminClient extends AbstractBasicClient implements AdminClient {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(AbstractAdminClient.class.getName());
|
||||
|
||||
|
|
|
@ -23,14 +23,14 @@ import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.xbib.elx.api.NativeClient;
|
||||
import org.xbib.elx.api.BasicClient;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
public abstract class AbstractNativeClient implements NativeClient {
|
||||
public abstract class AbstractBasicClient implements BasicClient {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(AbstractNativeClient.class.getName());
|
||||
private static final Logger logger = LogManager.getLogger(AbstractBasicClient.class.getName());
|
||||
|
||||
/**
|
||||
* The one and only index type name used in the extended client.
|
||||
|
@ -44,7 +44,7 @@ public abstract class AbstractNativeClient implements NativeClient {
|
|||
|
||||
private final AtomicBoolean closed;
|
||||
|
||||
public AbstractNativeClient() {
|
||||
public AbstractBasicClient() {
|
||||
closed = new AtomicBoolean(false);
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ import java.util.Map;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
public abstract class AbstractBulkClient extends AbstractNativeClient implements BulkClient {
|
||||
public abstract class AbstractBulkClient extends AbstractBasicClient implements BulkClient {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(AbstractBulkClient.class.getName());
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.util.function.Predicate;
|
|||
import java.util.stream.Stream;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
public abstract class AbstractSearchClient extends AbstractNativeClient implements SearchClient {
|
||||
public abstract class AbstractSearchClient extends AbstractBasicClient implements SearchClient {
|
||||
|
||||
@Override
|
||||
public Optional<GetResponse> get(Consumer<GetRequestBuilder> getRequestBuilderConsumer) {
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.elasticsearch.common.unit.ByteSizeValue;
|
|||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.xbib.elx.api.AdminClientProvider;
|
||||
import org.xbib.elx.api.BulkClientProvider;
|
||||
import org.xbib.elx.api.NativeClient;
|
||||
import org.xbib.elx.api.BasicClient;
|
||||
import org.xbib.elx.api.SearchClientProvider;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -107,7 +107,7 @@ public class ClientBuilder {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <C extends NativeClient> C build() throws IOException {
|
||||
public <C extends BasicClient> C build() throws IOException {
|
||||
Settings settings = settingsBuilder.build();
|
||||
logger.log(Level.INFO, "settings = " + settings.toDelimitedString(','));
|
||||
if (adminClientProvider != null) {
|
||||
|
|
Loading…
Reference in a new issue