當前位置: 首頁>>代碼示例>>Java>>正文


Java StreamOutput.writeOptionalString方法代碼示例

本文整理匯總了Java中org.elasticsearch.common.io.stream.StreamOutput.writeOptionalString方法的典型用法代碼示例。如果您正苦於以下問題:Java StreamOutput.writeOptionalString方法的具體用法?Java StreamOutput.writeOptionalString怎麽用?Java StreamOutput.writeOptionalString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.elasticsearch.common.io.stream.StreamOutput的用法示例。


在下文中一共展示了StreamOutput.writeOptionalString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(index);
    out.writeOptionalString(type);
    out.writeString(id);
    out.writeOptionalString(routing);
    if (fields == null) {
        out.writeVInt(0);
    } else {
        out.writeVInt(fields.length);
        for (String field : fields) {
            out.writeString(field);
        }
    }

    out.writeLong(version);
    out.writeByte(versionType.getValue());

    FetchSourceContext.optionalWriteToStream(fetchSourceContext, out);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:21,代碼來源:MultiGetRequest.java

示例2: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeLong(pid);
    out.writeString(version);
    out.writeString(vmName);
    out.writeString(vmVersion);
    out.writeString(vmVendor);
    out.writeLong(startTime);
    out.writeInt(inputArguments.length);
    for (String inputArgument : inputArguments) {
        out.writeString(inputArgument);
    }
    out.writeString(bootClassPath);
    out.writeString(classPath);
    out.writeInt(systemProperties.size());
    for (Map.Entry<String, String> entry : systemProperties.entrySet()) {
        out.writeString(entry.getKey());
        out.writeString(entry.getValue());
    }
    mem.writeTo(out);
    out.writeStringArray(gcCollectors);
    out.writeStringArray(memoryPools);
    if (out.getVersion().onOrAfter(Version.V_2_2_0)) {
        out.writeOptionalString(useCompressedOops);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:27,代碼來源:JvmInfo.java

示例3: writeStackTraces

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
/**
 * Serializes the given exceptions stacktrace elements as well as it's suppressed exceptions to the given output stream.
 */
public static <T extends Throwable> T writeStackTraces(T throwable, StreamOutput out) throws IOException {
    StackTraceElement[] stackTrace = throwable.getStackTrace();
    out.writeVInt(stackTrace.length);
    for (StackTraceElement element : stackTrace) {
        out.writeString(element.getClassName());
        out.writeOptionalString(element.getFileName());
        out.writeString(element.getMethodName());
        out.writeVInt(element.getLineNumber());
    }
    Throwable[] suppressed = throwable.getSuppressed();
    out.writeVInt(suppressed.length);
    for (Throwable t : suppressed) {
        out.writeThrowable(t);
    }
    return throwable;
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:20,代碼來源:ElasticsearchException.java

示例4: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeString(fieldName);
    boolean hasShape = shape != null;
    out.writeBoolean(hasShape);
    if (hasShape) {
        out.writeNamedWriteable(shape);
    } else {
        out.writeOptionalString(indexedShapeId);
        out.writeOptionalString(indexedShapeType);
        out.writeOptionalString(indexedShapeIndex);
        out.writeOptionalString(indexedShapePath);
    }
    relation.writeTo(out);
    out.writeOptionalWriteable(strategy);
    out.writeBoolean(ignoreUnmapped);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:18,代碼來源:GeoShapeQueryBuilder.java

示例5: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeByte(actionType.value());
    out.writeOptionalString(index);
    out.writeOptionalString(alias);
    out.writeOptionalString(filter);
    out.writeOptionalString(indexRouting);
    out.writeOptionalString(searchRouting);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:10,代碼來源:AliasAction.java

示例6: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(getIndex());
    out.writeString(getType());
    out.writeOptionalString(getId());
    out.writeThrowable(getCause());
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:8,代碼來源:BulkItemResponse.java

示例7: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    writeQueries(out, mustClauses);
    writeQueries(out, mustNotClauses);
    writeQueries(out, shouldClauses);
    writeQueries(out, filterClauses);
    out.writeBoolean(adjustPureNegative);
    out.writeBoolean(disableCoord);
    out.writeOptionalString(minimumShouldMatch);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:11,代碼來源:BoolQueryBuilder.java

示例8: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeOptionalString(id);
    out.writeBoolean(verbose);
    out.writeBytesReference(source);
    if (out.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
        xContentType.writeTo(out);
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:11,代碼來源:SimulatePipelineRequest.java

示例9: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeOptionalString(preference);
    out.writeVInt(requests.size());
    for (TermVectorsRequest termVectorsRequest : requests) {
        termVectorsRequest.writeTo(out);
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:10,代碼來源:MultiTermVectorsRequest.java

示例10: 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

示例11: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public final void writeTo(StreamOutput out) throws IOException {
    out.writeString(field);
    out.writeOptionalString(text);
    out.writeOptionalString(prefix);
    out.writeOptionalString(regex);
    out.writeOptionalString(analyzer);
    out.writeOptionalVInt(size);
    out.writeOptionalVInt(shardSize);
    doWriteTo(out);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:SuggestionBuilder.java

示例12: 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

示例13: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeOptionalString(pipelineId);
    out.writeBoolean(verbose);
    out.writeVInt(results.size());
    for (SimulateDocumentResult response : results) {
        response.writeTo(out);
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:11,代碼來源:SimulatePipelineResponse.java

示例14: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(type());
    source().writeTo(out);
    // routing
    out.writeBoolean(routing().required());
    if (out.getVersion().before(Version.V_6_0_0_alpha1_UNRELEASED)) {
        // timestamp
        out.writeBoolean(false); // enabled
        out.writeString(DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.format());
        out.writeOptionalString("now"); // 5.x default
        out.writeOptionalBoolean(null);
    }
    out.writeBoolean(hasParentField());
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:16,代碼來源:MappingMetaData.java

示例15: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeOptionalString(failureReason);
    out.writeInt(shardResponses.size());
    for (Map.Entry<ShardRouting, SyncedFlushService.ShardSyncedFlushResponse> entry : shardResponses.entrySet()) {
        entry.getKey().writeTo(out);
        entry.getValue().writeTo(out);
    }
    out.writeOptionalString(syncId);
    shardId.writeTo(out);
    out.writeInt(totalShards);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:13,代碼來源:ShardsSyncedFlushResult.java


注:本文中的org.elasticsearch.common.io.stream.StreamOutput.writeOptionalString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。