本文整理了Java中org.apache.ratis.thirdparty.com.google.protobuf.ByteString.isEmpty()
方法的一些代码示例,展示了ByteString.isEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteString.isEmpty()
方法的具体详情如下:
包路径:org.apache.ratis.thirdparty.com.google.protobuf.ByteString
类名称:ByteString
方法名:isEmpty
暂无
代码示例来源:origin: apache/incubator-ratis
static int getSerializedSize(LogEntryProto entry) {
return getStateMachineEntry(entry)
.filter(smEnty -> smEnty.getStateMachineData().isEmpty())
.map(StateMachineEntryProto::getLogEntryProtoSerializedSize)
.orElseGet(entry::getSerializedSize);
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!id_.isEmpty()) {
output.writeBytes(1, id_);
}
if (!getAddressBytes().isEmpty()) {
org.apache.ratis.thirdparty.com.google.protobuf.GeneratedMessageV3.writeString(output, 2, address_);
}
unknownFields.writeTo(output);
}
代码示例来源:origin: apache/incubator-ratis
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!id_.isEmpty()) {
size += org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream
.computeBytesSize(1, id_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!key_.isEmpty()) {
output.writeBytes(1, key_);
}
unknownFields.writeTo(output);
}
代码示例来源:origin: apache/incubator-ratis
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!key_.isEmpty()) {
size += org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream
.computeBytesSize(1, key_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
代码示例来源:origin: apache/incubator-ratis
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!path_.isEmpty()) {
size += org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream
.computeBytesSize(1, path_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!id_.isEmpty()) {
output.writeBytes(1, id_);
}
for (int i = 0; i < peers_.size(); i++) {
output.writeMessage(2, peers_.get(i));
}
unknownFields.writeTo(output);
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!id_.isEmpty()) {
output.writeBytes(1, id_);
}
if (!getAddressBytes().isEmpty()) {
org.apache.ratis.thirdparty.com.google.protobuf.GeneratedMessageV3.writeString(output, 2, address_);
}
unknownFields.writeTo(output);
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (found_ != false) {
output.writeBool(1, found_);
}
if (!key_.isEmpty()) {
output.writeBytes(2, key_);
}
if (!value_.isEmpty()) {
output.writeBytes(3, value_);
}
unknownFields.writeTo(output);
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!resolvedPath_.isEmpty()) {
output.writeBytes(1, resolvedPath_);
}
if (offset_ != 0L) {
output.writeUInt64(2, offset_);
}
if (!data_.isEmpty()) {
output.writeBytes(3, data_);
}
unknownFields.writeTo(output);
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!id_.isEmpty()) {
output.writeBytes(1, id_);
}
unknownFields.writeTo(output);
}
代码示例来源:origin: apache/incubator-ratis
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!content_.isEmpty()) {
size += org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream
.computeBytesSize(1, content_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!path_.isEmpty()) {
output.writeBytes(1, path_);
}
unknownFields.writeTo(output);
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!resolvedPath_.isEmpty()) {
output.writeBytes(1, resolvedPath_);
}
unknownFields.writeTo(output);
}
代码示例来源:origin: apache/incubator-ratis
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!resolvedPath_.isEmpty()) {
size += org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream
.computeBytesSize(1, resolvedPath_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
代码示例来源:origin: apache/incubator-ratis
/**
* If the given entry has state machine log entry and it has state machine data,
* build a new entry without the state machine data.
*
* @return a new entry without the state machine data if the given has state machine data;
* otherwise, return the given entry.
*/
static LogEntryProto removeStateMachineData(LogEntryProto entry) {
return getStateMachineData(entry)
.filter(stateMachineData -> !stateMachineData.isEmpty())
.map(_dummy -> rebuildLogEntryProto(entry, toStateMachineEntryProtoBuilder(entry.getSerializedSize())))
.orElse(entry);
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!stateMachineData_.isEmpty()) {
output.writeBytes(1, stateMachineData_);
}
if (logEntryProtoSerializedSize_ != 0) {
output.writeUInt32(2, logEntryProtoSerializedSize_);
}
unknownFields.writeTo(output);
}
代码示例来源:origin: hortonworks/ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getNameBytes().isEmpty()) {
org.apache.ratis.thirdparty.com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
unknownFields.writeTo(output);
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (rpcReply_ != null) {
output.writeMessage(1, getRpcReply());
}
if (!exception_.isEmpty()) {
output.writeBytes(2, exception_);
}
unknownFields.writeTo(output);
}
代码示例来源:origin: apache/incubator-ratis
public void writeTo(org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (header_ != null) {
output.writeMessage(1, getHeader());
}
if (!data_.isEmpty()) {
output.writeBytes(2, data_);
}
unknownFields.writeTo(output);
}
内容来源于网络,如有侵权,请联系作者删除!