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


Java StreamOutput.writeBytesReference方法代码示例

本文整理汇总了Java中org.elasticsearch.common.io.stream.StreamOutput.writeBytesReference方法的典型用法代码示例。如果您正苦于以下问题:Java StreamOutput.writeBytesReference方法的具体用法?Java StreamOutput.writeBytesReference怎么用?Java StreamOutput.writeBytesReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.common.io.stream.StreamOutput的用法示例。


在下文中一共展示了StreamOutput.writeBytesReference方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(SERIALIZATION_FORMAT);
    out.writeString(id);
    out.writeString(type);
    out.writeBytesReference(source);
    if (routing == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeString(routing);
    }
    if (parent == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeString(parent);
    }
    out.writeLong(version);
    out.writeLong(timestamp);
    out.writeLong(ttl);
    out.writeByte(versionType.getValue());
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:24,代码来源:Translog.java

示例2: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVLong(startTime);
    out.writeString(documentType);
    out.writeOptionalString(routing);
    out.writeOptionalString(preference);
    out.writeBytesReference(source);
    out.writeBytesReference(docSource);
    if (getRequest != null) {
        out.writeBoolean(true);
        getRequest.writeTo(out);
    } else {
        out.writeBoolean(false);
    }
    out.writeBoolean(onlyCount);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:PercolateRequest.java

示例3: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(mappings.size());
    for (Map.Entry<String, Map<String, Map<String, FieldMappingMetaData>>> indexEntry : mappings.entrySet()) {
        out.writeString(indexEntry.getKey());
        out.writeVInt(indexEntry.getValue().size());
        for (Map.Entry<String, Map<String, FieldMappingMetaData>> typeEntry : indexEntry.getValue().entrySet()) {
            out.writeString(typeEntry.getKey());
            out.writeVInt(typeEntry.getValue().size());
            for (Map.Entry<String, FieldMappingMetaData> fieldEntry : typeEntry.getValue().entrySet()) {
                out.writeString(fieldEntry.getKey());
                FieldMappingMetaData fieldMapping = fieldEntry.getValue();
                out.writeString(fieldMapping.fullName());
                out.writeBytesReference(fieldMapping.source);
            }
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:20,代码来源:GetFieldMappingsResponse.java

示例4: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(type);
    out.writeString(id);
    out.writeOptionalString(routing);
    out.writeOptionalString(preference);
    out.writeBytesReference(source);
    out.writeStringArray(filteringAlias);
    if (fields != null) {
        out.writeBoolean(true);
        out.writeStringArray(fields);
    } else {
        out.writeBoolean(false);
    }

    FetchSourceContext.optionalWriteToStream(fetchSourceContext, out);
    out.writeVLong(nowInMillis);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:20,代码来源:ExplainRequest.java

示例5: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(index);
    out.writeString(type);
    out.writeString(id);
    out.writeVLong(docVersion);
    final boolean docExists = isExists();
    out.writeBoolean(docExists);
    out.writeBoolean(artificial);
    out.writeVLong(tookInMillis);
    out.writeBoolean(hasTermVectors());
    if (hasTermVectors()) {
        out.writeBytesReference(headerRef);
        out.writeBytesReference(termVectors);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:TermVectorsResponse.java

示例6: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeLong(recoveryId);
    shardId.writeTo(out);
    out.writeString(metaData.name());
    out.writeVLong(position);
    out.writeVLong(metaData.length());
    out.writeString(metaData.checksum());
    out.writeBytesReference(content);
    out.writeString(metaData.writtenBy().toString());
    out.writeBoolean(lastChunk);
    out.writeVInt(totalTranslogOps);
    out.writeLong(sourceThrottleTimeInNanos);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:RecoveryFileChunkRequest.java

示例7: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    if (out.getVersion().before(Version.V_2_3_0)) {
        out.writeString(type);
    } else {
        out.writeOptionalString(type);
    }
    out.writeOptionalString(id);
    out.writeOptionalString(routing);
    out.writeOptionalString(parent);
    out.writeOptionalString(timestamp);
    if (out.getVersion().before(Version.V_2_2_0)) {
        if (ttl == null) {
            out.writeLong(-1);
        } else {
            out.writeLong(ttl.millis());
        }
    } else {
        if(ttl == null) {
            out.writeBoolean(false);
        } else {
            out.writeBoolean(true);
            ttl.writeTo(out);
        }
    }
    out.writeBytesReference(source);
    out.writeByte(opType.id());
    out.writeBoolean(refresh);
    out.writeLong(version);
    out.writeByte(versionType.getValue());
    out.writeBoolean(autoGeneratedId);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:34,代码来源:IndexRequest.java

示例8: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeLong(recoveryId);
    shardId.writeTo(out);
    out.writeString(metaData.name());
    out.writeVLong(position);
    out.writeVLong(metaData.length());
    out.writeOptionalString(metaData.checksum());
    out.writeBytesReference(content);
    out.writeOptionalString(metaData.writtenBy() == null ? null : metaData.writtenBy().toString());
    out.writeBoolean(lastChunk);
    out.writeVInt(totalTranslogOps);
    out.writeLong(sourceThrottleTimeInNanos);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:16,代码来源:RecoveryFileChunkRequest.java

示例9: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(id);
    out.writeBytesReference(config);
    if (out.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
        xContentType.writeTo(out);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:PipelineConfiguration.java

示例10: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeOptionalString(routing);
    out.writeOptionalString(preference);
    out.writeBytesReference(suggestSource);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:SuggestRequest.java

示例11: innerWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
protected void innerWriteTo(StreamOutput out, boolean asKey) throws IOException {
    out.writeString(index);
    out.writeVInt(shardId);
    out.writeByte(searchType.id());
    if (!asKey) {
        out.writeVInt(numberOfShards);
    }
    if (scroll == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        scroll.writeTo(out);
    }
    out.writeBytesReference(source);
    out.writeBytesReference(extraSource);
    out.writeStringArray(types);
    out.writeStringArrayNullable(filteringAliases);
    if (!asKey) {
        out.writeVLong(nowInMillis);
    }

    out.writeBytesReference(templateSource);
    boolean hasTemplate = template != null;
    out.writeBoolean(hasTemplate);
    if (hasTemplate) {
        template.writeTo(out);
    }
    out.writeOptionalBoolean(requestCache);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:30,代码来源:ShardSearchLocalRequest.java

示例12: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(aggregations.size());
    for (Aggregation aggregation : aggregations) {
        InternalAggregation internal = (InternalAggregation) aggregation;
        out.writeBytesReference(internal.type().stream());
        internal.writeTo(out);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:InternalAggregations.java

示例13: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeOptionalString(type);
    out.writeOptionalString(id);
    out.writeOptionalString(routing);
    out.writeOptionalString(parent);
    if (out.getVersion().before(Version.V_6_0_0_alpha1_UNRELEASED)) {
        // Serialize a fake timestamp. 5.x expect this value to be set by the #process method so we can't use null.
        // On the other hand, indices created on 5.x do not index the timestamp field.  Therefore passing a 0 (or any value) for
        // the transport layer OK as it will be ignored.
        out.writeOptionalString("0");
        out.writeOptionalWriteable(null);
    }
    out.writeBytesReference(source);
    out.writeByte(opType.getId());
    // ES versions below 5.1.2 don't know about resolveVersionDefaults but resolve the version eagerly (which messes with validation).
    if (out.getVersion().before(Version.V_5_1_2_UNRELEASED)) {
        out.writeLong(resolveVersionDefaults());
    } else {
        out.writeLong(version);
    }
    out.writeByte(versionType.getValue());
    out.writeOptionalString(pipeline);
    out.writeBoolean(isRetry);
    out.writeLong(autoGeneratedTimestamp);
    if (out.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
        out.writeOptionalWriteable(contentType);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:31,代码来源:IndexRequest.java

示例14: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVLong(transferId);
    out.writeBytesReference(content);
    out.writeBoolean(isLast);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:BlobRecoveryChunkRequest.java

示例15: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(digests.length);
    for (int i = 0; i < digests.length; i++) {
        out.writeBytesReference(digests[i]);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:BlobRecoveryDeleteRequest.java


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