Java Code Examples for org.elasticsearch.common.io.stream.StreamInput#readEnum()
The following examples show how to use
org.elasticsearch.common.io.stream.StreamInput#readEnum() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StoredFeatureNormalizers.java From elasticsearch-learning-to-rank with Apache License 2.0 | 5 votes |
private FeatureNormDefinition createFromStreamInput(StreamInput input) throws IOException { Type normType = input.readEnum(Type.class); if (normType == Type.STANDARD) { return new StandardFeatureNormDefinition(input); } else if (normType == Type.MIN_MAX) { return new MinMaxFeatureNormDefinition(input); } // note the Type constructor throws on this condition as well throw new ElasticsearchException("unknown normalizer type during deserialization"); }
Example 2
Source File: ResizeRequest.java From crate with Apache License 2.0 | 5 votes |
public ResizeRequest(StreamInput in) throws IOException { super(in); targetIndexRequest = new CreateIndexRequest(in); sourceIndex = in.readString(); type = in.readEnum(ResizeType.class); copySettings = in.readOptionalBoolean(); }
Example 3
Source File: FrameBoundDefinition.java From crate with Apache License 2.0 | 5 votes |
public FrameBoundDefinition(StreamInput in) throws IOException { type = in.readEnum(FrameBound.Type.class); if (in.getVersion().onOrAfter(Version.V_4_1_0)) { value = Symbols.fromStream(in); } else { Symbol val = Symbols.nullableFromStream(in); value = val == null ? Literal.NULL : val; } }
Example 4
Source File: WindowFrameDefinition.java From crate with Apache License 2.0 | 4 votes |
public WindowFrameDefinition(StreamInput in) throws IOException { mode = in.readEnum(Mode.class); start = new FrameBoundDefinition(in); end = in.readOptionalWriteable(FrameBoundDefinition::new); }
Example 5
Source File: ConcurrentSeqNoVersioningIT.java From crate with Apache License 2.0 | 4 votes |
private static LinearizabilityChecker.Event readEvent(StreamInput input) throws IOException { return new LinearizabilityChecker.Event(input.readEnum(LinearizabilityChecker.EventType.class), input.readNamedWriteable(NamedWriteable.class), input.readInt()); }