当前位置: 首页>>代码示例>>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;未经允许,请勿转载。