|
@@ -22,6 +22,7 @@ public final class LogsDBFeatureSetUsage extends XPackFeatureUsage {
|
|
|
private final int indicesWithSyntheticSource;
|
|
|
private final long numDocs;
|
|
|
private final long sizeInBytes;
|
|
|
+ private final boolean hasCustomCutoffDate;
|
|
|
|
|
|
public LogsDBFeatureSetUsage(StreamInput input) throws IOException {
|
|
|
super(input);
|
|
@@ -34,6 +35,13 @@ public final class LogsDBFeatureSetUsage extends XPackFeatureUsage {
|
|
|
numDocs = 0;
|
|
|
sizeInBytes = 0;
|
|
|
}
|
|
|
+ var transportVersion = input.getTransportVersion();
|
|
|
+ if (transportVersion.isPatchFrom(TransportVersions.LOGSDB_TELEMETRY_CUSTOM_CUTOFF_DATE_FIX_8_17)
|
|
|
+ || transportVersion.onOrAfter(TransportVersions.LOGSDB_TELEMETRY_CUSTOM_CUTOFF_DATE)) {
|
|
|
+ hasCustomCutoffDate = input.readBoolean();
|
|
|
+ } else {
|
|
|
+ hasCustomCutoffDate = false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -45,6 +53,11 @@ public final class LogsDBFeatureSetUsage extends XPackFeatureUsage {
|
|
|
out.writeVLong(numDocs);
|
|
|
out.writeVLong(sizeInBytes);
|
|
|
}
|
|
|
+ var transportVersion = out.getTransportVersion();
|
|
|
+ if (transportVersion.isPatchFrom(TransportVersions.LOGSDB_TELEMETRY_CUSTOM_CUTOFF_DATE_FIX_8_17)
|
|
|
+ || transportVersion.onOrAfter(TransportVersions.LOGSDB_TELEMETRY_CUSTOM_CUTOFF_DATE)) {
|
|
|
+ out.writeBoolean(hasCustomCutoffDate);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public LogsDBFeatureSetUsage(
|
|
@@ -53,13 +66,15 @@ public final class LogsDBFeatureSetUsage extends XPackFeatureUsage {
|
|
|
int indicesCount,
|
|
|
int indicesWithSyntheticSource,
|
|
|
long numDocs,
|
|
|
- long sizeInBytes
|
|
|
+ long sizeInBytes,
|
|
|
+ boolean hasCustomCutoffDate
|
|
|
) {
|
|
|
super(XPackField.LOGSDB, available, enabled);
|
|
|
this.indicesCount = indicesCount;
|
|
|
this.indicesWithSyntheticSource = indicesWithSyntheticSource;
|
|
|
this.numDocs = numDocs;
|
|
|
this.sizeInBytes = sizeInBytes;
|
|
|
+ this.hasCustomCutoffDate = hasCustomCutoffDate;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -74,11 +89,12 @@ public final class LogsDBFeatureSetUsage extends XPackFeatureUsage {
|
|
|
builder.field("indices_with_synthetic_source", indicesWithSyntheticSource);
|
|
|
builder.field("num_docs", numDocs);
|
|
|
builder.field("size_in_bytes", sizeInBytes);
|
|
|
+ builder.field("has_custom_cutoff_date", hasCustomCutoffDate);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int hashCode() {
|
|
|
- return Objects.hash(available, enabled, indicesCount, indicesWithSyntheticSource, numDocs, sizeInBytes);
|
|
|
+ return Objects.hash(available, enabled, indicesCount, indicesWithSyntheticSource, numDocs, sizeInBytes, hasCustomCutoffDate);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -95,6 +111,7 @@ public final class LogsDBFeatureSetUsage extends XPackFeatureUsage {
|
|
|
&& Objects.equals(indicesCount, other.indicesCount)
|
|
|
&& Objects.equals(indicesWithSyntheticSource, other.indicesWithSyntheticSource)
|
|
|
&& Objects.equals(numDocs, other.numDocs)
|
|
|
- && Objects.equals(sizeInBytes, other.sizeInBytes);
|
|
|
+ && Objects.equals(sizeInBytes, other.sizeInBytes)
|
|
|
+ && Objects.equals(hasCustomCutoffDate, other.hasCustomCutoffDate);
|
|
|
}
|
|
|
}
|