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


Java Version.readVersion方法代码示例

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


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

示例1: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    version = Version.readVersion(in);
    build = Build.readBuild(in);
    if (in.readBoolean()) {
        totalIndexingBuffer = new ByteSizeValue(in.readLong());
    } else {
        totalIndexingBuffer = null;
    }
    if (in.readBoolean()) {
        settings = Settings.readSettingsFromStream(in);
    }
    os = in.readOptionalWriteable(OsInfo::new);
    process = in.readOptionalWriteable(ProcessInfo::new);
    jvm = in.readOptionalWriteable(JvmInfo::new);
    threadPool = in.readOptionalWriteable(ThreadPoolInfo::new);
    transport = in.readOptionalWriteable(TransportInfo::new);
    http = in.readOptionalWriteable(HttpInfo::new);
    plugins = in.readOptionalWriteable(PluginsAndModules::new);
    ingest = in.readOptionalWriteable(IngestInfo::new);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:23,代码来源:NodeInfo.java

示例2: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    id = in.readString();
    int assignmentsSize = in.readVInt();
    if (assignmentsSize > 0) {
        updateAssignments = new Symbol[assignmentsSize];
        for (int i = 0; i < assignmentsSize; i++) {
            updateAssignments[i] = Symbol.fromStream(in);
        }
    }
    int missingAssignmentsSize = in.readVInt();
    if (missingAssignmentsSize > 0) {
        this.insertValues = new Object[missingAssignmentsSize];
        for (int i = 0; i < missingAssignmentsSize; i++) {
            insertValues[i] = insertValuesStreamer[i].readValueFrom(in);
        }
    }
    this.version = Version.readVersion(in).id;
    versionType = VersionType.fromValue(in.readByte());
    opType = IndexRequest.OpType.fromId(in.readByte());
    if (in.readBoolean()) {
        source = in.readBytesReference();
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:25,代码来源:ShardUpsertRequest.java

示例3: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    discoveryNode = in.readOptionalWriteable(DiscoveryNode::new);
    clusterName = new ClusterName(in);
    version = Version.readVersion(in);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:TransportService.java

示例4: DiscoveryNode

import org.elasticsearch.Version; //导入方法依赖的package包/类
/**
 * Creates a new {@link DiscoveryNode} by reading from the stream provided as argument
 * @param in the stream
 * @throws IOException if there is an error while reading from the stream
 */
public DiscoveryNode(StreamInput in) throws IOException {
    this.nodeName = in.readString().intern();
    this.nodeId = in.readString().intern();
    this.ephemeralId = in.readString().intern();
    this.hostName = in.readString().intern();
    this.hostAddress = in.readString().intern();
    if (in.getVersion().onOrAfter(Version.V_5_0_3_UNRELEASED)) {
        this.address = new TransportAddress(in);
    } else {
        // we need to do this to preserve the host information during pinging and joining of a master. Since the version of the
        // DiscoveryNode is set to Version#minimumCompatibilityVersion(), the host information gets lost as we do not serialize the
        // hostString for the address
        this.address = new TransportAddress(in, hostName);
    }
    int size = in.readVInt();
    this.attributes = new HashMap<>(size);
    for (int i = 0; i < size; i++) {
        this.attributes.put(in.readString(), in.readString());
    }
    int rolesSize = in.readVInt();
    this.roles = EnumSet.noneOf(Role.class);
    for (int i = 0; i < rolesSize; i++) {
        int ordinal = in.readVInt();
        if (ordinal < 0 || ordinal >= Role.values().length) {
            throw new IOException("Unknown Role ordinal [" + ordinal + "]");
        }
        this.roles.add(Role.values()[ordinal]);
    }
    this.version = Version.readVersion(in);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:36,代码来源:DiscoveryNode.java

示例5: SnapshotInfo

import org.elasticsearch.Version; //导入方法依赖的package包/类
/**
 * Constructs snapshot information from stream input
 */
public SnapshotInfo(final StreamInput in) throws IOException {
    snapshotId = new SnapshotId(in);
    int size = in.readVInt();
    List<String> indicesListBuilder = new ArrayList<>();
    for (int i = 0; i < size; i++) {
        indicesListBuilder.add(in.readString());
    }
    indices = Collections.unmodifiableList(indicesListBuilder);
    state = SnapshotState.fromValue(in.readByte());
    reason = in.readOptionalString();
    startTime = in.readVLong();
    endTime = in.readVLong();
    totalShards = in.readVInt();
    successfulShards = in.readVInt();
    size = in.readVInt();
    if (size > 0) {
        List<SnapshotShardFailure> failureBuilder = new ArrayList<>();
        for (int i = 0; i < size; i++) {
            failureBuilder.add(SnapshotShardFailure.readSnapshotShardFailure(in));
        }
        shardFailures = Collections.unmodifiableList(failureBuilder);
    } else {
        shardFailures = Collections.emptyList();
    }
    if (in.getVersion().before(VERSION_INCOMPATIBLE_INTRODUCED)) {
        version = Version.readVersion(in);
    } else {
        version = in.readBoolean() ? Version.readVersion(in) : null;
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:34,代码来源:SnapshotInfo.java

示例6: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    int size = in.readVInt();
    versions = new HashMap<>();
    for (int i=0; i<size; i++) {
        String index = in.readString();
        Version upgradeVersion = Version.readVersion(in);
        String oldestLuceneSegment = in.readString();
        versions.put(index, new Tuple<>(upgradeVersion, oldestLuceneSegment));
    }
    readTimeout(in);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:14,代码来源:UpgradeSettingsRequest.java

示例7: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    shardId = ShardId.readShardId(in);
    primary = in.readBoolean();
    upgradeVersion = Version.readVersion(in);
    try {
        oldestLuceneSegment = org.apache.lucene.util.Version.parse(in.readString());
    } catch (ParseException ex) {
        throw new IOException("failed to parse lucene version [" + oldestLuceneSegment + "]", ex);
    }

}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:13,代码来源:ShardUpgradeResult.java

示例8: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    int size = in.readVInt();
    versions = new HashMap<>();
    for (int i=0; i<size; i++) {
        String index = in.readString();
        Version upgradeVersion = Version.readVersion(in);
        String oldestLuceneSegment = in.readString();
        versions.put(index, new Tuple<>(upgradeVersion, oldestLuceneSegment));
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:13,代码来源:UpgradeResponse.java

示例9: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    nodeName = in.readString();
    version = Version.readVersion(in);
    clusterName = new ClusterName(in);
    clusterUuid = in.readString();
    build = Build.readBuild(in);
    available = in.readBoolean();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:MainResponse.java

示例10: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    nodeName = in.readString().intern();
    nodeId = in.readString().intern();
    hostName = in.readString().intern();
    hostAddress = in.readString().intern();
    address = TransportAddressSerializers.addressFromStream(in);
    int size = in.readVInt();
    ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
    for (int i = 0; i < size; i++) {
        builder.put(in.readString().intern(), in.readString().intern());
    }
    attributes = builder.build();
    version = Version.readVersion(in);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:16,代码来源:DiscoveryNode.java

示例11: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    int size = in.readVInt();
    List<String> indicesListBuilder = new ArrayList<>();
    for (int i = 0; i < size; i++) {
        indicesListBuilder.add(in.readString());
    }
    indices = Collections.unmodifiableList(indicesListBuilder);
    state = SnapshotState.fromValue(in.readByte());
    reason = in.readOptionalString();
    startTime = in.readVLong();
    endTime = in.readVLong();
    totalShards = in.readVInt();
    successfulShards = in.readVInt();
    size = in.readVInt();
    if (size > 0) {
        List<SnapshotShardFailure> failureBuilder = new ArrayList<>();
        for (int i = 0; i < size; i++) {
            failureBuilder.add(SnapshotShardFailure.readSnapshotShardFailure(in));
        }
        shardFailures = Collections.unmodifiableList(failureBuilder);
    } else {
        shardFailures = Collections.emptyList();
    }
    version = Version.readVersion(in);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:28,代码来源:SnapshotInfo.java

示例12: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    int size = in.readVInt();
    versions = newHashMap();
    for (int i=0; i<size; i++) {
        String index = in.readString();
        Version upgradeVersion = Version.readVersion(in);
        String oldestLuceneSegment = in.readString();
        versions.put(index, new Tuple<>(upgradeVersion, oldestLuceneSegment));
    }
    readTimeout(in);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:14,代码来源:UpgradeSettingsRequest.java

示例13: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    int size = in.readVInt();
    versions = newHashMap();
    for (int i=0; i<size; i++) {
        String index = in.readString();
        Version upgradeVersion = Version.readVersion(in);
        String oldestLuceneSegment = in.readString();
        versions.put(index, new Tuple<>(upgradeVersion, oldestLuceneSegment));
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:UpgradeResponse.java

示例14: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    version = Version.readVersion(in);
    build = Build.readBuild(in);
    if (in.readBoolean()) {
        ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
        int size = in.readVInt();
        for (int i = 0; i < size; i++) {
            builder.put(in.readString(), in.readString());
        }
        serviceAttributes = builder.build();
    }
    if (in.readBoolean()) {
        settings = Settings.readSettingsFromStream(in);
    }
    if (in.readBoolean()) {
        os = OsInfo.readOsInfo(in);
    }
    if (in.readBoolean()) {
        process = ProcessInfo.readProcessInfo(in);
    }
    if (in.readBoolean()) {
        jvm = JvmInfo.readJvmInfo(in);
    }
    if (in.readBoolean()) {
        threadPool = ThreadPoolInfo.readThreadPoolInfo(in);
    }
    if (in.readBoolean()) {
        transport = TransportInfo.readTransportInfo(in);
    }
    if (in.readBoolean()) {
        http = HttpInfo.readHttpInfo(in);
    }
    if (in.readBoolean()) {
        plugins = new PluginsAndModules();
        plugins.readFrom(in);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:40,代码来源:NodeInfo.java

示例15: readFrom

import org.elasticsearch.Version; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    version = Version.readVersion(in);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:TcpTransport.java


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