Skip to content

Commit

Permalink
Add versioning support
Browse files Browse the repository at this point in the history
  • Loading branch information
dakrone committed Aug 21, 2023
1 parent 6142b4a commit 4219acf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.time.DateFormatter;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.rest.RestRequest;
Expand Down Expand Up @@ -170,7 +171,11 @@ protected Table getTableWithHeader(final RestRequest request) {
table.addCell("store.size", "sibling:pri;alias:ss,storeSize;text-align:right;desc:store size of primaries & replicas");
table.addCell("pri.store.size", "text-align:right;desc:store size of primaries");

table.addCell("dataset.size", "text-align:right;desc:total size of dataset");
if (request.getRestApiVersion() == RestApiVersion.V_7) {
table.addCell("dataset.size", "default:false;text-align:right;desc:total size of dataset");
} else {
table.addCell("dataset.size", "text-align:right;desc:total size of dataset");
}

table.addCell("completion.size", "sibling:pri;alias:cs,completionSize;default:false;text-align:right;desc:size of completion");
table.addCell("pri.completion.size", "default:false;text-align:right;desc:size of completion");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.elasticsearch.common.Table;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.util.concurrent.ListenableFuture;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.index.bulk.stats.BulkStats;
import org.elasticsearch.index.cache.query.QueryCacheStats;
Expand Down Expand Up @@ -116,7 +117,12 @@ protected Table getTableWithHeader(final RestRequest request) {
.addCell("state", "default:true;alias:st;desc:shard state")
.addCell("docs", "alias:d,dc;text-align:right;desc:number of docs in shard")
.addCell("store", "alias:sto;text-align:right;desc:store size of shard (how much disk it uses)")
.addCell("dataset", "text-align:right;desc:total size of dataset")
.addCell(
"dataset",
request.getRestApiVersion() == RestApiVersion.V_7
? "default:false;text-align:right;desc:total size of dataset"
: "text-align:right;desc:total size of dataset"
)
.addCell("ip", "default:true;desc:ip of node where it lives")
.addCell("id", "default:false;desc:unique id of node where it lives")
.addCell("node", "default:true;alias:n;desc:name of node where it lives");
Expand Down

0 comments on commit 4219acf

Please sign in to comment.