public void writeIndicesOptions(StreamOutput out) throws IOException { EnumSet<Option> options = this.options; // never write this out to a pre7.0 version if (out.getVersion().before(Version.V_6_6_0) && options.contains(Option.IGNORE_THROTTLED)) { options = EnumSet.copyOf(options); options.remove(Option.IGNORE_THROTTLED); } if (out.getVersion().onOrAfter(Version.V_6_4_0)) { out.writeEnumSet(options); out.writeEnumSet(expandWildcards); } else { if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha2)) { out.write(IndicesOptions.toByte(this)); } else { // if we are talking to a node that doesn't support the newly added flag (ignoreAliases) // flip to 0 all the bits starting from the 7th out.write(IndicesOptions.toByte(this) & 0x3f); } } }
static IndicesOptions fromOptions(boolean ignoreUnavailable, boolean allowNoIndices, boolean expandToOpenIndices, boolean expandToClosedIndices, boolean allowAliasesToMultipleIndices, boolean forbidClosedIndices) { byte id = toByte(ignoreUnavailable, allowNoIndices, expandToOpenIndices, expandToClosedIndices, allowAliasesToMultipleIndices, forbidClosedIndices); return VALUES[id]; }
static IndicesOptions fromOptions(boolean ignoreUnavailable, boolean allowNoIndices, boolean expandToOpenIndices, boolean expandToClosedIndices, boolean allowAliasesToMultipleIndices, boolean forbidClosedIndices) { byte id = toByte(ignoreUnavailable, allowNoIndices, expandToOpenIndices, expandToClosedIndices, allowAliasesToMultipleIndices, forbidClosedIndices); return VALUES[id]; }
public void writeIndicesOptions(StreamOutput out) throws IOException { if (out.getVersion().onOrAfter(Version.V_6_4_0)) { out.writeEnumSet(options); out.writeEnumSet(expandWildcards); } else { if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha2)) { out.write(IndicesOptions.toByte(this)); } else { // if we are talking to a node that doesn't support the newly added flag (ignoreAliases) // flip to 0 all the bits starting from the 7th out.write(IndicesOptions.toByte(this) & 0x3f); } } }
public void writeIndicesOptions(StreamOutput out) throws IOException { if (out.getVersion().onOrAfter(Version.V_6_4_0)) { out.writeEnumSet(options); out.writeEnumSet(expandWildcards); } else { if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha2)) { out.write(IndicesOptions.toByte(this)); } else { // if we are talking to a node that doesn't support the newly added flag (ignoreAliases) // flip to 0 all the bits starting from the 7th out.write(IndicesOptions.toByte(this) & 0x3f); } } }