当前位置: 首页>>代码示例>>Java>>正文


Java Writeable.Reader方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:ESTestCase.java

示例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));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:DedicatedClusterSnapshotRestoreIT.java

示例3: instanceReader

import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
@Override
protected Writeable.Reader<InternalValueCount> instanceReader() {
    return InternalValueCount::new;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:InternalValueCountTests.java

示例4: instanceReader

import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
@Override
protected Writeable.Reader<InternalStats> instanceReader() {
    return InternalStats::new;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:InternalStatsTests.java

示例5: instanceReader

import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
@Override
protected Writeable.Reader<Custom> instanceReader() {
    return SnapshotsInProgress::new;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:SnapshotsInProgressSerializationTests.java

示例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);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:4,代码来源:SearchPlugin.java

示例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);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:4,代码来源:SearchPlugin.java

示例8: getAggregatorReader

import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
/**
 * The reader for the {@link PipelineAggregator}.
 */
public Writeable.Reader<? extends PipelineAggregator> getAggregatorReader() {
    return aggregatorReader;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:SearchPlugin.java

示例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;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:SearchPlugin.java

示例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;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:SearchPlugin.java

示例11: instanceReader

import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
@Override
protected Writeable.Reader<InternalDateHistogram> instanceReader() {
    return InternalDateHistogram::new;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:InternalDateHistogramTests.java

示例12: instanceReader

import org.elasticsearch.common.io.stream.Writeable; //导入方法依赖的package包/类
@Override
protected Writeable.Reader<InternalGeoHashGrid> instanceReader() {
    return InternalGeoHashGrid::new;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:InternalGeoHashGridTests.java

示例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;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:19,代码来源:SearchPlugin.java

示例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;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:SearchPlugin.java

示例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);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:14,代码来源:SearchPlugin.java


注:本文中的org.elasticsearch.common.io.stream.Writeable.Reader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。