當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。