All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest Maven / Gradle / Ivy

There is a newer version: 8.14.1
Show newest version
/*
 * Licensed to ElasticSearch and Shay Banon under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. ElasticSearch licenses this
 * file to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.elasticsearch.action.admin.indices.stats;

import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags.Flag;
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;

import java.io.IOException;

/**
 * A request to get indices level stats. Allow to enable different stats to be returned.
 * 

*

By default, the {@link #docs(boolean)}, {@link #store(boolean)}, {@link #indexing(boolean)} * are enabled. Other stats can be enabled as well. *

*

All the stats to be returned can be cleared using {@link #clear()}, at which point, specific * stats can be enabled. */ public class IndicesStatsRequest extends BroadcastOperationRequest { private CommonStatsFlags flags = new CommonStatsFlags(); /** * Sets all flags to return all stats. */ public IndicesStatsRequest all() { flags.all(); return this; } /** * Clears all stats. */ public IndicesStatsRequest clear() { flags.clear(); return this; } /** * Document types to return stats for. Mainly affects {@link #indexing(boolean)} when * enabled, returning specific indexing stats for those types. */ public IndicesStatsRequest types(String... types) { flags.types(types); return this; } /** * Document types to return stats for. Mainly affects {@link #indexing(boolean)} when * enabled, returning specific indexing stats for those types. */ public String[] types() { return this.flags.types(); } /** * Sets specific search group stats to retrieve the stats for. Mainly affects search * when enabled. */ public IndicesStatsRequest groups(String... groups) { flags.groups(groups); return this; } public String[] groups() { return this.flags.groups(); } public IndicesStatsRequest docs(boolean docs) { flags.set(Flag.Docs, docs); return this; } public boolean docs() { return flags.isSet(Flag.Docs); } public IndicesStatsRequest store(boolean store) { flags.set(Flag.Store, store); return this; } public boolean store() { return flags.isSet(Flag.Store); } public IndicesStatsRequest indexing(boolean indexing) { flags.set(Flag.Indexing, indexing); return this; } public boolean indexing() { return flags.isSet(Flag.Indexing); } public IndicesStatsRequest get(boolean get) { flags.set(Flag.Get, get); return this; } public boolean get() { return flags.isSet(Flag.Get); } public IndicesStatsRequest search(boolean search) { flags.set(Flag.Search, search); return this; } public boolean search() { return flags.isSet(Flag.Search); } public IndicesStatsRequest merge(boolean merge) { flags.set(Flag.Merge, merge); return this; } public boolean merge() { return flags.isSet(Flag.Merge); } public IndicesStatsRequest refresh(boolean refresh) { flags.set(Flag.Refresh, refresh); return this; } public boolean refresh() { return flags.isSet(Flag.Refresh); } public IndicesStatsRequest flush(boolean flush) { flags.set(Flag.Flush, flush); return this; } public boolean flush() { return flags.isSet(Flag.Flush); } public IndicesStatsRequest warmer(boolean warmer) { flags.set(Flag.Warmer, warmer); return this; } public boolean warmer() { return flags.isSet(Flag.Warmer); } public IndicesStatsRequest filterCache(boolean filterCache) { flags.set(Flag.FilterCache, filterCache); return this; } public boolean filterCache() { return flags.isSet(Flag.FilterCache); } public IndicesStatsRequest idCache(boolean idCache) { flags.set(Flag.IdCache, idCache); return this; } public boolean idCache() { return flags.isSet(Flag.IdCache); } public IndicesStatsRequest fieldData(boolean fieldData) { flags.set(Flag.FieldData, fieldData); return this; } public boolean fieldData() { return flags.isSet(Flag.FieldData); } public IndicesStatsRequest fieldDataFields(String... fieldDataFields) { flags.fieldDataFields(fieldDataFields); return this; } public String[] fieldDataFields() { return flags.fieldDataFields(); } @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); flags.writeTo(out); } @Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); flags = CommonStatsFlags.readCommonStatsFlags(in); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy