Fix order of modifiers
This commit is contained in:
parent
93b42b8e69
commit
8c40b2b54e
|
@ -40,7 +40,9 @@
|
|||
<module name="EqualsHashCode" />
|
||||
|
||||
<!-- Checks that the order of modifiers conforms to the suggestions in the
|
||||
Java Language specification, sections 8.1.1, 8.3.1 and 8.4.3.
|
||||
Java Language specification, sections 8.1.1, 8.3.1 and 8.4.3. It is not that
|
||||
the standard is perfect, but having a consistent order makes the code more
|
||||
readable and no other order is compellingly better than the standard.
|
||||
The correct order is:
|
||||
public
|
||||
protected
|
||||
|
|
|
@ -36,7 +36,7 @@ public class NamingConventionsCheckBadClasses {
|
|||
public void testDummy() {}
|
||||
}
|
||||
|
||||
public static abstract class DummyAbstractTests extends UnitTestCase {
|
||||
public abstract static class DummyAbstractTests extends UnitTestCase {
|
||||
}
|
||||
|
||||
public interface DummyInterfaceTests {
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.net.URI;
|
|||
*/
|
||||
final class HttpDeleteWithEntity extends HttpEntityEnclosingRequestBase {
|
||||
|
||||
final static String METHOD_NAME = HttpDelete.METHOD_NAME;
|
||||
static final String METHOD_NAME = HttpDelete.METHOD_NAME;
|
||||
|
||||
HttpDeleteWithEntity(final URI uri) {
|
||||
setURI(uri);
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.net.URI;
|
|||
*/
|
||||
final class HttpGetWithEntity extends HttpEntityEnclosingRequestBase {
|
||||
|
||||
final static String METHOD_NAME = HttpGet.METHOD_NAME;
|
||||
static final String METHOD_NAME = HttpGet.METHOD_NAME;
|
||||
|
||||
HttpGetWithEntity(final URI uri) {
|
||||
setURI(uri);
|
||||
|
|
|
@ -1110,7 +1110,7 @@ public long ramBytesUsed() {
|
|||
this.analyzed.copyBytes(analyzed);
|
||||
}
|
||||
|
||||
private final static class SurfaceFormAndPayload implements Comparable<SurfaceFormAndPayload> {
|
||||
private static final class SurfaceFormAndPayload implements Comparable<SurfaceFormAndPayload> {
|
||||
BytesRef payload;
|
||||
long weight;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ public class NodeExplanation implements Writeable, ToXContent {
|
|||
private final String finalExplanation;
|
||||
|
||||
public NodeExplanation(final DiscoveryNode node, final Decision nodeDecision, final Float nodeWeight,
|
||||
final @Nullable IndicesShardStoresResponse.StoreStatus storeStatus,
|
||||
@Nullable final IndicesShardStoresResponse.StoreStatus storeStatus,
|
||||
final ClusterAllocationExplanation.FinalDecision finalDecision,
|
||||
final String finalExplanation,
|
||||
final ClusterAllocationExplanation.StoreCopy storeCopy) {
|
||||
|
|
|
@ -130,7 +130,7 @@ public class TransportGetFieldMappingsIndexAction extends TransportSingleShardAc
|
|||
|
||||
private static final ToXContent.Params includeDefaultsParams = new ToXContent.Params() {
|
||||
|
||||
final static String INCLUDE_DEFAULTS = "include_defaults";
|
||||
static final String INCLUDE_DEFAULTS = "include_defaults";
|
||||
|
||||
@Override
|
||||
public String param(String key) {
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.io.IOException;
|
|||
* when the index is at least {@link #value} old
|
||||
*/
|
||||
public class MaxAgeCondition extends Condition<TimeValue> {
|
||||
public final static String NAME = "max_age";
|
||||
public static final String NAME = "max_age";
|
||||
|
||||
public MaxAgeCondition(TimeValue value) {
|
||||
super(NAME);
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.io.IOException;
|
|||
* when the index has at least {@link #value} docs
|
||||
*/
|
||||
public class MaxDocsCondition extends Condition<Long> {
|
||||
public final static String NAME = "max_docs";
|
||||
public static final String NAME = "max_docs";
|
||||
|
||||
public MaxDocsCondition(Long value) {
|
||||
super(NAME);
|
||||
|
|
|
@ -31,8 +31,8 @@ import java.util.EnumSet;
|
|||
*/
|
||||
public class CommonStatsFlags implements Streamable, Cloneable {
|
||||
|
||||
public final static CommonStatsFlags ALL = new CommonStatsFlags().all();
|
||||
public final static CommonStatsFlags NONE = new CommonStatsFlags().clear();
|
||||
public static final CommonStatsFlags ALL = new CommonStatsFlags().all();
|
||||
public static final CommonStatsFlags NONE = new CommonStatsFlags().clear();
|
||||
|
||||
private EnumSet<Flag> flags = EnumSet.allOf(Flag.class);
|
||||
private String[] types = null;
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.util.Iterator;
|
|||
*/
|
||||
public class BulkResponse extends ActionResponse implements Iterable<BulkItemResponse> {
|
||||
|
||||
public final static long NO_INGEST_TOOK = -1L;
|
||||
public static final long NO_INGEST_TOOK = -1L;
|
||||
|
||||
private BulkItemResponse[] responses;
|
||||
private long tookInMillis;
|
||||
|
|
|
@ -71,8 +71,8 @@ import static org.elasticsearch.action.support.replication.ReplicationOperation.
|
|||
*/
|
||||
public class TransportShardBulkAction extends TransportWriteAction<BulkShardRequest, BulkShardResponse> {
|
||||
|
||||
private final static String OP_TYPE_UPDATE = "update";
|
||||
private final static String OP_TYPE_DELETE = "delete";
|
||||
private static final String OP_TYPE_UPDATE = "update";
|
||||
private static final String OP_TYPE_DELETE = "delete";
|
||||
|
||||
public static final String ACTION_NAME = BulkAction.NAME + "[s]";
|
||||
|
||||
|
|
|
@ -615,17 +615,17 @@ public abstract class FieldStats<T> implements Writeable, ToXContent {
|
|||
}
|
||||
}
|
||||
|
||||
private final static class Fields {
|
||||
final static String MAX_DOC = new String("max_doc");
|
||||
final static String DOC_COUNT = new String("doc_count");
|
||||
final static String DENSITY = new String("density");
|
||||
final static String SUM_DOC_FREQ = new String("sum_doc_freq");
|
||||
final static String SUM_TOTAL_TERM_FREQ = new String("sum_total_term_freq");
|
||||
final static String SEARCHABLE = new String("searchable");
|
||||
final static String AGGREGATABLE = new String("aggregatable");
|
||||
final static String MIN_VALUE = new String("min_value");
|
||||
final static String MIN_VALUE_AS_STRING = new String("min_value_as_string");
|
||||
final static String MAX_VALUE = new String("max_value");
|
||||
final static String MAX_VALUE_AS_STRING = new String("max_value_as_string");
|
||||
private static final class Fields {
|
||||
static final String MAX_DOC = new String("max_doc");
|
||||
static final String DOC_COUNT = new String("doc_count");
|
||||
static final String DENSITY = new String("density");
|
||||
static final String SUM_DOC_FREQ = new String("sum_doc_freq");
|
||||
static final String SUM_TOTAL_TERM_FREQ = new String("sum_total_term_freq");
|
||||
static final String SEARCHABLE = new String("searchable");
|
||||
static final String AGGREGATABLE = new String("aggregatable");
|
||||
static final String MIN_VALUE = new String("min_value");
|
||||
static final String MIN_VALUE_AS_STRING = new String("min_value_as_string");
|
||||
static final String MAX_VALUE = new String("max_value");
|
||||
static final String MAX_VALUE_AS_STRING = new String("max_value_as_string");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ import java.util.List;
|
|||
*/
|
||||
public class FieldStatsRequest extends BroadcastRequest<FieldStatsRequest> {
|
||||
|
||||
public final static String DEFAULT_LEVEL = "cluster";
|
||||
public static final String DEFAULT_LEVEL = "cluster";
|
||||
|
||||
private String[] fields = Strings.EMPTY_ARRAY;
|
||||
private String level = DEFAULT_LEVEL;
|
||||
|
|
|
@ -132,7 +132,7 @@ public final class IngestActionFilter extends AbstractComponent implements Actio
|
|||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
final static class BulkRequestModifier implements Iterator<ActionRequest<?>> {
|
||||
static final class BulkRequestModifier implements Iterator<ActionRequest<?>> {
|
||||
|
||||
final BulkRequest bulkRequest;
|
||||
final Set<Integer> failedSlots;
|
||||
|
@ -210,7 +210,7 @@ public final class IngestActionFilter extends AbstractComponent implements Actio
|
|||
|
||||
}
|
||||
|
||||
final static class IngestBulkResponseListener implements ActionListener<BulkResponse> {
|
||||
static final class IngestBulkResponseListener implements ActionListener<BulkResponse> {
|
||||
|
||||
private final long ingestTookInMillis;
|
||||
private final int[] originalSlots;
|
||||
|
|
|
@ -168,7 +168,7 @@ public class SearchResponse extends ActionResponse implements StatusToXContent {
|
|||
*
|
||||
* @return The profile results or an empty map
|
||||
*/
|
||||
public @Nullable Map<String, ProfileShardResult> getProfileResults() {
|
||||
@Nullable public Map<String, ProfileShardResult> getProfileResults() {
|
||||
return internalResponse.profile();
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ public class TransportMultiSearchAction extends HandledTransportAction<MultiSear
|
|||
});
|
||||
}
|
||||
|
||||
final static class SearchRequestSlot {
|
||||
static final class SearchRequestSlot {
|
||||
|
||||
final SearchRequest request;
|
||||
final int responseSlot;
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
*/
|
||||
public abstract class AbstractListenableActionFuture<T, L> extends AdapterActionFuture<T, L> implements ListenableActionFuture<T> {
|
||||
|
||||
private final static ESLogger logger = Loggers.getLogger(AbstractListenableActionFuture.class);
|
||||
private static final ESLogger logger = Loggers.getLogger(AbstractListenableActionFuture.class);
|
||||
|
||||
final ThreadPool threadPool;
|
||||
volatile Object listeners;
|
||||
|
|
|
@ -55,7 +55,7 @@ public interface ActionFilter {
|
|||
* filter chain. This base class should serve any action filter implementations that doesn't require
|
||||
* to apply async filtering logic.
|
||||
*/
|
||||
public static abstract class Simple extends AbstractComponent implements ActionFilter {
|
||||
public abstract static class Simple extends AbstractComponent implements ActionFilter {
|
||||
|
||||
protected Simple(Settings settings) {
|
||||
super(settings);
|
||||
|
|
|
@ -590,7 +590,7 @@ public abstract class TransportBroadcastByNodeAction<Request extends BroadcastRe
|
|||
* Can be used for implementations of {@link #shardOperation(BroadcastRequest, ShardRouting) shardOperation} for
|
||||
* which there is no shard-level return value.
|
||||
*/
|
||||
public final static class EmptyResult implements Streamable {
|
||||
public static final class EmptyResult implements Streamable {
|
||||
public static EmptyResult INSTANCE = new EmptyResult();
|
||||
|
||||
private EmptyResult() {
|
||||
|
|
|
@ -50,11 +50,11 @@ public class ReplicationOperation<
|
|||
ReplicaRequest extends ReplicationRequest<ReplicaRequest>,
|
||||
PrimaryResultT extends ReplicationOperation.PrimaryResult<ReplicaRequest>
|
||||
> {
|
||||
final private ESLogger logger;
|
||||
final private Request request;
|
||||
final private Supplier<ClusterState> clusterStateSupplier;
|
||||
final private String opType;
|
||||
final private AtomicInteger totalShards = new AtomicInteger();
|
||||
private final ESLogger logger;
|
||||
private final Request request;
|
||||
private final Supplier<ClusterState> clusterStateSupplier;
|
||||
private final String opType;
|
||||
private final AtomicInteger totalShards = new AtomicInteger();
|
||||
/**
|
||||
* The number of pending sub-operations in this operation. This is incremented when the following operations start and decremented when
|
||||
* they complete:
|
||||
|
@ -65,14 +65,14 @@ public class ReplicationOperation<
|
|||
* operations and the primary finishes.</li>
|
||||
* </ul>
|
||||
*/
|
||||
final private AtomicInteger pendingShards = new AtomicInteger();
|
||||
final private AtomicInteger successfulShards = new AtomicInteger();
|
||||
final private boolean executeOnReplicas;
|
||||
final private boolean checkWriteConsistency;
|
||||
final private Primary<Request, ReplicaRequest, PrimaryResultT> primary;
|
||||
final private Replicas<ReplicaRequest> replicasProxy;
|
||||
final private AtomicBoolean finished = new AtomicBoolean();
|
||||
final protected ActionListener<PrimaryResultT> resultListener;
|
||||
private final AtomicInteger pendingShards = new AtomicInteger();
|
||||
private final AtomicInteger successfulShards = new AtomicInteger();
|
||||
private final boolean executeOnReplicas;
|
||||
private final boolean checkWriteConsistency;
|
||||
private final Primary<Request, ReplicaRequest, PrimaryResultT> primary;
|
||||
private final Replicas<ReplicaRequest> replicasProxy;
|
||||
private final AtomicBoolean finished = new AtomicBoolean();
|
||||
protected final ActionListener<PrimaryResultT> resultListener;
|
||||
|
||||
private volatile PrimaryResultT primaryResult = null;
|
||||
|
||||
|
|
|
@ -124,9 +124,8 @@ public abstract class ReplicationRequest<Request extends ReplicationRequest<Requ
|
|||
* @return the shardId of the shard where this operation should be executed on.
|
||||
* can be null if the shardID has not yet been resolved
|
||||
*/
|
||||
public
|
||||
@Nullable
|
||||
ShardId shardId() {
|
||||
public ShardId shardId() {
|
||||
return shardId;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ import java.io.IOException;
|
|||
*/
|
||||
public class ReplicationResponse extends ActionResponse {
|
||||
|
||||
public final static ReplicationResponse.ShardInfo.Failure[] EMPTY = new ReplicationResponse.ShardInfo.Failure[0];
|
||||
public static final ReplicationResponse.ShardInfo.Failure[] EMPTY = new ReplicationResponse.ShardInfo.Failure[0];
|
||||
|
||||
private ShardInfo shardInfo;
|
||||
|
||||
|
|
|
@ -85,17 +85,17 @@ public abstract class TransportReplicationAction<
|
|||
Response extends ReplicationResponse
|
||||
> extends TransportAction<Request, Response> {
|
||||
|
||||
final protected TransportService transportService;
|
||||
final protected ClusterService clusterService;
|
||||
final protected IndicesService indicesService;
|
||||
final private ShardStateAction shardStateAction;
|
||||
final private WriteConsistencyLevel defaultWriteConsistencyLevel;
|
||||
final private TransportRequestOptions transportOptions;
|
||||
protected final TransportService transportService;
|
||||
protected final ClusterService clusterService;
|
||||
protected final IndicesService indicesService;
|
||||
private final ShardStateAction shardStateAction;
|
||||
private final WriteConsistencyLevel defaultWriteConsistencyLevel;
|
||||
private final TransportRequestOptions transportOptions;
|
||||
|
||||
// package private for testing
|
||||
final String transportReplicaAction;
|
||||
final String transportPrimaryAction;
|
||||
final private ReplicasProxy replicasProxy;
|
||||
private final ReplicasProxy replicasProxy;
|
||||
|
||||
protected TransportReplicationAction(Settings settings, String actionName, TransportService transportService,
|
||||
ClusterService clusterService, IndicesService indicesService,
|
||||
|
|
|
@ -205,7 +205,7 @@ public abstract class TransportInstanceSingleOperationAction<Request extends Ins
|
|||
});
|
||||
}
|
||||
|
||||
void retry(final @Nullable Throwable failure) {
|
||||
void retry(@Nullable final Throwable failure) {
|
||||
if (observer.isTimedOut()) {
|
||||
// we running as a last attempt after a timeout has happened. don't retry
|
||||
Throwable listenFailure = failure;
|
||||
|
|
|
@ -508,7 +508,7 @@ final class BootstrapCheck {
|
|||
|
||||
}
|
||||
|
||||
static abstract class MightForkCheck implements BootstrapCheck.Check {
|
||||
abstract static class MightForkCheck implements BootstrapCheck.Check {
|
||||
|
||||
@Override
|
||||
public boolean check() {
|
||||
|
|
|
@ -47,8 +47,8 @@ final class JNAKernel32Library {
|
|||
private List<NativeHandlerCallback> callbacks = new ArrayList<>();
|
||||
|
||||
// Native library instance must be kept around for the same reason.
|
||||
private final static class Holder {
|
||||
private final static JNAKernel32Library instance = new JNAKernel32Library();
|
||||
private static final class Holder {
|
||||
private static final JNAKernel32Library instance = new JNAKernel32Library();
|
||||
}
|
||||
|
||||
private JNAKernel32Library() {
|
||||
|
|
|
@ -62,7 +62,7 @@ public class JavaVersion implements Comparable<JavaVersion> {
|
|||
return value.matches("^0*[0-9]+(\\.[0-9]+)*$");
|
||||
}
|
||||
|
||||
private final static JavaVersion CURRENT = parse(System.getProperty("java.specification.version"));
|
||||
private static final JavaVersion CURRENT = parse(System.getProperty("java.specification.version"));
|
||||
|
||||
public static JavaVersion current() {
|
||||
return CURRENT;
|
||||
|
|
|
@ -115,7 +115,7 @@ public class ClusterState implements ToXContent, Diffable<ClusterState> {
|
|||
String type();
|
||||
}
|
||||
|
||||
private final static Map<String, Custom> customPrototypes = new HashMap<>();
|
||||
private static final Map<String, Custom> customPrototypes = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Register a custom index meta data factory. Make sure to call it from a static block.
|
||||
|
|
|
@ -274,7 +274,7 @@ public class ClusterStateObserver {
|
|||
}
|
||||
|
||||
|
||||
public static abstract class ValidationPredicate implements ChangePredicate {
|
||||
public abstract static class ValidationPredicate implements ChangePredicate {
|
||||
|
||||
@Override
|
||||
public boolean apply(ClusterState previousState, ClusterState.ClusterStateStatus previousStatus, ClusterState newState, ClusterState.ClusterStateStatus newStatus) {
|
||||
|
@ -289,7 +289,7 @@ public class ClusterStateObserver {
|
|||
}
|
||||
}
|
||||
|
||||
public static abstract class EventPredicate implements ChangePredicate {
|
||||
public abstract static class EventPredicate implements ChangePredicate {
|
||||
@Override
|
||||
public boolean apply(ClusterState previousState, ClusterState.ClusterStateStatus previousStatus, ClusterState newState, ClusterState.ClusterStateStatus newStatus) {
|
||||
return previousState != newState || previousStatus != newStatus;
|
||||
|
@ -298,8 +298,8 @@ public class ClusterStateObserver {
|
|||
}
|
||||
|
||||
static class ObservingContext {
|
||||
final public Listener listener;
|
||||
final public ChangePredicate changePredicate;
|
||||
public final Listener listener;
|
||||
public final ChangePredicate changePredicate;
|
||||
|
||||
public ObservingContext(Listener listener, ChangePredicate changePredicate) {
|
||||
this.listener = listener;
|
||||
|
@ -308,8 +308,8 @@ public class ClusterStateObserver {
|
|||
}
|
||||
|
||||
static class ObservedState {
|
||||
final public ClusterState clusterState;
|
||||
final public ClusterState.ClusterStateStatus status;
|
||||
public final ClusterState clusterState;
|
||||
public final ClusterState.ClusterStateStatus status;
|
||||
|
||||
public ObservedState(ClusterState clusterState) {
|
||||
this.clusterState = clusterState;
|
||||
|
@ -322,7 +322,7 @@ public class ClusterStateObserver {
|
|||
}
|
||||
}
|
||||
|
||||
private final static class ContextPreservingListener implements Listener {
|
||||
private static final class ContextPreservingListener implements Listener {
|
||||
private final Listener delegate;
|
||||
private final ThreadContext.StoredContext tempContext;
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ public interface ClusterStateTaskExecutor<T> {
|
|||
* @param <T> the type of the cluster state update task
|
||||
*/
|
||||
class BatchResult<T> {
|
||||
final public ClusterState resultingState;
|
||||
final public Map<T, TaskResult> executionResults;
|
||||
public final ClusterState resultingState;
|
||||
public final Map<T, TaskResult> executionResults;
|
||||
|
||||
/**
|
||||
* Construct an execution result instance with a correspondence between the tasks and their execution result
|
||||
|
|
|
@ -28,9 +28,9 @@ import java.util.List;
|
|||
/**
|
||||
* A task that can update the cluster state.
|
||||
*/
|
||||
abstract public class ClusterStateUpdateTask implements ClusterStateTaskConfig, ClusterStateTaskExecutor<ClusterStateUpdateTask>, ClusterStateTaskListener {
|
||||
public abstract class ClusterStateUpdateTask implements ClusterStateTaskConfig, ClusterStateTaskExecutor<ClusterStateUpdateTask>, ClusterStateTaskListener {
|
||||
|
||||
final private Priority priority;
|
||||
private final Priority priority;
|
||||
|
||||
public ClusterStateUpdateTask() {
|
||||
this(Priority.NORMAL);
|
||||
|
@ -41,7 +41,7 @@ abstract public class ClusterStateUpdateTask implements ClusterStateTaskConfig,
|
|||
}
|
||||
|
||||
@Override
|
||||
final public BatchResult<ClusterStateUpdateTask> execute(ClusterState currentState, List<ClusterStateUpdateTask> tasks) throws Exception {
|
||||
public final BatchResult<ClusterStateUpdateTask> execute(ClusterState currentState, List<ClusterStateUpdateTask> tasks) throws Exception {
|
||||
ClusterState result = execute(currentState);
|
||||
return BatchResult.<ClusterStateUpdateTask>builder().successes(tasks).build(result);
|
||||
}
|
||||
|
@ -50,12 +50,12 @@ abstract public class ClusterStateUpdateTask implements ClusterStateTaskConfig,
|
|||
* Update the cluster state based on the current state. Return the *same instance* if no state
|
||||
* should be changed.
|
||||
*/
|
||||
abstract public ClusterState execute(ClusterState currentState) throws Exception;
|
||||
public abstract ClusterState execute(ClusterState currentState) throws Exception;
|
||||
|
||||
/**
|
||||
* A callback called when execute fails.
|
||||
*/
|
||||
abstract public void onFailure(String source, Throwable t);
|
||||
public abstract void onFailure(String source, Throwable t);
|
||||
|
||||
/**
|
||||
* If the cluster state update task wasn't processed by the provided timeout, call
|
||||
|
|
|
@ -330,7 +330,7 @@ public final class DiffableUtils {
|
|||
* @param <T> the type of map values
|
||||
* @param <M> the map implementation type
|
||||
*/
|
||||
public static abstract class MapDiff<K, T, M> implements Diff<M> {
|
||||
public abstract static class MapDiff<K, T, M> implements Diff<M> {
|
||||
|
||||
protected final List<K> deletes;
|
||||
protected final Map<K, Diff<T>> diffs; // incremental updates
|
||||
|
@ -534,7 +534,7 @@ public final class DiffableUtils {
|
|||
* @param <K> type of map keys
|
||||
* @param <V> type of map values
|
||||
*/
|
||||
public static abstract class DiffableValueSerializer<K, V extends Diffable<V>> implements ValueSerializer<K, V> {
|
||||
public abstract static class DiffableValueSerializer<K, V extends Diffable<V>> implements ValueSerializer<K, V> {
|
||||
private static final DiffableValueSerializer WRITE_ONLY_INSTANCE = new DiffableValueSerializer() {
|
||||
@Override
|
||||
public Object read(StreamInput in, Object key) throws IOException {
|
||||
|
@ -577,7 +577,7 @@ public final class DiffableUtils {
|
|||
* @param <K> type of map keys
|
||||
* @param <V> type of map values
|
||||
*/
|
||||
public static abstract class NonDiffableValueSerializer<K, V> implements ValueSerializer<K, V> {
|
||||
public abstract static class NonDiffableValueSerializer<K, V> implements ValueSerializer<K, V> {
|
||||
@Override
|
||||
public boolean supportsDiffableValues() {
|
||||
return false;
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.elasticsearch.common.settings.Settings;
|
|||
* ClusterInfoService that provides empty maps for disk usage and shard sizes
|
||||
*/
|
||||
public class EmptyClusterInfoService extends AbstractComponent implements ClusterInfoService {
|
||||
public final static EmptyClusterInfoService INSTANCE = new EmptyClusterInfoService();
|
||||
public static final EmptyClusterInfoService INSTANCE = new EmptyClusterInfoService();
|
||||
|
||||
private EmptyClusterInfoService() {
|
||||
super(Settings.EMPTY);
|
||||
|
|
|
@ -57,7 +57,7 @@ public class NodeConnectionsService extends AbstractLifecycleComponent<NodeConne
|
|||
// if a node doesn't appear in this list it shouldn't be monitored
|
||||
private ConcurrentMap<DiscoveryNode, Integer> nodes = ConcurrentCollections.newConcurrentMap();
|
||||
|
||||
final private KeyedLock<DiscoveryNode> nodeLocks = new KeyedLock<>();
|
||||
private final KeyedLock<DiscoveryNode> nodeLocks = new KeyedLock<>();
|
||||
|
||||
private final TimeValue reconnectInterval;
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ import java.util.function.BiFunction;
|
|||
* tombstones remain in the cluster state for a fixed period of time, after which
|
||||
* they are purged.
|
||||
*/
|
||||
final public class IndexGraveyard implements MetaData.Custom {
|
||||
public final class IndexGraveyard implements MetaData.Custom {
|
||||
|
||||
/**
|
||||
* Setting for the maximum tombstones allowed in the cluster state;
|
||||
|
@ -188,7 +188,7 @@ final public class IndexGraveyard implements MetaData.Custom {
|
|||
/**
|
||||
* A class to build an IndexGraveyard.
|
||||
*/
|
||||
final public static class Builder {
|
||||
public static final class Builder {
|
||||
private List<Tombstone> tombstones;
|
||||
private int numPurged = -1;
|
||||
private final long currentTime = System.currentTimeMillis();
|
||||
|
@ -273,7 +273,7 @@ final public class IndexGraveyard implements MetaData.Custom {
|
|||
/**
|
||||
* A class representing a diff of two IndexGraveyard objects.
|
||||
*/
|
||||
final public static class IndexGraveyardDiff implements Diff<MetaData.Custom> {
|
||||
public static final class IndexGraveyardDiff implements Diff<MetaData.Custom> {
|
||||
|
||||
private final List<Tombstone> added;
|
||||
private final int removedCount;
|
||||
|
@ -354,7 +354,7 @@ final public class IndexGraveyard implements MetaData.Custom {
|
|||
/**
|
||||
* An individual tombstone entry for representing a deleted index.
|
||||
*/
|
||||
final public static class Tombstone implements ToXContent, Writeable {
|
||||
public static final class Tombstone implements ToXContent, Writeable {
|
||||
|
||||
private static final String INDEX_KEY = "index";
|
||||
private static final String DELETE_DATE_IN_MILLIS_KEY = "delete_date_in_millis";
|
||||
|
@ -449,7 +449,7 @@ final public class IndexGraveyard implements MetaData.Custom {
|
|||
/**
|
||||
* A builder for building tombstone entries.
|
||||
*/
|
||||
final private static class Builder {
|
||||
private static final class Builder {
|
||||
private Index index;
|
||||
private long deleteDateInMillis = -1L;
|
||||
|
||||
|
|
|
@ -255,7 +255,7 @@ public class IndexMetaData implements Diffable<IndexMetaData>, FromXContentBuild
|
|||
|
||||
private final ImmutableOpenIntMap<Set<String>> activeAllocationIds;
|
||||
|
||||
private transient final int totalNumberOfShards;
|
||||
private final transient int totalNumberOfShards;
|
||||
|
||||
private final DiscoveryNodeFilters requireFilters;
|
||||
private final DiscoveryNodeFilters includeFilters;
|
||||
|
|
|
@ -488,7 +488,7 @@ public class IndexNameExpressionResolver extends AbstractComponent {
|
|||
return false;
|
||||
}
|
||||
|
||||
final static class Context {
|
||||
static final class Context {
|
||||
|
||||
private final ClusterState state;
|
||||
private final IndicesOptions options;
|
||||
|
@ -551,7 +551,7 @@ public class IndexNameExpressionResolver extends AbstractComponent {
|
|||
/**
|
||||
* Resolves alias/index name expressions with wildcards into the corresponding concrete indices/aliases
|
||||
*/
|
||||
final static class WildcardExpressionResolver implements ExpressionResolver {
|
||||
static final class WildcardExpressionResolver implements ExpressionResolver {
|
||||
|
||||
@Override
|
||||
public List<String> resolve(Context context, List<String> expressions) {
|
||||
|
@ -738,7 +738,7 @@ public class IndexNameExpressionResolver extends AbstractComponent {
|
|||
}
|
||||
}
|
||||
|
||||
final static class DateMathExpressionResolver implements ExpressionResolver {
|
||||
static final class DateMathExpressionResolver implements ExpressionResolver {
|
||||
|
||||
private static final String EXPRESSION_LEFT_BOUND = "<";
|
||||
private static final String EXPRESSION_RIGHT_BOUND = ">";
|
||||
|
|
|
@ -1187,7 +1187,7 @@ public class MetaData implements Iterable<IndexMetaData>, Diffable<MetaData>, Fr
|
|||
}
|
||||
}
|
||||
|
||||
private final static ToXContent.Params FORMAT_PARAMS;
|
||||
private static final ToXContent.Params FORMAT_PARAMS;
|
||||
static {
|
||||
Map<String, String> params = new HashMap<>(2);
|
||||
params.put("binary", "true");
|
||||
|
@ -1198,7 +1198,7 @@ public class MetaData implements Iterable<IndexMetaData>, Diffable<MetaData>, Fr
|
|||
/**
|
||||
* State format for {@link MetaData} to write to and load from disk
|
||||
*/
|
||||
public final static MetaDataStateFormat<MetaData> FORMAT = new MetaDataStateFormat<MetaData>(XContentType.SMILE, GLOBAL_STATE_FILE_PREFIX) {
|
||||
public static final MetaDataStateFormat<MetaData> FORMAT = new MetaDataStateFormat<MetaData>(XContentType.SMILE, GLOBAL_STATE_FILE_PREFIX) {
|
||||
|
||||
@Override
|
||||
public void toXContent(XContentBuilder builder, MetaData state) throws IOException {
|
||||
|
|
|
@ -97,7 +97,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_VERSION_C
|
|||
*/
|
||||
public class MetaDataCreateIndexService extends AbstractComponent {
|
||||
|
||||
public final static int MAX_INDEX_NAME_BYTES = 255;
|
||||
public static final int MAX_INDEX_NAME_BYTES = 255;
|
||||
private static final DefaultIndexTemplateFilter DEFAULT_INDEX_TEMPLATE_FILTER = new DefaultIndexTemplateFilter();
|
||||
|
||||
private final ClusterService clusterService;
|
||||
|
|
|
@ -60,7 +60,7 @@ public class IndexShardRoutingTable implements Iterable<ShardRouting> {
|
|||
final List<ShardRouting> shards;
|
||||
final List<ShardRouting> activeShards;
|
||||
final List<ShardRouting> assignedShards;
|
||||
final static List<ShardRouting> NO_SHARDS = Collections.emptyList();
|
||||
static final List<ShardRouting> NO_SHARDS = Collections.emptyList();
|
||||
final boolean allShardsStarted;
|
||||
|
||||
private volatile Map<AttributesKey, AttributesRoutings> activeShardsByAttributes = emptyMap();
|
||||
|
|
|
@ -80,7 +80,8 @@ public class RoutingNode implements Iterable<ShardRouting> {
|
|||
return this.node;
|
||||
}
|
||||
|
||||
public @Nullable ShardRouting getByShardId(ShardId id) {
|
||||
@Nullable
|
||||
public ShardRouting getByShardId(ShardId id) {
|
||||
return shards.get(id);
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public abstract class AbstractAllocateAllocationCommand implements AllocationCom
|
|||
/**
|
||||
* Works around ObjectParser not supporting constructor arguments.
|
||||
*/
|
||||
protected static abstract class Builder<T extends AbstractAllocateAllocationCommand> {
|
||||
protected abstract static class Builder<T extends AbstractAllocateAllocationCommand> {
|
||||
protected String index;
|
||||
protected int shard = -1;
|
||||
protected String node;
|
||||
|
|
|
@ -71,7 +71,7 @@ public abstract class BasePrimaryAllocationCommand extends AbstractAllocateAlloc
|
|||
return acceptDataLoss;
|
||||
}
|
||||
|
||||
protected static abstract class Builder<T extends BasePrimaryAllocationCommand> extends AbstractAllocateAllocationCommand.Builder<T> {
|
||||
protected abstract static class Builder<T extends BasePrimaryAllocationCommand> extends AbstractAllocateAllocationCommand.Builder<T> {
|
||||
protected boolean acceptDataLoss;
|
||||
|
||||
public void setAcceptDataLoss(boolean acceptDataLoss) {
|
||||
|
|
|
@ -154,17 +154,17 @@ public class ClusterService extends AbstractLifecycleComponent<ClusterService> {
|
|||
this.slowTaskLoggingThreshold = slowTaskLoggingThreshold;
|
||||
}
|
||||
|
||||
synchronized public void setClusterStatePublisher(BiConsumer<ClusterChangedEvent, Discovery.AckListener> publisher) {
|
||||
public synchronized void setClusterStatePublisher(BiConsumer<ClusterChangedEvent, Discovery.AckListener> publisher) {
|
||||
clusterStatePublisher = publisher;
|
||||
}
|
||||
|
||||
synchronized public void setLocalNode(DiscoveryNode localNode) {
|
||||
public synchronized void setLocalNode(DiscoveryNode localNode) {
|
||||
assert clusterState.nodes().getLocalNodeId() == null : "local node is already set";
|
||||
DiscoveryNodes.Builder nodeBuilder = DiscoveryNodes.builder(clusterState.nodes()).put(localNode).localNodeId(localNode.getId());
|
||||
this.clusterState = ClusterState.builder(clusterState).nodes(nodeBuilder).build();
|
||||
}
|
||||
|
||||
synchronized public void setNodeConnectionsService(NodeConnectionsService nodeConnectionsService) {
|
||||
public synchronized void setNodeConnectionsService(NodeConnectionsService nodeConnectionsService) {
|
||||
assert this.nodeConnectionsService == null : "nodeConnectionsService is already set";
|
||||
this.nodeConnectionsService = nodeConnectionsService;
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ public class ClusterService extends AbstractLifecycleComponent<ClusterService> {
|
|||
/**
|
||||
* Adds an initial block to be set on the first cluster state created.
|
||||
*/
|
||||
synchronized public void addInitialStateBlock(ClusterBlock block) throws IllegalStateException {
|
||||
public synchronized void addInitialStateBlock(ClusterBlock block) throws IllegalStateException {
|
||||
if (lifecycle.started()) {
|
||||
throw new IllegalStateException("can't set initial block when started");
|
||||
}
|
||||
|
@ -182,14 +182,14 @@ public class ClusterService extends AbstractLifecycleComponent<ClusterService> {
|
|||
/**
|
||||
* Remove an initial block to be set on the first cluster state created.
|
||||
*/
|
||||
synchronized public void removeInitialStateBlock(ClusterBlock block) throws IllegalStateException {
|
||||
public synchronized void removeInitialStateBlock(ClusterBlock block) throws IllegalStateException {
|
||||
removeInitialStateBlock(block.id());
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an initial block to be set on the first cluster state created.
|
||||
*/
|
||||
synchronized public void removeInitialStateBlock(int blockId) throws IllegalStateException {
|
||||
public synchronized void removeInitialStateBlock(int blockId) throws IllegalStateException {
|
||||
if (lifecycle.started()) {
|
||||
throw new IllegalStateException("can't set initial block when started");
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ public class ClusterService extends AbstractLifecycleComponent<ClusterService> {
|
|||
}
|
||||
|
||||
@Override
|
||||
synchronized protected void doStart() {
|
||||
protected synchronized void doStart() {
|
||||
Objects.requireNonNull(clusterStatePublisher, "please set a cluster state publisher before starting");
|
||||
Objects.requireNonNull(clusterState.nodes().getLocalNode(), "please set the local node before starting");
|
||||
Objects.requireNonNull(nodeConnectionsService, "please set the node connection service before starting");
|
||||
|
@ -209,7 +209,7 @@ public class ClusterService extends AbstractLifecycleComponent<ClusterService> {
|
|||
}
|
||||
|
||||
@Override
|
||||
synchronized protected void doStop() {
|
||||
protected synchronized void doStop() {
|
||||
for (NotifyTimeout onGoingTimeout : onGoingTimeouts) {
|
||||
onGoingTimeout.cancel();
|
||||
try {
|
||||
|
@ -230,7 +230,7 @@ public class ClusterService extends AbstractLifecycleComponent<ClusterService> {
|
|||
}
|
||||
|
||||
@Override
|
||||
synchronized protected void doClose() {
|
||||
protected synchronized void doClose() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -497,7 +497,7 @@ public class ClusterService extends AbstractLifecycleComponent<ClusterService> {
|
|||
return clusterName;
|
||||
}
|
||||
|
||||
static abstract class SourcePrioritizedRunnable extends PrioritizedRunnable {
|
||||
abstract static class SourcePrioritizedRunnable extends PrioritizedRunnable {
|
||||
protected final String source;
|
||||
|
||||
public SourcePrioritizedRunnable(Priority priority, String source) {
|
||||
|
@ -959,7 +959,7 @@ public class ClusterService extends AbstractLifecycleComponent<ClusterService> {
|
|||
|
||||
private static class DelegetingAckListener implements Discovery.AckListener {
|
||||
|
||||
final private List<Discovery.AckListener> listeners;
|
||||
private final List<Discovery.AckListener> listeners;
|
||||
|
||||
private DelegetingAckListener(List<Discovery.AckListener> listeners) {
|
||||
this.listeners = listeners;
|
||||
|
|
|
@ -75,7 +75,7 @@ public final class CopyOnWriteHashMap<K, V> extends AbstractMap<K, V> {
|
|||
/**
|
||||
* Abstraction of a node, implemented by both inner and leaf nodes.
|
||||
*/
|
||||
private static abstract class Node<K, V> {
|
||||
private abstract static class Node<K, V> {
|
||||
|
||||
/**
|
||||
* Recursively get the key with the given hash.
|
||||
|
|
|
@ -132,8 +132,8 @@ public final class HppcMaps {
|
|||
};
|
||||
}
|
||||
|
||||
public final static class Object {
|
||||
public final static class Integer {
|
||||
public static final class Object {
|
||||
public static final class Integer {
|
||||
public static <V> ObjectIntHashMap<V> ensureNoNullKeys(int capacity, float loadFactor) {
|
||||
return new ObjectIntHashMap<V>(capacity, loadFactor) {
|
||||
@Override
|
||||
|
|
|
@ -350,7 +350,7 @@ public enum GeoDistance implements Writeable {
|
|||
* Basic implementation of {@link FixedSourceDistance}. This class keeps the basic parameters for a distance
|
||||
* functions based on a fixed source. Namely latitude, longitude and unit.
|
||||
*/
|
||||
public static abstract class FixedSourceDistanceBase implements FixedSourceDistance {
|
||||
public abstract static class FixedSourceDistanceBase implements FixedSourceDistance {
|
||||
protected final double sourceLatitude;
|
||||
protected final double sourceLongitude;
|
||||
protected final DistanceUnit unit;
|
||||
|
|
|
@ -195,7 +195,7 @@ public class GeoHashUtils {
|
|||
* @param dy delta of the second grid coordinate (must be -1, 0 or +1)
|
||||
* @return geohash of the defined cell
|
||||
*/
|
||||
public final static String neighbor(String geohash, int level, int dx, int dy) {
|
||||
public static final String neighbor(String geohash, int level, int dx, int dy) {
|
||||
int cell = BASE_32_STRING.indexOf(geohash.charAt(level -1));
|
||||
|
||||
// Decoding the Geohash bit pattern to determine grid coordinates
|
||||
|
|
|
@ -551,7 +551,7 @@ public final class Errors {
|
|||
return root.errors == null ? 0 : root.errors.size();
|
||||
}
|
||||
|
||||
private static abstract class Converter<T> {
|
||||
private abstract static class Converter<T> {
|
||||
|
||||
final Class<T> type;
|
||||
|
||||
|
|
|
@ -408,7 +408,7 @@ public abstract class StreamOutput extends OutputStream {
|
|||
void write(StreamOutput o, Object value) throws IOException;
|
||||
}
|
||||
|
||||
private final static Map<Class<?>, Writer> WRITERS;
|
||||
private static final Map<Class<?>, Writer> WRITERS;
|
||||
|
||||
static {
|
||||
Map<Class<?>, Writer> writers = new HashMap<>();
|
||||
|
|
|
@ -38,7 +38,7 @@ import static org.elasticsearch.common.util.CollectionUtils.asArrayList;
|
|||
*/
|
||||
public class Loggers {
|
||||
|
||||
private final static String commonPrefix = System.getProperty("es.logger.prefix", "org.elasticsearch.");
|
||||
private static final String commonPrefix = System.getProperty("es.logger.prefix", "org.elasticsearch.");
|
||||
|
||||
public static final String SPACE = " ";
|
||||
|
||||
|
|
|
@ -245,14 +245,14 @@ public class Lucene {
|
|||
/**
|
||||
* Wraps <code>delegate</code> with count based early termination collector with a threshold of <code>maxCountHits</code>
|
||||
*/
|
||||
public final static EarlyTerminatingCollector wrapCountBasedEarlyTerminatingCollector(final Collector delegate, int maxCountHits) {
|
||||
public static final EarlyTerminatingCollector wrapCountBasedEarlyTerminatingCollector(final Collector delegate, int maxCountHits) {
|
||||
return new EarlyTerminatingCollector(delegate, maxCountHits);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps <code>delegate</code> with a time limited collector with a timeout of <code>timeoutInMillis</code>
|
||||
*/
|
||||
public final static TimeLimitingCollector wrapTimeLimitingCollector(final Collector delegate, final Counter counter, long timeoutInMillis) {
|
||||
public static final TimeLimitingCollector wrapTimeLimitingCollector(final Collector delegate, final Counter counter, long timeoutInMillis) {
|
||||
return new TimeLimitingCollector(delegate, counter, timeoutInMillis);
|
||||
}
|
||||
|
||||
|
@ -510,7 +510,7 @@ public class Lucene {
|
|||
* This exception is thrown when {@link org.elasticsearch.common.lucene.Lucene.EarlyTerminatingCollector}
|
||||
* reaches early termination
|
||||
* */
|
||||
public final static class EarlyTerminationException extends ElasticsearchException {
|
||||
public static final class EarlyTerminationException extends ElasticsearchException {
|
||||
|
||||
public EarlyTerminationException(String msg) {
|
||||
super(msg);
|
||||
|
@ -525,7 +525,7 @@ public class Lucene {
|
|||
* A collector that terminates early by throwing {@link org.elasticsearch.common.lucene.Lucene.EarlyTerminationException}
|
||||
* when count of matched documents has reached <code>maxCountHits</code>
|
||||
*/
|
||||
public final static class EarlyTerminatingCollector extends SimpleCollector {
|
||||
public static final class EarlyTerminatingCollector extends SimpleCollector {
|
||||
|
||||
private final int maxCountHits;
|
||||
private final Collector delegate;
|
||||
|
|
|
@ -66,7 +66,7 @@ public final class ElasticsearchDirectoryReader extends FilterDirectoryReader {
|
|||
return new ElasticsearchDirectoryReader(reader, new SubReaderWrapper(shardId), shardId);
|
||||
}
|
||||
|
||||
private final static class SubReaderWrapper extends FilterDirectoryReader.SubReaderWrapper {
|
||||
private static final class SubReaderWrapper extends FilterDirectoryReader.SubReaderWrapper {
|
||||
private final ShardId shardId;
|
||||
SubReaderWrapper(ShardId shardId) {
|
||||
this.shardId = shardId;
|
||||
|
|
|
@ -60,7 +60,7 @@ public class FilterableTermsEnum extends TermsEnum {
|
|||
}
|
||||
|
||||
static final String UNSUPPORTED_MESSAGE = "This TermsEnum only supports #seekExact(BytesRef) as well as #docFreq() and #totalTermFreq()";
|
||||
protected final static int NOT_FOUND = -1;
|
||||
protected static final int NOT_FOUND = -1;
|
||||
private final Holder[] enums;
|
||||
protected int currentDocFreq = 0;
|
||||
protected long currentTotalTermFreq = 0;
|
||||
|
|
|
@ -102,7 +102,7 @@ public class FiltersFunctionScoreQuery extends Query {
|
|||
final float maxBoost;
|
||||
private final Float minScore;
|
||||
|
||||
final protected CombineFunction combineFunction;
|
||||
protected final CombineFunction combineFunction;
|
||||
|
||||
public FiltersFunctionScoreQuery(Query subQuery, ScoreMode scoreMode, FilterFunction[] filterFunctions, float maxBoost, Float minScore, CombineFunction combineFunction) {
|
||||
this.subQuery = subQuery;
|
||||
|
|
|
@ -76,7 +76,7 @@ public abstract class Rounding implements Streamable {
|
|||
*/
|
||||
public static class Interval extends Rounding {
|
||||
|
||||
final static byte ID = 0;
|
||||
static final byte ID = 0;
|
||||
|
||||
public static final ParseField INTERVAL_FIELD = new ParseField("interval");
|
||||
|
||||
|
@ -157,7 +157,7 @@ public abstract class Rounding implements Streamable {
|
|||
|
||||
public static class FactorRounding extends Rounding {
|
||||
|
||||
final static byte ID = 7;
|
||||
static final byte ID = 7;
|
||||
|
||||
public static final ParseField FACTOR_FIELD = new ParseField("factor");
|
||||
|
||||
|
@ -226,7 +226,7 @@ public abstract class Rounding implements Streamable {
|
|||
|
||||
public static class OffsetRounding extends Rounding {
|
||||
|
||||
final static byte ID = 8;
|
||||
static final byte ID = 8;
|
||||
|
||||
public static final ParseField OFFSET_FIELD = new ParseField("offset");
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ public abstract class TimeZoneRounding extends Rounding {
|
|||
|
||||
static class TimeIntervalRounding extends TimeZoneRounding {
|
||||
|
||||
final static byte ID = 2;
|
||||
static final byte ID = 2;
|
||||
|
||||
private long interval;
|
||||
private DateTimeZone timeZone;
|
||||
|
|
|
@ -89,7 +89,7 @@ public class BigArrays implements Releasable {
|
|||
recycler.close();
|
||||
}
|
||||
|
||||
private static abstract class AbstractArrayWrapper extends AbstractArray implements BigArray {
|
||||
private abstract static class AbstractArrayWrapper extends AbstractArray implements BigArray {
|
||||
|
||||
protected static final long SHALLOW_SIZE = RamUsageEstimator.shallowSizeOfInstance(ByteArrayWrapper.class);
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ public abstract class ExtensionPoint {
|
|||
/**
|
||||
* A set based extension point which allows to register extended classes that might be used to chain additional functionality etc.
|
||||
*/
|
||||
public final static class ClassSet<T> extends ExtensionPoint {
|
||||
public static final class ClassSet<T> extends ExtensionPoint {
|
||||
protected final Class<T> extensionClass;
|
||||
private final Set<Class<? extends T>> extensions = new HashSet<>();
|
||||
|
||||
|
@ -205,7 +205,7 @@ public abstract class ExtensionPoint {
|
|||
* A an instance of a map, mapping one instance value to another. Both key and value are instances, not classes
|
||||
* like with other extension points.
|
||||
*/
|
||||
public final static class InstanceMap<K, V> extends ExtensionPoint {
|
||||
public static final class InstanceMap<K, V> extends ExtensionPoint {
|
||||
private final Map<K, V> map = new HashMap<>();
|
||||
private final Class<K> keyType;
|
||||
private final Class<V> valueType;
|
||||
|
|
|
@ -110,7 +110,7 @@ public class KeyedLock<T> {
|
|||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private final static class KeyLock extends ReentrantLock {
|
||||
private static final class KeyLock extends ReentrantLock {
|
||||
KeyLock(boolean fair) {
|
||||
super(fair);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ import org.joda.time.format.ISODateTimeFormat;
|
|||
*/
|
||||
public final class XContentBuilder implements BytesStream, Releasable {
|
||||
|
||||
public final static DateTimeFormatter defaultDatePrinter = ISODateTimeFormat.dateTime().withZone(DateTimeZone.UTC);
|
||||
public static final DateTimeFormatter defaultDatePrinter = ISODateTimeFormat.dateTime().withZone(DateTimeZone.UTC);
|
||||
|
||||
public static XContentBuilder builder(XContent xContent) throws IOException {
|
||||
return new XContentBuilder(xContent, new BytesStreamOutput());
|
||||
|
@ -809,7 +809,7 @@ public final class XContentBuilder implements BytesStream, Releasable {
|
|||
void write(XContentGenerator g, Object v) throws IOException;
|
||||
}
|
||||
|
||||
private final static Map<Class<?>, Writer> MAP;
|
||||
private static final Map<Class<?>, Writer> MAP;
|
||||
|
||||
static {
|
||||
Map<Class<?>, Writer> map = new HashMap<>();
|
||||
|
|
|
@ -45,8 +45,8 @@ public class CborXContent implements XContent {
|
|||
return XContentBuilder.builder(cborXContent);
|
||||
}
|
||||
|
||||
final static CBORFactory cborFactory;
|
||||
public final static CborXContent cborXContent;
|
||||
static final CBORFactory cborFactory;
|
||||
public static final CborXContent cborXContent;
|
||||
|
||||
static {
|
||||
cborFactory = new CBORFactory();
|
||||
|
|
|
@ -45,10 +45,10 @@ public class JsonXContent implements XContent {
|
|||
return XContentBuilder.builder(jsonXContent);
|
||||
}
|
||||
|
||||
private final static JsonFactory jsonFactory;
|
||||
public final static String JSON_ALLOW_UNQUOTED_FIELD_NAMES = "elasticsearch.json.allow_unquoted_field_names";
|
||||
public final static JsonXContent jsonXContent;
|
||||
public final static boolean unquotedFieldNamesSet;
|
||||
private static final JsonFactory jsonFactory;
|
||||
public static final String JSON_ALLOW_UNQUOTED_FIELD_NAMES = "elasticsearch.json.allow_unquoted_field_names";
|
||||
public static final JsonXContent jsonXContent;
|
||||
public static final boolean unquotedFieldNamesSet;
|
||||
|
||||
static {
|
||||
jsonFactory = new JsonFactory();
|
||||
|
|
|
@ -45,8 +45,8 @@ public class SmileXContent implements XContent {
|
|||
return XContentBuilder.builder(smileXContent);
|
||||
}
|
||||
|
||||
final static SmileFactory smileFactory;
|
||||
public final static SmileXContent smileXContent;
|
||||
static final SmileFactory smileFactory;
|
||||
public static final SmileXContent smileXContent;
|
||||
|
||||
static {
|
||||
smileFactory = new SmileFactory();
|
||||
|
|
|
@ -44,8 +44,8 @@ public class YamlXContent implements XContent {
|
|||
return XContentBuilder.builder(yamlXContent);
|
||||
}
|
||||
|
||||
final static YAMLFactory yamlFactory;
|
||||
public final static YamlXContent yamlXContent;
|
||||
static final YAMLFactory yamlFactory;
|
||||
public static final YamlXContent yamlXContent;
|
||||
|
||||
static {
|
||||
yamlFactory = new YAMLFactory();
|
||||
|
|
|
@ -36,9 +36,9 @@ import java.util.EnumSet;
|
|||
*/
|
||||
public class DiscoverySettings extends AbstractComponent {
|
||||
|
||||
public final static int NO_MASTER_BLOCK_ID = 2;
|
||||
public final static ClusterBlock NO_MASTER_BLOCK_ALL = new ClusterBlock(NO_MASTER_BLOCK_ID, "no master", true, true, RestStatus.SERVICE_UNAVAILABLE, ClusterBlockLevel.ALL);
|
||||
public final static ClusterBlock NO_MASTER_BLOCK_WRITES = new ClusterBlock(NO_MASTER_BLOCK_ID, "no master", true, false, RestStatus.SERVICE_UNAVAILABLE, EnumSet.of(ClusterBlockLevel.WRITE, ClusterBlockLevel.METADATA_WRITE));
|
||||
public static final int NO_MASTER_BLOCK_ID = 2;
|
||||
public static final ClusterBlock NO_MASTER_BLOCK_ALL = new ClusterBlock(NO_MASTER_BLOCK_ID, "no master", true, true, RestStatus.SERVICE_UNAVAILABLE, ClusterBlockLevel.ALL);
|
||||
public static final ClusterBlock NO_MASTER_BLOCK_WRITES = new ClusterBlock(NO_MASTER_BLOCK_ID, "no master", true, false, RestStatus.SERVICE_UNAVAILABLE, EnumSet.of(ClusterBlockLevel.WRITE, ClusterBlockLevel.METADATA_WRITE));
|
||||
/**
|
||||
* sets the timeout for a complete publishing cycle, including both sending and committing. the master
|
||||
* will continue to process the next cluster state update after this time has elapsed
|
||||
|
|
|
@ -344,7 +344,7 @@ public class NodeJoinController extends AbstractComponent {
|
|||
|
||||
static class JoinTaskListener implements ClusterStateTaskListener {
|
||||
final List<MembershipAction.JoinCallback> callbacks;
|
||||
final private ESLogger logger;
|
||||
private final ESLogger logger;
|
||||
|
||||
JoinTaskListener(MembershipAction.JoinCallback callback, ESLogger logger) {
|
||||
this(Collections.singletonList(callback), logger);
|
||||
|
@ -379,12 +379,12 @@ public class NodeJoinController extends AbstractComponent {
|
|||
}
|
||||
|
||||
// a task indicated that the current node should become master, if no current master is known
|
||||
private final static DiscoveryNode BECOME_MASTER_TASK = new DiscoveryNode("_BECOME_MASTER_TASK_", DummyTransportAddress.INSTANCE,
|
||||
private static final DiscoveryNode BECOME_MASTER_TASK = new DiscoveryNode("_BECOME_MASTER_TASK_", DummyTransportAddress.INSTANCE,
|
||||
Collections.emptyMap(), Collections.emptySet(), Version.CURRENT);
|
||||
|
||||
// a task that is used to process pending joins without explicitly becoming a master and listening to the results
|
||||
// this task is used when election is stop without the local node becoming a master per se (though it might
|
||||
private final static DiscoveryNode FINISH_ELECTION_NOT_MASTER_TASK = new DiscoveryNode("_NOT_MASTER_TASK_",
|
||||
private static final DiscoveryNode FINISH_ELECTION_NOT_MASTER_TASK = new DiscoveryNode("_NOT_MASTER_TASK_",
|
||||
DummyTransportAddress.INSTANCE, Collections.emptyMap(), Collections.emptySet(), Version.CURRENT);
|
||||
|
||||
class JoinTaskExecutor implements ClusterStateTaskExecutor<DiscoveryNode> {
|
||||
|
|
|
@ -88,25 +88,25 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;
|
|||
*/
|
||||
public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implements Discovery, PingContextProvider {
|
||||
|
||||
public final static Setting<TimeValue> PING_TIMEOUT_SETTING =
|
||||
public static final Setting<TimeValue> PING_TIMEOUT_SETTING =
|
||||
Setting.positiveTimeSetting("discovery.zen.ping_timeout", timeValueSeconds(3), Property.NodeScope);
|
||||
public final static Setting<TimeValue> JOIN_TIMEOUT_SETTING =
|
||||
public static final Setting<TimeValue> JOIN_TIMEOUT_SETTING =
|
||||
Setting.timeSetting("discovery.zen.join_timeout",
|
||||
settings -> TimeValue.timeValueMillis(PING_TIMEOUT_SETTING.get(settings).millis() * 20).toString(),
|
||||
TimeValue.timeValueMillis(0), Property.NodeScope);
|
||||
public final static Setting<Integer> JOIN_RETRY_ATTEMPTS_SETTING =
|
||||
public static final Setting<Integer> JOIN_RETRY_ATTEMPTS_SETTING =
|
||||
Setting.intSetting("discovery.zen.join_retry_attempts", 3, 1, Property.NodeScope);
|
||||
public final static Setting<TimeValue> JOIN_RETRY_DELAY_SETTING =
|
||||
public static final Setting<TimeValue> JOIN_RETRY_DELAY_SETTING =
|
||||
Setting.positiveTimeSetting("discovery.zen.join_retry_delay", TimeValue.timeValueMillis(100), Property.NodeScope);
|
||||
public final static Setting<Integer> MAX_PINGS_FROM_ANOTHER_MASTER_SETTING =
|
||||
public static final Setting<Integer> MAX_PINGS_FROM_ANOTHER_MASTER_SETTING =
|
||||
Setting.intSetting("discovery.zen.max_pings_from_another_master", 3, 1, Property.NodeScope);
|
||||
public final static Setting<Boolean> SEND_LEAVE_REQUEST_SETTING =
|
||||
public static final Setting<Boolean> SEND_LEAVE_REQUEST_SETTING =
|
||||
Setting.boolSetting("discovery.zen.send_leave_request", true, Property.NodeScope);
|
||||
public final static Setting<TimeValue> MASTER_ELECTION_WAIT_FOR_JOINS_TIMEOUT_SETTING =
|
||||
public static final Setting<TimeValue> MASTER_ELECTION_WAIT_FOR_JOINS_TIMEOUT_SETTING =
|
||||
Setting.timeSetting("discovery.zen.master_election.wait_for_joins_timeout",
|
||||
settings -> TimeValue.timeValueMillis(JOIN_TIMEOUT_SETTING.get(settings).millis() / 2).toString(), TimeValue.timeValueMillis(0),
|
||||
Property.NodeScope);
|
||||
public final static Setting<Boolean> MASTER_ELECTION_IGNORE_NON_MASTER_PINGS_SETTING =
|
||||
public static final Setting<Boolean> MASTER_ELECTION_IGNORE_NON_MASTER_PINGS_SETTING =
|
||||
Setting.boolSetting("discovery.zen.master_election.ignore_non_master_pings", false, Property.NodeScope);
|
||||
|
||||
public static final String DISCOVERY_REJOIN_ACTION_NAME = "internal:discovery/zen/rejoin";
|
||||
|
|
|
@ -543,11 +543,11 @@ public class PublishClusterStateAction extends AbstractComponent {
|
|||
}
|
||||
}
|
||||
|
||||
synchronized public boolean isCommitted() {
|
||||
public synchronized boolean isCommitted() {
|
||||
return committed;
|
||||
}
|
||||
|
||||
synchronized public void onNodeSendAck(DiscoveryNode node) {
|
||||
public synchronized void onNodeSendAck(DiscoveryNode node) {
|
||||
if (committed) {
|
||||
assert sendAckedBeforeCommit.isEmpty();
|
||||
sendCommitToNode(node, clusterState, this);
|
||||
|
@ -570,7 +570,7 @@ public class PublishClusterStateAction extends AbstractComponent {
|
|||
* check if enough master node responded to commit the change. fails the commit
|
||||
* if there are no more pending master nodes but not enough acks to commit.
|
||||
*/
|
||||
synchronized private void checkForCommitOrFailIfNoPending(DiscoveryNode masterNode) {
|
||||
private synchronized void checkForCommitOrFailIfNoPending(DiscoveryNode masterNode) {
|
||||
logger.trace("master node {} acked cluster state version [{}]. processing ... (current pending [{}], needed [{}])",
|
||||
masterNode, clusterState.version(), pendingMasterNodes, neededMastersToCommit);
|
||||
neededMastersToCommit--;
|
||||
|
@ -585,14 +585,14 @@ public class PublishClusterStateAction extends AbstractComponent {
|
|||
decrementPendingMasterAcksAndChangeForFailure();
|
||||
}
|
||||
|
||||
synchronized private void decrementPendingMasterAcksAndChangeForFailure() {
|
||||
private synchronized void decrementPendingMasterAcksAndChangeForFailure() {
|
||||
pendingMasterNodes--;
|
||||
if (pendingMasterNodes == 0 && neededMastersToCommit > 0) {
|
||||
markAsFailed("no more pending master nodes, but failed to reach needed acks ([" + neededMastersToCommit + "] left)");
|
||||
}
|
||||
}
|
||||
|
||||
synchronized public void onNodeSendFailed(DiscoveryNode node, Throwable t) {
|
||||
public synchronized void onNodeSendFailed(DiscoveryNode node, Throwable t) {
|
||||
if (node.isMasterNode()) {
|
||||
logger.trace("master node {} failed to ack cluster state version [{}]. processing ... (current pending [{}], needed [{}])",
|
||||
node, clusterState.version(), pendingMasterNodes, neededMastersToCommit);
|
||||
|
@ -606,7 +606,7 @@ public class PublishClusterStateAction extends AbstractComponent {
|
|||
*
|
||||
* @return true if successful
|
||||
*/
|
||||
synchronized private boolean markAsCommitted() {
|
||||
private synchronized boolean markAsCommitted() {
|
||||
if (committedOrFailed()) {
|
||||
return committed;
|
||||
}
|
||||
|
@ -621,7 +621,7 @@ public class PublishClusterStateAction extends AbstractComponent {
|
|||
*
|
||||
* @return true if the publishing was failed and the cluster state is *not* committed
|
||||
**/
|
||||
synchronized private boolean markAsFailed(String details, Throwable reason) {
|
||||
private synchronized boolean markAsFailed(String details, Throwable reason) {
|
||||
if (committedOrFailed()) {
|
||||
return committed == false;
|
||||
}
|
||||
|
@ -636,7 +636,7 @@ public class PublishClusterStateAction extends AbstractComponent {
|
|||
*
|
||||
* @return true if the publishing was failed and the cluster state is *not* committed
|
||||
**/
|
||||
synchronized private boolean markAsFailed(String reason) {
|
||||
private synchronized boolean markAsFailed(String reason) {
|
||||
if (committedOrFailed()) {
|
||||
return committed == false;
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ public class Index implements Writeable, ToXContent {
|
|||
/**
|
||||
* Builder for Index objects. Used by ObjectParser instances only.
|
||||
*/
|
||||
final private static class Builder {
|
||||
private static final class Builder {
|
||||
private String name;
|
||||
private String uuid;
|
||||
|
||||
|
|
|
@ -186,7 +186,8 @@ public class IndexService extends AbstractIndexComponent implements IndicesClust
|
|||
* Return the shard with the provided id, or null if there is no such shard.
|
||||
*/
|
||||
@Override
|
||||
public @Nullable IndexShard getShardOrNull(int shardId) {
|
||||
@Nullable
|
||||
public IndexShard getShardOrNull(int shardId) {
|
||||
return shards.get(shardId);
|
||||
}
|
||||
|
||||
|
@ -730,7 +731,7 @@ public class IndexService extends AbstractIndexComponent implements IndicesClust
|
|||
}
|
||||
}
|
||||
|
||||
static abstract class BaseAsyncTask implements Runnable, Closeable {
|
||||
abstract static class BaseAsyncTask implements Runnable, Closeable {
|
||||
protected final IndexService indexService;
|
||||
protected final ThreadPool threadPool;
|
||||
private final TimeValue interval;
|
||||
|
@ -827,7 +828,7 @@ public class IndexService extends AbstractIndexComponent implements IndicesClust
|
|||
/**
|
||||
* FSyncs the translog for all shards of this index in a defined interval.
|
||||
*/
|
||||
final static class AsyncTranslogFSync extends BaseAsyncTask {
|
||||
static final class AsyncTranslogFSync extends BaseAsyncTask {
|
||||
|
||||
AsyncTranslogFSync(IndexService indexService) {
|
||||
super(indexService, indexService.getIndexSettings().getTranslogSyncInterval());
|
||||
|
|
|
@ -40,10 +40,10 @@ public class CodecService {
|
|||
|
||||
private final Map<String, Codec> codecs;
|
||||
|
||||
public final static String DEFAULT_CODEC = "default";
|
||||
public final static String BEST_COMPRESSION_CODEC = "best_compression";
|
||||
public static final String DEFAULT_CODEC = "default";
|
||||
public static final String BEST_COMPRESSION_CODEC = "best_compression";
|
||||
/** the raw unfiltered lucene default. useful for testing */
|
||||
public final static String LUCENE_DEFAULT_CODEC = "lucene_default";
|
||||
public static final String LUCENE_DEFAULT_CODEC = "lucene_default";
|
||||
|
||||
public CodecService(@Nullable MapperService mapperService, ESLogger logger) {
|
||||
final MapBuilder<String, Codec> codecs = MapBuilder.<String, Codec>newMapBuilder();
|
||||
|
|
|
@ -297,7 +297,7 @@ public abstract class Engine implements Closeable {
|
|||
PENDING_OPERATIONS
|
||||
}
|
||||
|
||||
final protected GetResult getFromSearcher(Get get, Function<String, Searcher> searcherFactory) throws EngineException {
|
||||
protected final GetResult getFromSearcher(Get get, Function<String, Searcher> searcherFactory) throws EngineException {
|
||||
final Searcher searcher = searcherFactory.apply("get");
|
||||
final Versions.DocIdAndVersion docIdAndVersion;
|
||||
try {
|
||||
|
@ -506,7 +506,7 @@ public abstract class Engine implements Closeable {
|
|||
}
|
||||
|
||||
/** How much heap is used that would be freed by a refresh. Note that this may throw {@link AlreadyClosedException}. */
|
||||
abstract public long getIndexBufferRAMBytesUsed();
|
||||
public abstract long getIndexBufferRAMBytesUsed();
|
||||
|
||||
protected Segment[] getSegmentInfo(SegmentInfos lastCommittedSegmentInfos, boolean verbose) {
|
||||
ensureOpen();
|
||||
|
@ -757,7 +757,7 @@ public abstract class Engine implements Closeable {
|
|||
}
|
||||
}
|
||||
|
||||
public static abstract class Operation {
|
||||
public abstract static class Operation {
|
||||
private final Term uid;
|
||||
private long version;
|
||||
private final VersionType versionType;
|
||||
|
|
|
@ -995,7 +995,7 @@ public class InternalEngine extends Engine {
|
|||
}
|
||||
|
||||
/** Extended SearcherFactory that warms the segments if needed when acquiring a new searcher */
|
||||
final static class SearchFactory extends EngineSearcherFactory {
|
||||
static final class SearchFactory extends EngineSearcherFactory {
|
||||
private final Engine.Warmer warmer;
|
||||
private final ESLogger logger;
|
||||
private final AtomicBoolean isEngineClosed;
|
||||
|
|
|
@ -58,8 +58,8 @@ import java.util.function.Function;
|
|||
public class ShadowEngine extends Engine {
|
||||
|
||||
/** how long to wait for an index to exist */
|
||||
public final static String NONEXISTENT_INDEX_RETRY_WAIT = "index.shadow.wait_for_initial_commit";
|
||||
public final static TimeValue DEFAULT_NONEXISTENT_INDEX_RETRY_WAIT = TimeValue.timeValueSeconds(5);
|
||||
public static final String NONEXISTENT_INDEX_RETRY_WAIT = "index.shadow.wait_for_initial_commit";
|
||||
public static final TimeValue DEFAULT_NONEXISTENT_INDEX_RETRY_WAIT = TimeValue.timeValueSeconds(5);
|
||||
|
||||
private volatile SearcherManager searcherManager;
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public interface ScriptDocValues<T> extends List<T> {
|
|||
*/
|
||||
List<T> getValues();
|
||||
|
||||
public final static class Strings extends AbstractList<String> implements ScriptDocValues<String> {
|
||||
public static final class Strings extends AbstractList<String> implements ScriptDocValues<String> {
|
||||
|
||||
private final SortedBinaryDocValues values;
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public abstract class Mapper implements ToXContent, Iterable<Mapper> {
|
|||
}
|
||||
}
|
||||
|
||||
public static abstract class Builder<T extends Builder, Y extends Mapper> {
|
||||
public abstract static class Builder<T extends Builder, Y extends Mapper> {
|
||||
|
||||
public String name;
|
||||
|
||||
|
|
|
@ -72,8 +72,8 @@ public class BooleanFieldMapper extends FieldMapper {
|
|||
}
|
||||
|
||||
public static class Values {
|
||||
public final static BytesRef TRUE = new BytesRef("T");
|
||||
public final static BytesRef FALSE = new BytesRef("F");
|
||||
public static final BytesRef TRUE = new BytesRef("T");
|
||||
public static final BytesRef FALSE = new BytesRef("F");
|
||||
}
|
||||
|
||||
public static class Builder extends FieldMapper.Builder<Builder, BooleanFieldMapper> {
|
||||
|
|
|
@ -120,7 +120,7 @@ public abstract class LegacyNumberFieldMapper extends FieldMapper implements All
|
|||
protected abstract int maxPrecisionStep();
|
||||
}
|
||||
|
||||
public static abstract class NumberFieldType extends TermBasedFieldType {
|
||||
public abstract static class NumberFieldType extends TermBasedFieldType {
|
||||
|
||||
public NumberFieldType(LegacyNumericType numericType) {
|
||||
setTokenized(false);
|
||||
|
|
|
@ -239,14 +239,14 @@ public abstract class AbstractQueryBuilder<QB extends AbstractQueryBuilder<QB>>
|
|||
return getWriteableName();
|
||||
}
|
||||
|
||||
protected final static void writeQueries(StreamOutput out, List<? extends QueryBuilder> queries) throws IOException {
|
||||
protected static final void writeQueries(StreamOutput out, List<? extends QueryBuilder> queries) throws IOException {
|
||||
out.writeVInt(queries.size());
|
||||
for (QueryBuilder query : queries) {
|
||||
out.writeNamedWriteable(query);
|
||||
}
|
||||
}
|
||||
|
||||
protected final static List<QueryBuilder> readQueries(StreamInput in) throws IOException {
|
||||
protected static final List<QueryBuilder> readQueries(StreamInput in) throws IOException {
|
||||
List<QueryBuilder> queries = new ArrayList<>();
|
||||
int size = in.readVInt();
|
||||
for (int i = 0; i < size; i++) {
|
||||
|
|
|
@ -357,7 +357,7 @@ public class HasChildQueryBuilder extends AbstractQueryBuilder<HasChildQueryBuil
|
|||
parentType, scoreMode, parentChildIndexFieldData, context.getSearchSimilarity());
|
||||
}
|
||||
|
||||
final static class LateParsingQuery extends Query {
|
||||
static final class LateParsingQuery extends Query {
|
||||
|
||||
private final Query toQuery;
|
||||
private final Query innerQuery;
|
||||
|
|
|
@ -62,7 +62,7 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl
|
|||
public static final ParseField INNER_HITS_FIELD = new ParseField("inner_hits");
|
||||
public static final QueryBuilder DEFAULT_INNER_HIT_QUERY = new MatchAllQueryBuilder();
|
||||
|
||||
private final static ObjectParser<InnerHitBuilder, QueryParseContext> PARSER = new ObjectParser<>("inner_hits", InnerHitBuilder::new);
|
||||
private static final ObjectParser<InnerHitBuilder, QueryParseContext> PARSER = new ObjectParser<>("inner_hits", InnerHitBuilder::new);
|
||||
|
||||
static {
|
||||
PARSER.declareString(InnerHitBuilder::setName, NAME_FIELD);
|
||||
|
|
|
@ -48,7 +48,7 @@ public class TemplateQueryBuilder extends AbstractQueryBuilder<TemplateQueryBuil
|
|||
public static final String NAME = "template";
|
||||
public static final ParseField QUERY_NAME_FIELD = new ParseField(NAME);
|
||||
|
||||
private final static Map<String, ScriptService.ScriptType> parametersToTypes = new HashMap<>();
|
||||
private static final Map<String, ScriptService.ScriptType> parametersToTypes = new HashMap<>();
|
||||
static {
|
||||
parametersToTypes.put("query", ScriptService.ScriptType.INLINE);
|
||||
parametersToTypes.put("file", ScriptService.ScriptType.FILE);
|
||||
|
|
|
@ -501,7 +501,7 @@ public abstract class DecayFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>
|
|||
* This is the base class for scoring a single field.
|
||||
*
|
||||
* */
|
||||
public static abstract class AbstractDistanceScoreFunction extends ScoreFunction {
|
||||
public abstract static class AbstractDistanceScoreFunction extends ScoreFunction {
|
||||
|
||||
private final double scale;
|
||||
protected final double offset;
|
||||
|
|
|
@ -179,7 +179,7 @@ public final class ShardSearchStats implements SearchOperationListener {
|
|||
totalStats.scrollMetric.inc(System.nanoTime() - context.getOriginNanoTime());
|
||||
}
|
||||
|
||||
final static class StatsHolder {
|
||||
static final class StatsHolder {
|
||||
public final MeanMetric queryMetric = new MeanMetric();
|
||||
public final MeanMetric fetchMetric = new MeanMetric();
|
||||
public final MeanMetric scrollMetric = new MeanMetric();
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.util.function.BiFunction;
|
|||
|
||||
public final class SimilarityService extends AbstractIndexComponent {
|
||||
|
||||
public final static String DEFAULT_SIMILARITY = "BM25";
|
||||
public static final String DEFAULT_SIMILARITY = "BM25";
|
||||
private final Similarity defaultSimilarity;
|
||||
private final Similarity baseSimilarity;
|
||||
private final Map<String, SimilarityProvider> similarities;
|
||||
|
|
|
@ -716,7 +716,7 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
|
|||
*
|
||||
* @see StoreFileMetaData
|
||||
*/
|
||||
public final static class MetadataSnapshot implements Iterable<StoreFileMetaData>, Writeable {
|
||||
public static final class MetadataSnapshot implements Iterable<StoreFileMetaData>, Writeable {
|
||||
private final Map<String, StoreFileMetaData> metadata;
|
||||
|
||||
public static final MetadataSnapshot EMPTY = new MetadataSnapshot();
|
||||
|
|
|
@ -52,7 +52,7 @@ public abstract class BaseTranslogReader implements Comparable<BaseTranslogReade
|
|||
|
||||
public abstract long sizeInBytes();
|
||||
|
||||
abstract public int totalOperations();
|
||||
public abstract int totalOperations();
|
||||
|
||||
public final long getFirstOperationOffset() {
|
||||
return firstOperationOffset;
|
||||
|
@ -117,7 +117,7 @@ public abstract class BaseTranslogReader implements Comparable<BaseTranslogReade
|
|||
/**
|
||||
* reads bytes at position into the given buffer, filling it.
|
||||
*/
|
||||
abstract protected void readBytes(ByteBuffer buffer, long position) throws IOException;
|
||||
protected abstract void readBytes(ByteBuffer buffer, long position) throws IOException;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
|
@ -122,7 +122,7 @@ public class Translog extends AbstractIndexShardComponent implements IndexShardC
|
|||
private final Path location;
|
||||
private TranslogWriter current;
|
||||
|
||||
private final static long NOT_SET_GENERATION = -1; // -1 is safe as it will not cause a translog deletion.
|
||||
private static final long NOT_SET_GENERATION = -1; // -1 is safe as it will not cause a translog deletion.
|
||||
|
||||
private volatile long currentCommittingGeneration = NOT_SET_GENERATION;
|
||||
private volatile long lastCommittedTranslogFileGeneration = NOT_SET_GENERATION;
|
||||
|
@ -1261,7 +1261,7 @@ public class Translog extends AbstractIndexShardComponent implements IndexShardC
|
|||
/**
|
||||
* References a transaction log generation
|
||||
*/
|
||||
public final static class TranslogGeneration {
|
||||
public static final class TranslogGeneration {
|
||||
public final String translogUUID;
|
||||
public final long translogFileGeneration;
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ public class TranslogWriter extends BaseTranslogReader implements Closeable {
|
|||
return tragedy;
|
||||
}
|
||||
|
||||
private synchronized final void closeWithTragicEvent(Throwable throwable) throws IOException {
|
||||
private synchronized void closeWithTragicEvent(Throwable throwable) throws IOException {
|
||||
assert throwable != null : "throwable must not be null in a tragic event";
|
||||
if (tragedy == null) {
|
||||
tragedy = throwable;
|
||||
|
|
|
@ -331,7 +331,8 @@ public class IndicesService extends AbstractLifecycleComponent<IndicesService>
|
|||
* Returns an IndexService for the specified index if exists otherwise returns <code>null</code>.
|
||||
*/
|
||||
@Override
|
||||
public @Nullable IndexService indexService(Index index) {
|
||||
@Nullable
|
||||
public IndexService indexService(Index index) {
|
||||
return indices.get(index.getUUID());
|
||||
}
|
||||
|
||||
|
@ -737,7 +738,8 @@ public class IndicesService extends AbstractLifecycleComponent<IndicesService>
|
|||
* @return IndexMetaData for the index loaded from disk
|
||||
*/
|
||||
@Override
|
||||
public @Nullable IndexMetaData verifyIndexIsDeleted(final Index index, final ClusterState clusterState) {
|
||||
@Nullable
|
||||
public IndexMetaData verifyIndexIsDeleted(final Index index, final ClusterState clusterState) {
|
||||
// this method should only be called when we know the index (name + uuid) is not part of the cluster state
|
||||
if (clusterState.metaData().index(index) != null) {
|
||||
throw new IllegalStateException("Cannot delete index [" + index + "], it is still part of the cluster state.");
|
||||
|
@ -997,7 +999,7 @@ public class IndicesService extends AbstractLifecycleComponent<IndicesService>
|
|||
* has an entry invalidated may not clean up the entry if it is not read from
|
||||
* or written to after invalidation.
|
||||
*/
|
||||
private final static class CacheCleaner implements Runnable, Releasable {
|
||||
private static final class CacheCleaner implements Runnable, Releasable {
|
||||
|
||||
private final IndicesFieldDataCache cache;
|
||||
private final ESLogger logger;
|
||||
|
@ -1160,7 +1162,7 @@ public class IndicesService extends AbstractLifecycleComponent<IndicesService>
|
|||
return indicesRequestCache.getOrCompute(cacheEntity, reader, cacheKey);
|
||||
}
|
||||
|
||||
final static class IndexShardCacheEntity extends AbstractIndexShardCacheEntity {
|
||||
static final class IndexShardCacheEntity extends AbstractIndexShardCacheEntity {
|
||||
private final IndexShard indexShard;
|
||||
|
||||
protected IndexShardCacheEntity(IndexShard indexShard, Loader loader) {
|
||||
|
|
|
@ -75,11 +75,11 @@ import java.util.function.Function;
|
|||
*/
|
||||
public class HunspellService extends AbstractComponent {
|
||||
|
||||
public final static Setting<Boolean> HUNSPELL_LAZY_LOAD =
|
||||
public static final Setting<Boolean> HUNSPELL_LAZY_LOAD =
|
||||
Setting.boolSetting("indices.analysis.hunspell.dictionary.lazy", Boolean.FALSE, Property.NodeScope);
|
||||
public final static Setting<Boolean> HUNSPELL_IGNORE_CASE =
|
||||
public static final Setting<Boolean> HUNSPELL_IGNORE_CASE =
|
||||
Setting.boolSetting("indices.analysis.hunspell.dictionary.ignore_case", Boolean.FALSE, Property.NodeScope);
|
||||
public final static Setting<Settings> HUNSPELL_DICTIONARY_OPTIONS =
|
||||
public static final Setting<Settings> HUNSPELL_DICTIONARY_OPTIONS =
|
||||
Setting.groupSetting("indices.analysis.hunspell.dictionary.", Property.NodeScope);
|
||||
private final ConcurrentHashMap<String, Dictionary> dictionaries = new ConcurrentHashMap<>();
|
||||
private final Map<String, Dictionary> knownDictionaries;
|
||||
|
|
|
@ -465,7 +465,7 @@ public enum PreBuiltAnalyzers {
|
|||
}
|
||||
};
|
||||
|
||||
abstract protected Analyzer create(Version version);
|
||||
protected abstract Analyzer create(Version version);
|
||||
|
||||
protected final PreBuiltCacheFactory.PreBuiltCache<Analyzer> cache;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public enum PreBuiltCharFilters {
|
|||
}
|
||||
};
|
||||
|
||||
abstract public Reader create(Reader tokenStream, Version version);
|
||||
public abstract Reader create(Reader tokenStream, Version version);
|
||||
|
||||
protected final PreBuiltCacheFactory.PreBuiltCache<CharFilterFactory> cache;
|
||||
|
||||
|
|
|
@ -393,7 +393,7 @@ public enum PreBuiltTokenFilters {
|
|||
|
||||
;
|
||||
|
||||
abstract public TokenStream create(TokenStream tokenStream, Version version);
|
||||
public abstract TokenStream create(TokenStream tokenStream, Version version);
|
||||
|
||||
protected final PreBuiltCacheFactory.PreBuiltCache<TokenFilterFactory> cache;
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ public enum PreBuiltTokenizers {
|
|||
|
||||
;
|
||||
|
||||
abstract protected Tokenizer create(Version version);
|
||||
protected abstract Tokenizer create(Version version);
|
||||
|
||||
protected final PreBuiltCacheFactory.PreBuiltCache<TokenizerFactory> cache;
|
||||
|
||||
|
|
|
@ -443,7 +443,7 @@ public class SyncedFlushService extends AbstractComponent implements IndexEventL
|
|||
return new InFlightOpsResponse(opCount);
|
||||
}
|
||||
|
||||
public final static class PreShardSyncedFlushRequest extends TransportRequest {
|
||||
public static final class PreShardSyncedFlushRequest extends TransportRequest {
|
||||
private ShardId shardId;
|
||||
|
||||
public PreShardSyncedFlushRequest() {
|
||||
|
@ -480,7 +480,7 @@ public class SyncedFlushService extends AbstractComponent implements IndexEventL
|
|||
/**
|
||||
* Response for first step of synced flush (flush) for one shard copy
|
||||
*/
|
||||
final static class PreSyncedFlushResponse extends TransportResponse {
|
||||
static final class PreSyncedFlushResponse extends TransportResponse {
|
||||
|
||||
Engine.CommitId commitId;
|
||||
|
||||
|
|
|
@ -45,8 +45,8 @@ public class RecoveriesCollection {
|
|||
/** This is the single source of truth for ongoing recoveries. If it's not here, it was canceled or done */
|
||||
private final ConcurrentMap<Long, RecoveryTarget> onGoingRecoveries = ConcurrentCollections.newConcurrentMap();
|
||||
|
||||
final private ESLogger logger;
|
||||
final private ThreadPool threadPool;
|
||||
private final ESLogger logger;
|
||||
private final ThreadPool threadPool;
|
||||
|
||||
public RecoveriesCollection(ESLogger logger, ThreadPool threadPool) {
|
||||
this.logger = logger;
|
||||
|
|
|
@ -706,7 +706,7 @@ public class RecoveryState implements ToXContent, Streamable {
|
|||
|
||||
private Map<String, File> fileDetails = new HashMap<>();
|
||||
|
||||
public final static long UNKNOWN = -1L;
|
||||
public static final long UNKNOWN = -1L;
|
||||
|
||||
private long version = UNKNOWN;
|
||||
private long sourceThrottlingInNanos = UNKNOWN;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue