本文整理了Java中com.yahoo.component.Version.toString()
方法的一些代码示例,展示了Version.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.toString()
方法的具体详情如下:
包路径:com.yahoo.component.Version
类名称:Version
方法名:toString
[英]Returns the string representation of this version identifier as major.minor.micro.qualifier, omitting the remaining parts after reaching the first unspecified component. Unspecified version component is equivalent to 0 (or the empty string for qualifier).
The string representation of a Version specified here is a part of the API and will never change.
[中]将此版本标识符的字符串表示形式返回为主。少数的微型的。限定符,省略到达第一个未指定组件后的剩余部分。未指定的版本组件相当于0(或限定符的空字符串)。
此处指定的版本的字符串表示是API的一部分,永远不会更改。
代码示例来源:origin: com.yahoo.vespa/container-search
private void traceVespaVersion(Query query) {
query.trace("Vespa version: " + Vtag.currentVersion.toString(), false, 4);
}
代码示例来源:origin: com.yahoo.vespa/messagebus
@Override
public void invoke(Request request) {
request.returnValues().add(new StringValue(getVersion().toString()));
}
代码示例来源:origin: com.yahoo.vespa/node-repository
private void toSlime(Node node, Cursor object) {
object.setString(hostnameKey, node.hostname());
toSlime(node.ipAddresses(), object.setArray(ipAddressesKey), IP::requireAddresses);
toSlime(node.ipAddressPool().asSet(), object.setArray(ipAddressPoolKey), IP::requireAddressPool);
object.setString(idKey, node.id());
node.parentHostname().ifPresent(hostname -> object.setString(parentHostnameKey, hostname));
object.setString(flavorKey, node.flavor().name());
object.setLong(rebootGenerationKey, node.status().reboot().wanted());
object.setLong(currentRebootGenerationKey, node.status().reboot().current());
node.status().vespaVersion().ifPresent(version -> object.setString(vespaVersionKey, version.toString()));
object.setLong(failCountKey, node.status().failCount());
node.status().hardwareFailureDescription().ifPresent(failure -> object.setString(hardwareFailureKey, failure));
object.setBool(wantToRetireKey, node.status().wantToRetire());
object.setBool(wantToDeprovisionKey, node.status().wantToDeprovision());
node.allocation().ifPresent(allocation -> toSlime(allocation, object.setObject(instanceKey)));
toSlime(node.history(), object.setArray(historyKey));
object.setString(nodeTypeKey, toString(node.type()));
node.status().hardwareDivergence().ifPresent(hardwareDivergence -> object.setString(hardwareDivergenceKey,
hardwareDivergence));
node.status().osVersion().ifPresent(version -> object.setString(osVersionKey, version.toString()));
node.status().firmwareVerifiedAt().ifPresent(instant -> object.setLong(firmwareCheckKey, instant.toEpochMilli()));
node.reports().toSlime(object, reportsKey);
}
代码示例来源:origin: com.yahoo.vespa/node-repository
private void toSlime(Allocation allocation, Cursor object) {
object.setString(tenantIdKey, allocation.owner().tenant().value());
object.setString(applicationIdKey, allocation.owner().application().value());
object.setString(instanceIdKey, allocation.owner().instance().value());
object.setString(serviceIdKey, allocation.membership().stringValue());
object.setLong(restartGenerationKey, allocation.restartGeneration().wanted());
object.setLong(currentRestartGenerationKey, allocation.restartGeneration().current());
object.setBool(removableKey, allocation.isRemovable());
object.setString(wantedVespaVersionKey, allocation.membership().cluster().vespaVersion().toString());
}
代码示例来源:origin: com.yahoo.vespa/messagebus
@Override
protected Request encodeRequest(Version version, Route route, RPCServiceAddress address, Message msg,
long timeRemaining, byte[] payload, int traceLevel) {
Request req = new Request(METHOD_NAME);
Values v = req.parameters();
v.add(new StringValue(version.toString()));
v.add(new StringValue(route.toString()));
v.add(new StringValue(address.getSessionName()));
v.add(new Int8Value(msg.getRetryEnabled() ? (byte)1 : (byte)0));
v.add(new Int32Value(msg.getRetry()));
v.add(new Int64Value(timeRemaining));
v.add(new StringValue(msg.getProtocol()));
v.add(new DataValue(payload));
v.add(new Int32Value(traceLevel));
return req;
}
代码示例来源:origin: com.yahoo.vespa/messagebus
@Override
protected void createResponse(Values ret, Reply reply, Version version, byte [] payload) {
int[] eCodes = new int[reply.getNumErrors()];
String[] eMessages = new String[reply.getNumErrors()];
String[] eServices = new String[reply.getNumErrors()];
for (int i = 0; i < reply.getNumErrors(); ++i) {
Error error = reply.getError(i);
eCodes[i] = error.getCode();
eMessages[i] = error.getMessage();
eServices[i] = error.getService() != null ? error.getService() : "";
}
ret.add(new StringValue(version.toString()));
ret.add(new DoubleValue(reply.getRetryDelay()));
ret.add(new Int32Array(eCodes));
ret.add(new StringArray(eMessages));
ret.add(new StringArray(eServices));
ret.add(new StringValue(reply.getProtocol()));
ret.add(new DataValue(payload));
ret.add(new StringValue(reply.getTrace().getRoot() != null ? reply.getTrace().getRoot().encode() : ""));
}
代码示例来源:origin: com.yahoo.vespa/messagebus
@Override
protected Request encodeRequest(Version version, Route route, RPCServiceAddress address, Message msg,
long timeRemaining, byte[] payload, int traceLevel)
{
Request req = new Request(METHOD_NAME);
Values v = req.parameters();
v.add(new Int8Value(CompressionType.NONE.getCode()));
v.add(new Int32Value(0));
v.add(new DataValue(new byte[0]));
Slime slime = new Slime();
Cursor root = slime.setObject();
root.setString(VERSION_F, version.toString());
root.setString(ROUTE_F, route.toString());
root.setString(SESSION_F, address.getSessionName());
root.setString(PROTOCOL_F, msg.getProtocol().toString());
root.setBool(USERETRY_F, msg.getRetryEnabled());
root.setLong(RETRY_F, msg.getRetry());
root.setLong(TIMEREMAINING_F, msg.getTimeRemaining());
root.setLong(TRACELEVEL_F, traceLevel);
root.setData(BLOB_F, payload);
byte[] serializedSlime = BinaryFormat.encode(slime);
Compressor.Compression compressionResult = compressor.compress(serializedSlime);
v.add(new Int8Value(compressionResult.type().getCode()));
v.add(new Int32Value(compressionResult.uncompressedSize()));
v.add(new DataValue(compressionResult.data()));
return req;
}
代码示例来源:origin: com.yahoo.vespa/messagebus
Cursor root = slime.setObject();
root.setString(VERSION_F, version.toString());
root.setDouble(RETRYDELAY_F, reply.getRetryDelay());
root.setString(PROTOCOL_F, reply.getProtocol().toString());
内容来源于网络,如有侵权,请联系作者删除!