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