|
@@ -27,6 +27,7 @@ import org.elasticsearch.common.Nullable;
|
|
|
import org.elasticsearch.common.io.stream.StreamInput;
|
|
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
|
|
import org.elasticsearch.common.settings.Settings;
|
|
|
+import org.elasticsearch.common.unit.ByteSizeValue;
|
|
|
import org.elasticsearch.http.HttpInfo;
|
|
|
import org.elasticsearch.ingest.core.IngestInfo;
|
|
|
import org.elasticsearch.monitor.jvm.JvmInfo;
|
|
@@ -78,12 +79,16 @@ public class NodeInfo extends BaseNodeResponse {
|
|
|
@Nullable
|
|
|
private IngestInfo ingest;
|
|
|
|
|
|
+ @Nullable
|
|
|
+ private ByteSizeValue totalIndexingBuffer;
|
|
|
+
|
|
|
public NodeInfo() {
|
|
|
}
|
|
|
|
|
|
public NodeInfo(Version version, Build build, DiscoveryNode node, @Nullable Map<String, String> serviceAttributes, @Nullable Settings settings,
|
|
|
@Nullable OsInfo os, @Nullable ProcessInfo process, @Nullable JvmInfo jvm, @Nullable ThreadPoolInfo threadPool,
|
|
|
- @Nullable TransportInfo transport, @Nullable HttpInfo http, @Nullable PluginsAndModules plugins, @Nullable IngestInfo ingest) {
|
|
|
+ @Nullable TransportInfo transport, @Nullable HttpInfo http, @Nullable PluginsAndModules plugins, @Nullable IngestInfo ingest,
|
|
|
+ ByteSizeValue totalIndexingBuffer) {
|
|
|
super(node);
|
|
|
this.version = version;
|
|
|
this.build = build;
|
|
@@ -97,6 +102,7 @@ public class NodeInfo extends BaseNodeResponse {
|
|
|
this.http = http;
|
|
|
this.plugins = plugins;
|
|
|
this.ingest = ingest;
|
|
|
+ this.totalIndexingBuffer = totalIndexingBuffer;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -186,6 +192,11 @@ public class NodeInfo extends BaseNodeResponse {
|
|
|
return ingest;
|
|
|
}
|
|
|
|
|
|
+ @Nullable
|
|
|
+ public ByteSizeValue getTotalIndexingBuffer() {
|
|
|
+ return totalIndexingBuffer;
|
|
|
+ }
|
|
|
+
|
|
|
public static NodeInfo readNodeInfo(StreamInput in) throws IOException {
|
|
|
NodeInfo nodeInfo = new NodeInfo();
|
|
|
nodeInfo.readFrom(in);
|
|
@@ -197,6 +208,7 @@ public class NodeInfo extends BaseNodeResponse {
|
|
|
super.readFrom(in);
|
|
|
version = Version.readVersion(in);
|
|
|
build = Build.readBuild(in);
|
|
|
+ totalIndexingBuffer = new ByteSizeValue(in.readLong());
|
|
|
if (in.readBoolean()) {
|
|
|
Map<String, String> builder = new HashMap<>();
|
|
|
int size = in.readVInt();
|
|
@@ -240,6 +252,11 @@ public class NodeInfo extends BaseNodeResponse {
|
|
|
super.writeTo(out);
|
|
|
out.writeVInt(version.id);
|
|
|
Build.writeBuild(build, out);
|
|
|
+ if (totalIndexingBuffer == null) {
|
|
|
+ out.writeLong(0);
|
|
|
+ } else {
|
|
|
+ out.writeLong(totalIndexingBuffer.bytes());
|
|
|
+ }
|
|
|
if (getServiceAttributes() == null) {
|
|
|
out.writeBoolean(false);
|
|
|
} else {
|