本文整理汇总了Java中org.elasticsearch.common.io.stream.Writeable.Reader方法的典型用法代码示例。如果您正苦于以下问题:Java Writeable.Reader方法的具体用法?Java Writeable.Reader怎么用?Java Writeable.Reader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.common.io.stream.Writeable
的用法示例。
在下文中一共展示了Writeable.Reader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copyWriteable
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
/**
* Create a copy of an original {@link Writeable} object by running it through a {@link BytesStreamOutput} and
* reading it in again using a provided {@link Writeable.Reader}. The stream that is wrapped around the {@link StreamInput}
* potentially need to use a {@link NamedWriteableRegistry}, so this needs to be provided too (although it can be
* empty if the object that is streamed doesn't contain any {@link NamedWriteable} objects itself.
*/
public static <T extends Writeable> T copyWriteable(T original, NamedWriteableRegistry namedWritabelRegistry,
Writeable.Reader<T> reader) throws IOException {
try (BytesStreamOutput output = new BytesStreamOutput()) {
original.writeTo(output);
try (StreamInput in = new NamedWriteableAwareStreamInput(output.bytes().streamInput(), namedWritabelRegistry)) {
return reader.read(in);
}
}
}
示例2: registerMetaDataCustom
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
private <T extends MetaData.Custom> void registerMetaDataCustom(String name, Writeable.Reader<T> reader,
Writeable.Reader<NamedDiff> diffReader,
CheckedFunction<XContentParser, T, IOException> parser) {
namedWritables.add(new NamedWriteableRegistry.Entry(MetaData.Custom.class, name, reader));
namedWritables.add(new NamedWriteableRegistry.Entry(NamedDiff.class, name, diffReader));
namedXContents.add(new NamedXContentRegistry.Entry(MetaData.Custom.class, new ParseField(name), parser));
}
示例3: instanceReader
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
@Override
protected Writeable.Reader<InternalValueCount> instanceReader() {
return InternalValueCount::new;
}
示例4: instanceReader
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
@Override
protected Writeable.Reader<InternalStats> instanceReader() {
return InternalStats::new;
}
示例5: instanceReader
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
@Override
protected Writeable.Reader<Custom> instanceReader() {
return SnapshotsInProgress::new;
}
示例6: SearchExtSpec
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
public SearchExtSpec(String name, Writeable.Reader<? extends T> reader, CheckedFunction<XContentParser, T, IOException> parser) {
super(name, reader, parser);
}
示例7: ScoreFunctionSpec
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
public ScoreFunctionSpec(ParseField name, Writeable.Reader<T> reader, ScoreFunctionParser<T> parser) {
super(name, reader, parser);
}
示例8: getAggregatorReader
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
/**
* The reader for the {@link PipelineAggregator}.
*/
public Writeable.Reader<? extends PipelineAggregator> getAggregatorReader() {
return aggregatorReader;
}
示例9: getReader
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
/**
* The reader responsible for reading the behavior from the internode protocol.
*/
public Writeable.Reader<? extends W> getReader() {
return reader;
}
示例10: addResultReader
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
/**
* Add a reader for the shard level results of the aggregation.
*/
public PipelineAggregationSpec addResultReader(String writeableName, Writeable.Reader<? extends InternalAggregation> resultReader) {
resultReaders.put(writeableName, resultReader);
return this;
}
示例11: instanceReader
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
@Override
protected Writeable.Reader<InternalDateHistogram> instanceReader() {
return InternalDateHistogram::new;
}
示例12: instanceReader
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
@Override
protected Writeable.Reader<InternalGeoHashGrid> instanceReader() {
return InternalGeoHashGrid::new;
}
示例13: PipelineAggregationSpec
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
/**
* Specification of a {@link PipelineAggregator}.
*
* @param name holds the names by which this aggregation might be parsed. The {@link ParseField#getPreferredName()} is special as it
* is the name by under which the readers are registered. So it is the name that the {@link PipelineAggregationBuilder} and
* {@link PipelineAggregator} should return from {@link NamedWriteable#getWriteableName()}.
* @param builderReader the reader registered for this aggregation's builder. Typically a reference to a constructor that takes a
* {@link StreamInput}
* @param aggregatorReader reads the {@link PipelineAggregator} from a stream
* @param parser reads the aggregation builder from XContent
*/
public PipelineAggregationSpec(ParseField name,
Writeable.Reader<? extends PipelineAggregationBuilder> builderReader,
Writeable.Reader<? extends PipelineAggregator> aggregatorReader,
PipelineAggregator.Parser parser) {
super(name, builderReader, parser);
this.aggregatorReader = aggregatorReader;
}
示例14: SearchExtensionSpec
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
/**
* Build the spec with a {@linkplain ParseField}.
*
* @param name the name of the behavior as a {@linkplain ParseField}. The parser is registered under all names specified by the
* {@linkplain ParseField} but the reader is only registered under the {@link ParseField#getPreferredName()} so be sure that
* that is the name that W's {@link NamedWriteable#getWriteableName()} returns.
* @param reader reader that reads the behavior from the internode protocol
* @param parser parser that read the behavior from a REST request
*/
public SearchExtensionSpec(ParseField name, Writeable.Reader<? extends W> reader, P parser) {
this.name = name;
this.reader = reader;
this.parser = parser;
}
示例15: QuerySpec
import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
/**
* Specification of custom {@link Query}.
*
* @param name holds the names by which this query might be parsed. The {@link ParseField#getPreferredName()} is special as it
* is the name by under which the reader is registered. So it is the name that the query should use as its
* {@link NamedWriteable#getWriteableName()} too.
* @param reader the reader registered for this query's builder. Typically a reference to a constructor that takes a
* {@link StreamInput}
* @param parser the parser the reads the query builder from xcontent
*/
public QuerySpec(ParseField name, Writeable.Reader<T> reader, QueryParser<T> parser) {
super(name, reader, parser);
}