mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-31 12:28:51 +00:00
Moves more classes over to ToXContentObject/Fragment (#26234)
* Moves more classes over to ToXContentObject/Fragment * review comments
This commit is contained in:
parent
2978b5df8b
commit
a975f4e5d6
core/src
main/java/org/elasticsearch
action
TaskOperationFailure.java
admin
cluster
node
info
stats
tasks/list
usage
snapshots/status
SnapshotIndexShardStatus.javaSnapshotIndexStatus.javaSnapshotShardsStats.javaSnapshotStats.javaSnapshotStatus.java
stats
indices
flush
shards
stats
upgrade/get
ingest
cluster
metadata
routing
common/settings
discovery/zen
index
cache
engine
query/functionscore
recovery
refresh
reindex
search/stats
seqno
shard
store
warmer
indices
ingest
monitor
plugins
script
search
SearchExtBuilder.javaSearchHit.javaSearchHits.javaSearchSortValues.java
aggregations
builder
profile
searchafter
suggest
snapshots
tasks
threadpool
transport
test/java/org/elasticsearch/action/admin/cluster/node/tasks
test/framework/src/main/java/org/elasticsearch/test/rest/yaml
@ -24,7 +24,8 @@ import org.elasticsearch.ExceptionsHelper;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
|
||||
@ -37,7 +38,7 @@ import static org.elasticsearch.ExceptionsHelper.detailedMessage;
|
||||
*
|
||||
* The class is final due to serialization limitations
|
||||
*/
|
||||
public final class TaskOperationFailure implements Writeable, ToXContent {
|
||||
public final class TaskOperationFailure implements Writeable, ToXContentFragment {
|
||||
|
||||
private final String nodeId;
|
||||
|
||||
|
@ -26,7 +26,8 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
|
||||
@ -34,7 +35,7 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class NodesInfoResponse extends BaseNodesResponse<NodeInfo> implements ToXContent {
|
||||
public class NodesInfoResponse extends BaseNodesResponse<NodeInfo> implements ToXContentFragment {
|
||||
|
||||
public NodesInfoResponse() {
|
||||
}
|
||||
|
@ -22,7 +22,8 @@ package org.elasticsearch.action.admin.cluster.node.info;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.plugins.PluginInfo;
|
||||
|
||||
@ -34,7 +35,7 @@ import java.util.List;
|
||||
/**
|
||||
* Information about plugins and modules
|
||||
*/
|
||||
public class PluginsAndModules implements Writeable, ToXContent {
|
||||
public class PluginsAndModules implements Writeable, ToXContentFragment {
|
||||
private final List<PluginInfo> plugins;
|
||||
private final List<PluginInfo> modules;
|
||||
|
||||
|
@ -24,7 +24,8 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.discovery.DiscoveryStats;
|
||||
import org.elasticsearch.http.HttpStats;
|
||||
@ -45,7 +46,7 @@ import java.util.Map;
|
||||
/**
|
||||
* Node statistics (dynamic, changes depending on when created).
|
||||
*/
|
||||
public class NodeStats extends BaseNodeResponse implements ToXContent {
|
||||
public class NodeStats extends BaseNodeResponse implements ToXContentFragment {
|
||||
|
||||
private long timestamp;
|
||||
|
||||
|
@ -24,14 +24,14 @@ import org.elasticsearch.action.support.nodes.BaseNodesResponse;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class NodesStatsResponse extends BaseNodesResponse<NodeStats> implements ToXContent {
|
||||
public class NodesStatsResponse extends BaseNodesResponse<NodeStats> implements ToXContentFragment {
|
||||
|
||||
NodesStatsResponse() {
|
||||
}
|
||||
|
@ -19,7 +19,8 @@
|
||||
|
||||
package org.elasticsearch.action.admin.cluster.node.tasks.list;
|
||||
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.tasks.TaskInfo;
|
||||
|
||||
@ -32,7 +33,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* Information about a currently running task and all its subtasks.
|
||||
*/
|
||||
public class TaskGroup implements ToXContent {
|
||||
public class TaskGroup implements ToXContentObject {
|
||||
|
||||
private final TaskInfo task;
|
||||
|
||||
|
@ -23,13 +23,14 @@ import org.elasticsearch.action.support.nodes.BaseNodeResponse;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
public class NodeUsage extends BaseNodeResponse implements ToXContent {
|
||||
public class NodeUsage extends BaseNodeResponse implements ToXContentFragment {
|
||||
|
||||
private long timestamp;
|
||||
private long sinceTime;
|
||||
|
@ -24,7 +24,8 @@ import org.elasticsearch.action.support.nodes.BaseNodesResponse;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
|
||||
@ -35,7 +36,7 @@ import java.util.List;
|
||||
* The response for the nodes usage api which contains the individual usage
|
||||
* statistics for all nodes queried.
|
||||
*/
|
||||
public class NodesUsageResponse extends BaseNodesResponse<NodeUsage> implements ToXContent {
|
||||
public class NodesUsageResponse extends BaseNodesResponse<NodeUsage> implements ToXContentFragment {
|
||||
|
||||
NodesUsageResponse() {
|
||||
}
|
||||
|
@ -22,14 +22,15 @@ package org.elasticsearch.action.admin.cluster.snapshots.status;
|
||||
import org.elasticsearch.action.support.broadcast.BroadcastShardResponse;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.index.snapshots.IndexShardSnapshotStatus;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class SnapshotIndexShardStatus extends BroadcastShardResponse implements ToXContent {
|
||||
public class SnapshotIndexShardStatus extends BroadcastShardResponse implements ToXContentFragment {
|
||||
|
||||
private SnapshotIndexShardStage stage = SnapshotIndexShardStage.INIT;
|
||||
|
||||
|
5
core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java
5
core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java
@ -19,7 +19,8 @@
|
||||
|
||||
package org.elasticsearch.action.admin.cluster.snapshots.status;
|
||||
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -33,7 +34,7 @@ import static java.util.Collections.unmodifiableMap;
|
||||
/**
|
||||
* Represents snapshot status of all shards in the index
|
||||
*/
|
||||
public class SnapshotIndexStatus implements Iterable<SnapshotIndexShardStatus>, ToXContent {
|
||||
public class SnapshotIndexStatus implements Iterable<SnapshotIndexShardStatus>, ToXContentFragment {
|
||||
|
||||
private final String index;
|
||||
|
||||
|
3
core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java
3
core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java
@ -20,6 +20,7 @@
|
||||
package org.elasticsearch.action.admin.cluster.snapshots.status;
|
||||
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -28,7 +29,7 @@ import java.util.Collection;
|
||||
/**
|
||||
* Status of a snapshot shards
|
||||
*/
|
||||
public class SnapshotShardsStats implements ToXContent {
|
||||
public class SnapshotShardsStats implements ToXContentFragment {
|
||||
|
||||
private int initializingShards;
|
||||
private int startedShards;
|
||||
|
@ -23,12 +23,13 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.snapshots.IndexShardSnapshotStatus;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class SnapshotStats implements Streamable, ToXContent {
|
||||
public class SnapshotStats implements Streamable, ToXContentFragment {
|
||||
private long startTime;
|
||||
|
||||
private long time;
|
||||
|
@ -20,13 +20,14 @@
|
||||
package org.elasticsearch.action.admin.cluster.snapshots.status;
|
||||
|
||||
import org.elasticsearch.cluster.SnapshotsInProgress.State;
|
||||
import org.elasticsearch.snapshots.Snapshot;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.snapshots.Snapshot;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@ -43,7 +44,7 @@ import static java.util.Collections.unmodifiableMap;
|
||||
/**
|
||||
* Status of a snapshot
|
||||
*/
|
||||
public class SnapshotStatus implements ToXContent, Streamable {
|
||||
public class SnapshotStatus implements ToXContentObject, Streamable {
|
||||
|
||||
private Snapshot snapshot;
|
||||
|
||||
|
@ -23,7 +23,6 @@ import com.carrotsearch.hppc.ObjectObjectHashMap;
|
||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||
|
||||
import org.elasticsearch.action.admin.indices.stats.CommonStats;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.cache.query.QueryCacheStats;
|
||||
@ -137,7 +136,7 @@ public class ClusterStatsIndices implements ToXContentFragment {
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static class ShardStats implements ToXContent {
|
||||
public static class ShardStats implements ToXContentFragment {
|
||||
|
||||
int indices;
|
||||
int total;
|
||||
|
@ -32,7 +32,6 @@ import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.monitor.fs.FsInfo;
|
||||
@ -223,7 +222,7 @@ public class ClusterStatsNodes implements ToXContentFragment {
|
||||
}
|
||||
}
|
||||
|
||||
public static class OsStats implements ToXContent {
|
||||
public static class OsStats implements ToXContentFragment {
|
||||
final int availableProcessors;
|
||||
final int allocatedProcessors;
|
||||
final ObjectIntHashMap<String> names;
|
||||
@ -302,7 +301,7 @@ public class ClusterStatsNodes implements ToXContentFragment {
|
||||
}
|
||||
}
|
||||
|
||||
public static class ProcessStats implements ToXContent {
|
||||
public static class ProcessStats implements ToXContentFragment {
|
||||
|
||||
final int count;
|
||||
final int cpuPercent;
|
||||
@ -544,7 +543,7 @@ public class ClusterStatsNodes implements ToXContentFragment {
|
||||
}
|
||||
}
|
||||
|
||||
static class NetworkTypes implements ToXContent {
|
||||
static class NetworkTypes implements ToXContentFragment {
|
||||
|
||||
private final Map<String, AtomicInteger> transportTypes;
|
||||
private final Map<String, AtomicInteger> httpTypes;
|
||||
|
@ -24,7 +24,7 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.util.iterable.Iterables;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.indices.flush.ShardsSyncedFlushResult;
|
||||
import org.elasticsearch.indices.flush.SyncedFlushService;
|
||||
@ -42,7 +42,7 @@ import static java.util.Collections.unmodifiableMap;
|
||||
/**
|
||||
* The result of performing a sync flush operation on all shards of multiple indices
|
||||
*/
|
||||
public class SyncedFlushResponse extends ActionResponse implements ToXContent {
|
||||
public class SyncedFlushResponse extends ActionResponse implements ToXContentFragment {
|
||||
|
||||
Map<String, List<ShardsSyncedFlushResult>> shardsResultPerIndex;
|
||||
ShardCounts shardCounts;
|
||||
@ -140,7 +140,7 @@ public class SyncedFlushResponse extends ActionResponse implements ToXContent {
|
||||
return new ShardCounts(total, successful, failed);
|
||||
}
|
||||
|
||||
static final class ShardCounts implements ToXContent, Streamable {
|
||||
static final class ShardCounts implements ToXContentFragment, Streamable {
|
||||
|
||||
public int total;
|
||||
public int successful;
|
||||
|
@ -33,7 +33,6 @@ import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
@ -55,7 +54,7 @@ public class IndicesShardStoresResponse extends ActionResponse implements ToXCon
|
||||
/**
|
||||
* Shard store information from a node
|
||||
*/
|
||||
public static class StoreStatus implements Streamable, ToXContent, Comparable<StoreStatus> {
|
||||
public static class StoreStatus implements Streamable, ToXContentFragment, Comparable<StoreStatus> {
|
||||
private DiscoveryNode node;
|
||||
private String allocationId;
|
||||
private Exception storeException;
|
||||
|
@ -26,7 +26,8 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.engine.CommitStats;
|
||||
import org.elasticsearch.index.seqno.SeqNoStats;
|
||||
@ -34,7 +35,7 @@ import org.elasticsearch.index.shard.ShardPath;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ShardStats implements Streamable, Writeable, ToXContent {
|
||||
public class ShardStats implements Streamable, Writeable, ToXContentFragment {
|
||||
private ShardRouting shardRouting;
|
||||
private CommonStats commonStats;
|
||||
@Nullable
|
||||
|
@ -23,7 +23,8 @@ import org.elasticsearch.action.ShardOperationFailedException;
|
||||
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -34,7 +35,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class UpgradeStatusResponse extends BroadcastResponse implements ToXContent {
|
||||
public class UpgradeStatusResponse extends BroadcastResponse implements ToXContentFragment {
|
||||
private ShardUpgradeStatus[] shards;
|
||||
|
||||
private Map<String, IndexUpgradeStatus> indicesUpgradeStatus;
|
||||
|
@ -22,14 +22,15 @@ import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.ingest.ConfigurationUtils;
|
||||
import org.elasticsearch.ingest.IngestDocument;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
class SimulateProcessorResult implements Writeable, ToXContent {
|
||||
class SimulateProcessorResult implements Writeable, ToXContentObject {
|
||||
private final String processorTag;
|
||||
private final WriteableIngestDocument ingestDocument;
|
||||
private final Exception failure;
|
||||
|
@ -23,7 +23,8 @@ import org.elasticsearch.Version;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.ingest.IngestDocument;
|
||||
|
||||
@ -33,7 +34,7 @@ import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
final class WriteableIngestDocument implements Writeable, ToXContent {
|
||||
final class WriteableIngestDocument implements Writeable, ToXContentFragment {
|
||||
|
||||
private final IngestDocument ingestDocument;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ContextParser;
|
||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.index.Index;
|
||||
@ -347,7 +347,7 @@ public final class IndexGraveyard implements MetaData.Custom {
|
||||
/**
|
||||
* An individual tombstone entry for representing a deleted index.
|
||||
*/
|
||||
public static final class Tombstone implements ToXContent, Writeable {
|
||||
public static final class Tombstone implements ToXContentObject, Writeable {
|
||||
|
||||
private static final String INDEX_KEY = "index";
|
||||
private static final String DELETE_DATE_IN_MILLIS_KEY = "delete_date_in_millis";
|
||||
|
@ -24,6 +24,7 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.snapshots.Snapshot;
|
||||
|
||||
@ -38,7 +39,7 @@ import java.util.Objects;
|
||||
* - {@link SnapshotRecoverySource} recovery from a snapshot
|
||||
* - {@link LocalShardsRecoverySource} recovery from other shards of another index on the same node
|
||||
*/
|
||||
public abstract class RecoverySource implements Writeable, ToXContent {
|
||||
public abstract class RecoverySource implements Writeable, ToXContentObject {
|
||||
|
||||
@Override
|
||||
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
|
||||
|
@ -26,7 +26,8 @@ import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.Index;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
@ -39,7 +40,7 @@ import java.util.List;
|
||||
* {@link ShardRouting} immutably encapsulates information about shard
|
||||
* routings like id, state, version, etc.
|
||||
*/
|
||||
public final class ShardRouting implements Writeable, ToXContent {
|
||||
public final class ShardRouting implements Writeable, ToXContentObject {
|
||||
|
||||
/**
|
||||
* Used if shard size is not available
|
||||
|
@ -33,7 +33,8 @@ import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -43,7 +44,7 @@ import java.util.Objects;
|
||||
/**
|
||||
* Holds additional information as to why the shard is in unassigned state.
|
||||
*/
|
||||
public final class UnassignedInfo implements ToXContent, Writeable {
|
||||
public final class UnassignedInfo implements ToXContentFragment, Writeable {
|
||||
|
||||
public static final FormatDateTimeFormatter DATE_TIME_FORMATTER = Joda.forPattern("dateOptionalTime");
|
||||
|
||||
|
@ -27,7 +27,8 @@ import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -38,7 +39,7 @@ import static org.elasticsearch.cluster.routing.allocation.AbstractAllocationDec
|
||||
/**
|
||||
* This class represents the shard allocation decision and its explanation for a single node.
|
||||
*/
|
||||
public class NodeAllocationResult implements ToXContent, Writeable, Comparable<NodeAllocationResult> {
|
||||
public class NodeAllocationResult implements ToXContentObject, Writeable, Comparable<NodeAllocationResult> {
|
||||
|
||||
private static final Comparator<NodeAllocationResult> nodeResultComparator =
|
||||
Comparator.comparing(NodeAllocationResult::getNodeDecision)
|
||||
@ -186,7 +187,7 @@ public class NodeAllocationResult implements ToXContent, Writeable, Comparable<N
|
||||
}
|
||||
|
||||
/** A class that captures metadata about a shard store on a node. */
|
||||
public static final class ShardStoreInfo implements ToXContent, Writeable {
|
||||
public static final class ShardStoreInfo implements ToXContentFragment, Writeable {
|
||||
private final boolean inSync;
|
||||
@Nullable
|
||||
private final String allocationId;
|
||||
|
@ -23,7 +23,8 @@ import org.elasticsearch.cluster.routing.allocation.command.AllocationCommand;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.Decision;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -32,7 +33,7 @@ import java.io.IOException;
|
||||
* Class encapsulating the explanation for a single {@link AllocationCommand}
|
||||
* taken from the Deciders
|
||||
*/
|
||||
public class RerouteExplanation implements ToXContent {
|
||||
public class RerouteExplanation implements ToXContentObject {
|
||||
|
||||
private AllocationCommand command;
|
||||
private Decision decisions;
|
||||
|
@ -21,7 +21,8 @@ package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -32,7 +33,7 @@ import java.util.List;
|
||||
* Class used to encapsulate a number of {@link RerouteExplanation}
|
||||
* explanations.
|
||||
*/
|
||||
public class RoutingExplanations implements ToXContent {
|
||||
public class RoutingExplanations implements ToXContentFragment {
|
||||
private final List<RerouteExplanation> explanations;
|
||||
|
||||
public RoutingExplanations() {
|
||||
|
@ -22,7 +22,8 @@ package org.elasticsearch.cluster.routing.allocation;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -40,7 +41,7 @@ import java.io.IOException;
|
||||
* then both {@link #getAllocateDecision()} and {@link #getMoveDecision()} will return
|
||||
* objects whose {@code isDecisionTaken()} method returns {@code false}.
|
||||
*/
|
||||
public final class ShardAllocationDecision implements ToXContent, Writeable {
|
||||
public final class ShardAllocationDecision implements ToXContentFragment, Writeable {
|
||||
public static final ShardAllocationDecision NOT_TAKEN =
|
||||
new ShardAllocationDecision(AllocateUnassignedDecision.NOT_TAKEN, MoveDecision.NOT_TAKEN);
|
||||
|
||||
|
@ -37,7 +37,8 @@ import org.elasticsearch.common.unit.MemorySizeValue;
|
||||
import org.elasticsearch.common.unit.RatioValue;
|
||||
import org.elasticsearch.common.unit.SizeValue;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
|
||||
@ -80,7 +81,7 @@ import static org.elasticsearch.common.unit.TimeValue.parseTimeValue;
|
||||
/**
|
||||
* An immutable settings implementation.
|
||||
*/
|
||||
public final class Settings implements ToXContent {
|
||||
public final class Settings implements ToXContentFragment {
|
||||
|
||||
public static final Settings EMPTY = new Builder().build();
|
||||
private static final Pattern ARRAY_PATTERN = Pattern.compile("(.*)\\.\\d+$");
|
||||
|
@ -22,7 +22,8 @@ package org.elasticsearch.discovery.zen;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -30,7 +31,7 @@ import java.io.IOException;
|
||||
/**
|
||||
* Class encapsulating stats about the PendingClusterStatsQueue
|
||||
*/
|
||||
public class PendingClusterStateStats implements Writeable, ToXContent {
|
||||
public class PendingClusterStateStats implements Writeable, ToXContentFragment {
|
||||
|
||||
private final int total;
|
||||
private final int pending;
|
||||
|
@ -25,11 +25,12 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class QueryCacheStats implements Streamable, ToXContent {
|
||||
public class QueryCacheStats implements Streamable, ToXContentFragment {
|
||||
|
||||
long ramBytesUsed;
|
||||
long hitCount;
|
||||
|
@ -23,12 +23,13 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class RequestCacheStats implements Streamable, ToXContent {
|
||||
public class RequestCacheStats implements Streamable, ToXContentFragment {
|
||||
|
||||
long memorySize;
|
||||
long evictions;
|
||||
|
@ -26,13 +26,14 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class SegmentsStats implements Streamable, ToXContent {
|
||||
public class SegmentsStats implements Streamable, ToXContentFragment {
|
||||
|
||||
private long count;
|
||||
private long memoryInBytes;
|
||||
|
@ -24,14 +24,15 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.lucene.search.function.ScoreFunction;
|
||||
import org.elasticsearch.common.lucene.search.function.WeightFactorFunction;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.query.QueryShardContext;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public abstract class ScoreFunctionBuilder<FB extends ScoreFunctionBuilder<FB>> implements ToXContent, NamedWriteable {
|
||||
public abstract class ScoreFunctionBuilder<FB extends ScoreFunctionBuilder<FB>> implements ToXContentFragment, NamedWriteable {
|
||||
|
||||
private Float weight;
|
||||
|
||||
|
@ -22,7 +22,8 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -33,7 +34,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
||||
* Recovery related statistics, starting at the shard level and allowing aggregation to
|
||||
* indices and node level
|
||||
*/
|
||||
public class RecoveryStats implements ToXContent, Streamable {
|
||||
public class RecoveryStats implements ToXContentFragment, Streamable {
|
||||
|
||||
private final AtomicInteger currentAsSource = new AtomicInteger();
|
||||
private final AtomicInteger currentAsTarget = new AtomicInteger();
|
||||
|
@ -23,13 +23,14 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class RefreshStats implements Streamable, ToXContent {
|
||||
public class RefreshStats implements Streamable, ToXContentFragment {
|
||||
|
||||
private long total;
|
||||
|
||||
|
@ -26,7 +26,8 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.tasks.CancellableTask;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
@ -546,7 +547,7 @@ public class BulkByScrollTask extends CancellableTask {
|
||||
* The status of a slice of the request. Successful requests store the {@link StatusOrException#status} while failing requests store a
|
||||
* {@link StatusOrException#exception}.
|
||||
*/
|
||||
public static class StatusOrException implements Writeable, ToXContent {
|
||||
public static class StatusOrException implements Writeable, ToXContentObject {
|
||||
private final Status status;
|
||||
private final Exception exception;
|
||||
|
||||
|
@ -30,13 +30,13 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.search.SearchHit;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
@ -291,7 +291,7 @@ public abstract class ScrollableHitSource {
|
||||
/**
|
||||
* A failure during search. Like {@link ShardSearchFailure} but useful for reindex from remote as well.
|
||||
*/
|
||||
public static class SearchFailure implements Writeable, ToXContent {
|
||||
public static class SearchFailure implements Writeable, ToXContentObject {
|
||||
private final Throwable reason;
|
||||
@Nullable
|
||||
private final String index;
|
||||
|
@ -26,8 +26,8 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
@ -35,7 +35,7 @@ import java.util.Map;
|
||||
|
||||
public class SearchStats extends ToXContentToBytes implements Streamable {
|
||||
|
||||
public static class Stats implements Streamable, ToXContent {
|
||||
public static class Stats implements Streamable, ToXContentFragment {
|
||||
|
||||
private long queryCount;
|
||||
private long queryTimeInMillis;
|
||||
|
@ -22,12 +22,13 @@ package org.elasticsearch.index.seqno;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class SeqNoStats implements ToXContent, Writeable {
|
||||
public class SeqNoStats implements ToXContentFragment, Writeable {
|
||||
|
||||
private static final String SEQ_NO = "seq_no";
|
||||
private static final String MAX_SEQ_NO = "max_seq_no";
|
||||
|
@ -34,7 +34,7 @@ import java.util.Map;
|
||||
|
||||
public class IndexingStats implements Streamable, ToXContentFragment {
|
||||
|
||||
public static class Stats implements Streamable, ToXContent {
|
||||
public static class Stats implements Streamable, ToXContentFragment {
|
||||
|
||||
private long indexCount;
|
||||
private long indexTimeInMillis;
|
||||
|
@ -24,12 +24,13 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class StoreStats implements Streamable, ToXContent {
|
||||
public class StoreStats implements Streamable, ToXContentFragment {
|
||||
|
||||
private long sizeInBytes;
|
||||
|
||||
|
@ -23,12 +23,13 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class WarmerStats implements Streamable, ToXContent {
|
||||
public class WarmerStats implements Streamable, ToXContentFragment {
|
||||
|
||||
private long current;
|
||||
|
||||
|
@ -26,7 +26,8 @@ import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.Index;
|
||||
import org.elasticsearch.index.cache.query.QueryCacheStats;
|
||||
@ -53,7 +54,7 @@ import java.util.Map;
|
||||
/**
|
||||
* Global information on indices stats running on a specific node.
|
||||
*/
|
||||
public class NodeIndicesStats implements Streamable, ToXContent {
|
||||
public class NodeIndicesStats implements Streamable, ToXContentFragment {
|
||||
|
||||
private CommonStats stats;
|
||||
private Map<Index, List<IndexShardStats>> statsByShard;
|
||||
|
@ -24,7 +24,8 @@ import org.elasticsearch.common.ParsingException;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.index.query.TermsQueryBuilder;
|
||||
@ -35,7 +36,7 @@ import java.util.Objects;
|
||||
/**
|
||||
* Encapsulates the parameters needed to fetch terms.
|
||||
*/
|
||||
public class TermsLookup implements Writeable, ToXContent {
|
||||
public class TermsLookup implements Writeable, ToXContentFragment {
|
||||
private final String index;
|
||||
private final String type;
|
||||
private final String id;
|
||||
|
@ -27,7 +27,6 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -45,7 +44,7 @@ import java.util.Map;
|
||||
/**
|
||||
* Keeps track of state related to shard recovery.
|
||||
*/
|
||||
public class RecoveryState implements ToXContent, Streamable {
|
||||
public class RecoveryState implements ToXContentFragment, Streamable {
|
||||
|
||||
public enum Stage {
|
||||
INIT((byte) 0),
|
||||
@ -413,7 +412,7 @@ public class RecoveryState implements ToXContent, Streamable {
|
||||
|
||||
}
|
||||
|
||||
public static class VerifyIndex extends Timer implements ToXContent, Streamable {
|
||||
public static class VerifyIndex extends Timer implements ToXContentFragment, Streamable {
|
||||
private volatile long checkIndexTime;
|
||||
|
||||
|
||||
@ -450,7 +449,7 @@ public class RecoveryState implements ToXContent, Streamable {
|
||||
}
|
||||
}
|
||||
|
||||
public static class Translog extends Timer implements ToXContent, Streamable {
|
||||
public static class Translog extends Timer implements ToXContentFragment, Streamable {
|
||||
public static final int UNKNOWN = -1;
|
||||
|
||||
private int recovered;
|
||||
|
@ -22,7 +22,6 @@ package org.elasticsearch.ingest;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
@ -94,7 +93,7 @@ public class IngestStats implements Writeable, ToXContentFragment {
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static class Stats implements Writeable, ToXContent {
|
||||
public static class Stats implements Writeable, ToXContentFragment {
|
||||
|
||||
private final long ingestCount;
|
||||
private final long ingestTimeInMillis;
|
||||
|
@ -28,7 +28,8 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.ContextParser;
|
||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
@ -41,7 +42,7 @@ import java.util.Objects;
|
||||
/**
|
||||
* Encapsulates a pipeline's id and configuration as a blob
|
||||
*/
|
||||
public final class PipelineConfiguration extends AbstractDiffable<PipelineConfiguration> implements ToXContent {
|
||||
public final class PipelineConfiguration extends AbstractDiffable<PipelineConfiguration> implements ToXContentObject {
|
||||
|
||||
private static final ObjectParser<Builder, Void> PARSER = new ObjectParser<>("pipeline_config", Builder::new);
|
||||
static {
|
||||
|
@ -22,12 +22,13 @@ package org.elasticsearch.ingest;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ProcessorInfo implements Writeable, ToXContent, Comparable<ProcessorInfo> {
|
||||
public class ProcessorInfo implements Writeable, ToXContentObject, Comparable<ProcessorInfo> {
|
||||
|
||||
private final String type;
|
||||
|
||||
|
@ -26,8 +26,8 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -38,7 +38,7 @@ import java.util.Set;
|
||||
|
||||
public class FsInfo implements Iterable<FsInfo.Path>, Writeable, ToXContentFragment {
|
||||
|
||||
public static class Path implements Writeable, ToXContent {
|
||||
public static class Path implements Writeable, ToXContentObject {
|
||||
|
||||
String path;
|
||||
@Nullable
|
||||
|
@ -22,12 +22,13 @@ package org.elasticsearch.monitor.os;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class OsInfo implements Writeable, ToXContent {
|
||||
public class OsInfo implements Writeable, ToXContentFragment {
|
||||
|
||||
private final long refreshInterval;
|
||||
private final int availableProcessors;
|
||||
|
@ -24,16 +24,14 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
public class OsStats implements Writeable, ToXContent {
|
||||
public class OsStats implements Writeable, ToXContentFragment {
|
||||
|
||||
private final long timestamp;
|
||||
private final Cpu cpu;
|
||||
@ -187,7 +185,7 @@ public class OsStats implements Writeable, ToXContent {
|
||||
}
|
||||
}
|
||||
|
||||
public static class Swap implements Writeable, ToXContent {
|
||||
public static class Swap implements Writeable, ToXContentFragment {
|
||||
|
||||
private final long total;
|
||||
private final long free;
|
||||
@ -288,7 +286,7 @@ public class OsStats implements Writeable, ToXContent {
|
||||
/**
|
||||
* Encapsulates basic cgroup statistics.
|
||||
*/
|
||||
public static class Cgroup implements Writeable, ToXContentObject {
|
||||
public static class Cgroup implements Writeable, ToXContentFragment {
|
||||
|
||||
private final String cpuAcctControlGroup;
|
||||
private final long cpuAcctUsageNanos;
|
||||
|
@ -22,12 +22,13 @@ package org.elasticsearch.monitor.process;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ProcessInfo implements Writeable, ToXContent {
|
||||
public class ProcessInfo implements Writeable, ToXContentFragment {
|
||||
|
||||
private final long refreshInterval;
|
||||
private final long id;
|
||||
|
@ -24,12 +24,13 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ProcessStats implements Writeable, ToXContent {
|
||||
public class ProcessStats implements Writeable, ToXContentFragment {
|
||||
|
||||
private final long timestamp;
|
||||
private final long openFileDescriptors;
|
||||
|
@ -24,7 +24,8 @@ import org.elasticsearch.bootstrap.JarHell;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -37,7 +38,7 @@ import java.util.Properties;
|
||||
/**
|
||||
* An in-memory representation of the plugin descriptor.
|
||||
*/
|
||||
public class PluginInfo implements Writeable, ToXContent {
|
||||
public class PluginInfo implements Writeable, ToXContentObject {
|
||||
|
||||
public static final String ES_PLUGIN_PROPERTIES = "plugin-descriptor.properties";
|
||||
public static final String ES_PLUGIN_POLICY = "plugin-security.policy";
|
||||
|
@ -18,7 +18,6 @@
|
||||
*/
|
||||
package org.elasticsearch.script;
|
||||
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.ResourceNotFoundException;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -30,9 +29,7 @@ import org.elasticsearch.common.ParsingException;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentParser.Token;
|
||||
@ -47,7 +44,7 @@ import java.util.Map;
|
||||
* {@link ScriptMetaData} is used to store user-defined scripts
|
||||
* as part of the {@link ClusterState} using only an id as the key.
|
||||
*/
|
||||
public final class ScriptMetaData implements MetaData.Custom, Writeable, ToXContent {
|
||||
public final class ScriptMetaData implements MetaData.Custom, Writeable, ToXContentFragment {
|
||||
|
||||
/**
|
||||
* A builder used to modify the currently stored scripts data held within
|
||||
|
@ -22,12 +22,13 @@ package org.elasticsearch.script;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ScriptStats implements Writeable, ToXContent {
|
||||
public class ScriptStats implements Writeable, ToXContentFragment {
|
||||
private final long compilations;
|
||||
private final long cacheEvictions;
|
||||
|
||||
|
@ -24,7 +24,7 @@ import org.elasticsearch.common.io.stream.NamedWriteable;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.plugins.SearchPlugin;
|
||||
import org.elasticsearch.plugins.SearchPlugin.SearchExtSpec;
|
||||
|
||||
@ -43,7 +43,7 @@ import org.elasticsearch.plugins.SearchPlugin.SearchExtSpec;
|
||||
*
|
||||
* @see SearchExtSpec
|
||||
*/
|
||||
public abstract class SearchExtBuilder implements NamedWriteable, ToXContent {
|
||||
public abstract class SearchExtBuilder implements NamedWriteable, ToXContentFragment {
|
||||
|
||||
public abstract int hashCode();
|
||||
|
||||
|
@ -37,7 +37,7 @@ import org.elasticsearch.common.text.Text;
|
||||
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ObjectParser.ValueType;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
@ -834,7 +834,7 @@ public final class SearchHit implements Streamable, ToXContentObject, Iterable<D
|
||||
/**
|
||||
* Encapsulates the nested identity of a hit.
|
||||
*/
|
||||
public static final class NestedIdentity implements Writeable, ToXContent {
|
||||
public static final class NestedIdentity implements Writeable, ToXContentFragment {
|
||||
|
||||
private static final String _NESTED = "_nested";
|
||||
private static final String FIELD = "field";
|
||||
|
@ -23,7 +23,8 @@ import org.elasticsearch.Version;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
||||
@ -36,7 +37,7 @@ import java.util.Objects;
|
||||
|
||||
import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken;
|
||||
|
||||
public final class SearchHits implements Streamable, ToXContent, Iterable<SearchHit> {
|
||||
public final class SearchHits implements Streamable, ToXContentFragment, Iterable<SearchHit> {
|
||||
|
||||
public static SearchHits empty() {
|
||||
// We shouldn't use static final instance, since that could directly be returned by native transport clients
|
||||
|
@ -23,7 +23,8 @@ import org.apache.lucene.util.BytesRef;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentParserUtils;
|
||||
@ -33,7 +34,7 @@ import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
public class SearchSortValues implements ToXContent, Writeable {
|
||||
public class SearchSortValues implements ToXContentFragment, Writeable {
|
||||
|
||||
static final SearchSortValues EMPTY = new SearchSortValues(new Object[0]);
|
||||
private final Object[] sortValues;
|
||||
|
@ -21,6 +21,7 @@ package org.elasticsearch.search.aggregations;
|
||||
|
||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentParser.Token;
|
||||
@ -33,7 +34,7 @@ import java.util.Map;
|
||||
* An implementation of {@link Aggregation} that is parsed from a REST response.
|
||||
* Serves as a base class for all aggregation implementations that are parsed from REST.
|
||||
*/
|
||||
public abstract class ParsedAggregation implements Aggregation, ToXContent {
|
||||
public abstract class ParsedAggregation implements Aggregation, ToXContentFragment {
|
||||
|
||||
protected static void declareAggregationFields(ObjectParser<? extends ParsedAggregation, Void> objectParser) {
|
||||
objectParser.declareObject((parsedAgg, metadata) -> parsedAgg.metadata = Collections.unmodifiableMap(metadata),
|
||||
|
4
core/src/main/java/org/elasticsearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java
4
core/src/main/java/org/elasticsearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java
@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.network.InetAddresses;
|
||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentParser.Token;
|
||||
@ -108,7 +108,7 @@ public final class IpRangeAggregationBuilder
|
||||
}
|
||||
}
|
||||
|
||||
public static class Range implements ToXContent {
|
||||
public static class Range implements ToXContentObject {
|
||||
|
||||
private final String key;
|
||||
private final String from;
|
||||
|
@ -23,7 +23,8 @@ import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentParserUtils;
|
||||
@ -52,7 +53,7 @@ public class RangeAggregator extends BucketsAggregator {
|
||||
public static final ParseField RANGES_FIELD = new ParseField("ranges");
|
||||
public static final ParseField KEYED_FIELD = new ParseField("keyed");
|
||||
|
||||
public static class Range implements Writeable, ToXContent {
|
||||
public static class Range implements Writeable, ToXContentObject {
|
||||
public static final ParseField KEY_FIELD = new ParseField("key");
|
||||
public static final ParseField FROM_FIELD = new ParseField("from");
|
||||
public static final ParseField TO_FIELD = new ParseField("to");
|
||||
|
@ -20,7 +20,7 @@
|
||||
package org.elasticsearch.search.aggregations.bucket.significant.heuristics;
|
||||
|
||||
import org.elasticsearch.common.io.stream.NamedWriteable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.search.aggregations.InternalAggregation;
|
||||
import org.elasticsearch.search.aggregations.bucket.significant.SignificantTerms;
|
||||
import org.elasticsearch.search.internal.SearchContext;
|
||||
@ -28,7 +28,7 @@ import org.elasticsearch.search.internal.SearchContext;
|
||||
/**
|
||||
* Heuristic for that {@link SignificantTerms} uses to pick out significant terms.
|
||||
*/
|
||||
public abstract class SignificanceHeuristic implements NamedWriteable, ToXContent {
|
||||
public abstract class SignificanceHeuristic implements NamedWriteable, ToXContentFragment {
|
||||
/**
|
||||
* @param subsetFreq The frequency of the term in the selected sample
|
||||
* @param subsetSize The size of the selected sample (typically number of docs)
|
||||
|
@ -31,7 +31,7 @@ import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
@ -1329,7 +1329,8 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
|
||||
}
|
||||
|
||||
}
|
||||
public static class ScriptField implements Writeable, ToXContent {
|
||||
|
||||
public static class ScriptField implements Writeable, ToXContentFragment {
|
||||
|
||||
private final boolean ignoreFailure;
|
||||
private final String fieldName;
|
||||
|
@ -22,7 +22,8 @@ package org.elasticsearch.search.profile;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.search.profile.aggregation.AggregationProfileShardResult;
|
||||
@ -44,7 +45,7 @@ import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpect
|
||||
* A container class to hold all the profile results across all shards. Internally
|
||||
* holds a map of shard ID -> Profiled results
|
||||
*/
|
||||
public final class SearchProfileShardResults implements Writeable, ToXContent{
|
||||
public final class SearchProfileShardResults implements Writeable, ToXContentFragment {
|
||||
|
||||
private static final String SEARCHES_FIELD = "searches";
|
||||
private static final String ID_FIELD = "id";
|
||||
|
@ -30,7 +30,8 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.text.Text;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
@ -44,7 +45,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class SearchAfterBuilder implements ToXContent, Writeable {
|
||||
public class SearchAfterBuilder implements ToXContentObject, Writeable {
|
||||
public static final ParseField SEARCH_AFTER = new ParseField("search_after");
|
||||
private static final Object[] EMPTY_SORT_VALUES = new Object[0];
|
||||
|
||||
|
@ -29,7 +29,7 @@ import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.text.Text;
|
||||
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
@ -61,7 +61,7 @@ import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpect
|
||||
/**
|
||||
* Top level suggest result, containing the result for each suggestion.
|
||||
*/
|
||||
public class Suggest implements Iterable<Suggest.Suggestion<? extends Entry<? extends Option>>>, Streamable, ToXContent {
|
||||
public class Suggest implements Iterable<Suggest.Suggestion<? extends Entry<? extends Option>>>, Streamable, ToXContentFragment {
|
||||
|
||||
public static final String NAME = "suggest";
|
||||
|
||||
@ -234,7 +234,7 @@ public class Suggest implements Iterable<Suggest.Suggestion<? extends Entry<? ex
|
||||
/**
|
||||
* The suggestion responses corresponding with the suggestions in the request.
|
||||
*/
|
||||
public static class Suggestion<T extends Suggestion.Entry> implements Iterable<T>, Streamable, ToXContent {
|
||||
public static class Suggestion<T extends Suggestion.Entry> implements Iterable<T>, Streamable, ToXContentFragment {
|
||||
|
||||
private static final String NAME = "suggestion";
|
||||
|
||||
|
@ -27,7 +27,8 @@ import org.elasticsearch.common.io.stream.NamedWriteable;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.lucene.BytesRefs;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.index.mapper.MappedFieldType;
|
||||
@ -41,7 +42,7 @@ import java.util.Objects;
|
||||
/**
|
||||
* Base class for the different suggestion implementations.
|
||||
*/
|
||||
public abstract class SuggestionBuilder<T extends SuggestionBuilder<T>> implements NamedWriteable, ToXContent {
|
||||
public abstract class SuggestionBuilder<T extends SuggestionBuilder<T>> implements NamedWriteable, ToXContentFragment {
|
||||
|
||||
protected final String field;
|
||||
protected String text;
|
||||
|
@ -27,7 +27,8 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.index.query.RegexpFlag;
|
||||
@ -37,7 +38,7 @@ import java.io.IOException;
|
||||
/**
|
||||
* Regular expression options for completion suggester
|
||||
*/
|
||||
public class RegexOptions implements ToXContent, Writeable {
|
||||
public class RegexOptions implements ToXContentFragment, Writeable {
|
||||
static final ParseField REGEX_OPTIONS = new ParseField("regex");
|
||||
private static final ParseField FLAGS_VALUE = new ParseField("flags", "flags_value");
|
||||
private static final ParseField MAX_DETERMINIZED_STATES = new ParseField("max_determinized_states");
|
||||
|
@ -21,14 +21,15 @@ package org.elasticsearch.search.suggest.phrase;
|
||||
|
||||
import org.elasticsearch.common.ParsingException;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.search.suggest.phrase.WordScorer.WordScorerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class SmoothingModel implements NamedWriteable, ToXContent {
|
||||
public abstract class SmoothingModel implements NamedWriteable, ToXContentFragment {
|
||||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
|
@ -21,7 +21,8 @@ package org.elasticsearch.snapshots;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
|
||||
@ -35,7 +36,7 @@ import java.util.List;
|
||||
* <p>
|
||||
* Returned as part of {@link org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse}
|
||||
*/
|
||||
public class RestoreInfo implements ToXContent, Streamable {
|
||||
public class RestoreInfo implements ToXContentObject, Streamable {
|
||||
|
||||
private String name;
|
||||
|
||||
|
@ -22,7 +22,8 @@ package org.elasticsearch.snapshots;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
||||
@ -32,7 +33,7 @@ import java.util.Objects;
|
||||
/**
|
||||
* SnapshotId - snapshot name + snapshot UUID
|
||||
*/
|
||||
public final class SnapshotId implements Comparable<SnapshotId>, Writeable, ToXContent {
|
||||
public final class SnapshotId implements Comparable<SnapshotId>, Writeable, ToXContentObject {
|
||||
|
||||
private static final String NAME = "name";
|
||||
private static final String UUID = "uuid";
|
||||
|
@ -26,7 +26,8 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -45,7 +46,7 @@ import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optiona
|
||||
* and use in APIs. Instead, immutable and streamable TaskInfo objects are used to represent
|
||||
* snapshot information about currently running tasks.
|
||||
*/
|
||||
public final class TaskInfo implements Writeable, ToXContent {
|
||||
public final class TaskInfo implements Writeable, ToXContentFragment {
|
||||
private final TaskId taskId;
|
||||
|
||||
private final String type;
|
||||
|
@ -29,6 +29,8 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
@ -47,7 +49,7 @@ import static org.elasticsearch.common.xcontent.XContentHelper.convertToMap;
|
||||
* Information about a running task or a task that stored its result. Running tasks just have a {@link #getTask()} while
|
||||
* tasks with stored result will have either a {@link #getError()} or {@link #getResponse()}.
|
||||
*/
|
||||
public final class TaskResult implements Writeable, ToXContent {
|
||||
public final class TaskResult implements Writeable, ToXContentObject {
|
||||
private final boolean completed;
|
||||
private final TaskInfo task;
|
||||
@Nullable
|
||||
|
@ -22,7 +22,8 @@ package org.elasticsearch.threadpool;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -30,7 +31,7 @@ import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class ThreadPoolInfo implements Writeable, Iterable<ThreadPool.Info>, ToXContent {
|
||||
public class ThreadPoolInfo implements Writeable, Iterable<ThreadPool.Info>, ToXContentFragment {
|
||||
|
||||
private final List<ThreadPool.Info> infos;
|
||||
|
||||
|
@ -23,6 +23,7 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -30,9 +31,9 @@ import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class ThreadPoolStats implements Writeable, ToXContent, Iterable<ThreadPoolStats.Stats> {
|
||||
public class ThreadPoolStats implements Writeable, ToXContentFragment, Iterable<ThreadPoolStats.Stats> {
|
||||
|
||||
public static class Stats implements Writeable, ToXContent, Comparable<Stats> {
|
||||
public static class Stats implements Writeable, ToXContentFragment, Comparable<Stats> {
|
||||
|
||||
private final String name;
|
||||
private final int threads;
|
||||
|
@ -23,7 +23,8 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -34,7 +35,7 @@ import java.util.Objects;
|
||||
* This class encapsulates all remote cluster information to be rendered on
|
||||
* <tt>_remote/info</tt> requests.
|
||||
*/
|
||||
public final class RemoteConnectionInfo implements ToXContent, Writeable {
|
||||
public final class RemoteConnectionInfo implements ToXContentFragment, Writeable {
|
||||
final List<TransportAddress> seedNodes;
|
||||
final List<TransportAddress> httpAddresses;
|
||||
final int connectionsPerCluster;
|
||||
|
@ -24,14 +24,15 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.transport.BoundTransportAddress;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TransportInfo implements Writeable, ToXContent {
|
||||
public class TransportInfo implements Writeable, ToXContentFragment {
|
||||
|
||||
private BoundTransportAddress address;
|
||||
private Map<String, BoundTransportAddress> profileAddresses;
|
||||
|
@ -23,12 +23,13 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class TransportStats implements Writeable, ToXContent {
|
||||
public class TransportStats implements Writeable, ToXContentFragment {
|
||||
|
||||
private final long serverOpen;
|
||||
private final long rxCount;
|
||||
|
@ -45,7 +45,8 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.plugins.ActionPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
@ -108,7 +109,7 @@ public class TestTaskPlugin extends Plugin implements ActionPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
public static class NodesResponse extends BaseNodesResponse<NodeResponse> implements ToXContent {
|
||||
public static class NodesResponse extends BaseNodesResponse<NodeResponse> implements ToXContentFragment {
|
||||
|
||||
NodesResponse() {
|
||||
|
||||
|
@ -22,7 +22,8 @@ package org.elasticsearch.test.rest.yaml;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.ToXContent.Params;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -38,7 +39,7 @@ import java.util.regex.Pattern;
|
||||
* Allows to cache the last obtained test response and or part of it within variables
|
||||
* that can be used as input values in following requests and assertions.
|
||||
*/
|
||||
public class Stash implements ToXContent {
|
||||
public class Stash implements ToXContentFragment {
|
||||
private static final Pattern EXTENDED_KEY = Pattern.compile("\\$\\{([^}]+)\\}");
|
||||
private static final Pattern PATH = Pattern.compile("\\$_path");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user