Skip to content

Commit

Permalink
update thrift (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole00 authored Feb 6, 2023
1 parent 6fbefa4 commit a33e486
Show file tree
Hide file tree
Showing 121 changed files with 13,313 additions and 11,039 deletions.
109 changes: 107 additions & 2 deletions client/src/main/generated/GetStateResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class GetStateResponse implements TBase, java.io.Serializable, Cloneable,
private static final TField LAST_LOG_ID_FIELD_DESC = new TField("last_log_id", TType.I64, (short)6);
private static final TField LAST_LOG_TERM_FIELD_DESC = new TField("last_log_term", TType.I64, (short)7);
private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)8);
private static final TField PEERS_FIELD_DESC = new TField("peers", TType.LIST, (short)9);

/**
*
Expand All @@ -53,6 +54,7 @@ public class GetStateResponse implements TBase, java.io.Serializable, Cloneable,
* @see Status
*/
public Status status;
public List<byte[]> peers;
public static final int ERROR_CODE = 1;
public static final int ROLE = 2;
public static final int TERM = 3;
Expand All @@ -61,6 +63,7 @@ public class GetStateResponse implements TBase, java.io.Serializable, Cloneable,
public static final int LAST_LOG_ID = 6;
public static final int LAST_LOG_TERM = 7;
public static final int STATUS = 8;
public static final int PEERS = 9;

// isset id assignments
private static final int __TERM_ISSET_ID = 0;
Expand Down Expand Up @@ -90,6 +93,9 @@ public class GetStateResponse implements TBase, java.io.Serializable, Cloneable,
new FieldValueMetaData(TType.I64)));
tmpMetaDataMap.put(STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I32)));
tmpMetaDataMap.put(PEERS, new FieldMetaData("peers", TFieldRequirementType.DEFAULT,
new ListMetaData(TType.LIST,
new FieldValueMetaData(TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap);
}

Expand All @@ -108,7 +114,8 @@ public GetStateResponse(
long committed_log_id,
long last_log_id,
long last_log_term,
Status status) {
Status status,
List<byte[]> peers) {
this();
this.error_code = error_code;
this.role = role;
Expand All @@ -123,6 +130,7 @@ public GetStateResponse(
this.last_log_term = last_log_term;
setLast_log_termIsSet(true);
this.status = status;
this.peers = peers;
}

public static class Builder {
Expand All @@ -134,6 +142,7 @@ public static class Builder {
private long last_log_id;
private long last_log_term;
private Status status;
private List<byte[]> peers;

BitSet __optional_isset = new BitSet(5);

Expand Down Expand Up @@ -185,6 +194,11 @@ public Builder setStatus(final Status status) {
return this;
}

public Builder setPeers(final List<byte[]> peers) {
this.peers = peers;
return this;
}

public GetStateResponse build() {
GetStateResponse result = new GetStateResponse();
result.setError_code(this.error_code);
Expand All @@ -205,6 +219,7 @@ public GetStateResponse build() {
result.setLast_log_term(this.last_log_term);
}
result.setStatus(this.status);
result.setPeers(this.peers);
return result;
}
}
Expand Down Expand Up @@ -233,6 +248,9 @@ public GetStateResponse(GetStateResponse other) {
if (other.isSetStatus()) {
this.status = TBaseHelper.deepCopy(other.status);
}
if (other.isSetPeers()) {
this.peers = TBaseHelper.deepCopy(other.peers);
}
}

public GetStateResponse deepCopy() {
Expand Down Expand Up @@ -450,6 +468,31 @@ public void setStatusIsSet(boolean __value) {
}
}

public List<byte[]> getPeers() {
return this.peers;
}

public GetStateResponse setPeers(List<byte[]> peers) {
this.peers = peers;
return this;
}

public void unsetPeers() {
this.peers = null;
}

// Returns true if field peers is set (has been assigned a value) and false otherwise
public boolean isSetPeers() {
return this.peers != null;
}

public void setPeersIsSet(boolean __value) {
if (!__value) {
this.peers = null;
}
}

@SuppressWarnings("unchecked")
public void setFieldValue(int fieldID, Object __value) {
switch (fieldID) {
case ERROR_CODE:
Expand Down Expand Up @@ -516,6 +559,14 @@ public void setFieldValue(int fieldID, Object __value) {
}
break;

case PEERS:
if (__value == null) {
unsetPeers();
} else {
setPeers((List<byte[]>)__value);
}
break;

default:
throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
Expand Down Expand Up @@ -547,6 +598,9 @@ public Object getFieldValue(int fieldID) {
case STATUS:
return getStatus();

case PEERS:
return getPeers();

default:
throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
Expand Down Expand Up @@ -578,12 +632,14 @@ public boolean equals(Object _that) {

if (!TBaseHelper.equalsNobinary(this.isSetStatus(), that.isSetStatus(), this.status, that.status)) { return false; }

if (!TBaseHelper.equalsSlow(this.isSetPeers(), that.isSetPeers(), this.peers, that.peers)) { return false; }

return true;
}

@Override
public int hashCode() {
return Arrays.deepHashCode(new Object[] {error_code, role, term, is_leader, committed_log_id, last_log_id, last_log_term, status});
return Arrays.deepHashCode(new Object[] {error_code, role, term, is_leader, committed_log_id, last_log_id, last_log_term, status, peers});
}

@Override
Expand Down Expand Up @@ -662,6 +718,14 @@ public int compareTo(GetStateResponse other) {
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetPeers()).compareTo(other.isSetPeers());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(peers, other.peers);
if (lastComparison != 0) {
return lastComparison;
}
return 0;
}

Expand Down Expand Up @@ -737,6 +801,25 @@ public void read(TProtocol iprot) throws TException {
TProtocolUtil.skip(iprot, __field.type);
}
break;
case PEERS:
if (__field.type == TType.LIST) {
{
TList _list8 = iprot.readListBegin();
this.peers = new ArrayList<byte[]>(Math.max(0, _list8.size));
for (int _i9 = 0;
(_list8.size < 0) ? iprot.peekList() : (_i9 < _list8.size);
++_i9)
{
byte[] _elem10;
_elem10 = iprot.readBinary();
this.peers.add(_elem10);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, __field.type);
}
break;
default:
TProtocolUtil.skip(iprot, __field.type);
break;
Expand Down Expand Up @@ -784,6 +867,17 @@ public void write(TProtocol oprot) throws TException {
oprot.writeI32(this.status == null ? 0 : this.status.getValue());
oprot.writeFieldEnd();
}
if (this.peers != null) {
oprot.writeFieldBegin(PEERS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRING, this.peers.size()));
for (byte[] _iter11 : this.peers) {
oprot.writeBinary(_iter11);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
Expand Down Expand Up @@ -895,6 +989,17 @@ public String toString(int indent, boolean prettyPrint) {
}
}
first = false;
if (!first) sb.append("," + newLine);
sb.append(indentStr);
sb.append("peers");
sb.append(space);
sb.append(":").append(space);
if (this.getPeers() == null) {
sb.append("null");
} else {
sb.append(TBaseHelper.toString(this.getPeers(), indent + 1, prettyPrint));
}
first = false;
sb.append(newLine + TBaseHelper.reduceIndent(indentStr));
sb.append(")");
return sb.toString();
Expand Down
40 changes: 20 additions & 20 deletions client/src/main/generated/RaftexService.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,17 +327,17 @@ public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientM
super(protocolFactory, clientManager, transport);
}

public void askForVote(AskForVoteRequest req, AsyncMethodCallback resultHandler16) throws TException {
public void askForVote(AskForVoteRequest req, AsyncMethodCallback resultHandler20) throws TException {
checkReady();
askForVote_call method_call = new askForVote_call(req, resultHandler16, this, ___protocolFactory, ___transport);
askForVote_call method_call = new askForVote_call(req, resultHandler20, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}

public static class askForVote_call extends TAsyncMethodCall {
private AskForVoteRequest req;
public askForVote_call(AskForVoteRequest req, AsyncMethodCallback resultHandler17, TAsyncClient client13, TProtocolFactory protocolFactory14, TNonblockingTransport transport15) throws TException {
super(client13, protocolFactory14, transport15, resultHandler17, false);
public askForVote_call(AskForVoteRequest req, AsyncMethodCallback resultHandler21, TAsyncClient client17, TProtocolFactory protocolFactory18, TNonblockingTransport transport19) throws TException {
super(client17, protocolFactory18, transport19, resultHandler21, false);
this.req = req;
}

Expand All @@ -359,17 +359,17 @@ public AskForVoteResponse getResult() throws TException {
}
}

public void appendLog(AppendLogRequest req, AsyncMethodCallback resultHandler21) throws TException {
public void appendLog(AppendLogRequest req, AsyncMethodCallback resultHandler25) throws TException {
checkReady();
appendLog_call method_call = new appendLog_call(req, resultHandler21, this, ___protocolFactory, ___transport);
appendLog_call method_call = new appendLog_call(req, resultHandler25, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}

public static class appendLog_call extends TAsyncMethodCall {
private AppendLogRequest req;
public appendLog_call(AppendLogRequest req, AsyncMethodCallback resultHandler22, TAsyncClient client18, TProtocolFactory protocolFactory19, TNonblockingTransport transport20) throws TException {
super(client18, protocolFactory19, transport20, resultHandler22, false);
public appendLog_call(AppendLogRequest req, AsyncMethodCallback resultHandler26, TAsyncClient client22, TProtocolFactory protocolFactory23, TNonblockingTransport transport24) throws TException {
super(client22, protocolFactory23, transport24, resultHandler26, false);
this.req = req;
}

Expand All @@ -391,17 +391,17 @@ public AppendLogResponse getResult() throws TException {
}
}

public void sendSnapshot(SendSnapshotRequest req, AsyncMethodCallback resultHandler26) throws TException {
public void sendSnapshot(SendSnapshotRequest req, AsyncMethodCallback resultHandler30) throws TException {
checkReady();
sendSnapshot_call method_call = new sendSnapshot_call(req, resultHandler26, this, ___protocolFactory, ___transport);
sendSnapshot_call method_call = new sendSnapshot_call(req, resultHandler30, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}

public static class sendSnapshot_call extends TAsyncMethodCall {
private SendSnapshotRequest req;
public sendSnapshot_call(SendSnapshotRequest req, AsyncMethodCallback resultHandler27, TAsyncClient client23, TProtocolFactory protocolFactory24, TNonblockingTransport transport25) throws TException {
super(client23, protocolFactory24, transport25, resultHandler27, false);
public sendSnapshot_call(SendSnapshotRequest req, AsyncMethodCallback resultHandler31, TAsyncClient client27, TProtocolFactory protocolFactory28, TNonblockingTransport transport29) throws TException {
super(client27, protocolFactory28, transport29, resultHandler31, false);
this.req = req;
}

Expand All @@ -423,17 +423,17 @@ public SendSnapshotResponse getResult() throws TException {
}
}

public void heartbeat(HeartbeatRequest req, AsyncMethodCallback resultHandler31) throws TException {
public void heartbeat(HeartbeatRequest req, AsyncMethodCallback resultHandler35) throws TException {
checkReady();
heartbeat_call method_call = new heartbeat_call(req, resultHandler31, this, ___protocolFactory, ___transport);
heartbeat_call method_call = new heartbeat_call(req, resultHandler35, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}

public static class heartbeat_call extends TAsyncMethodCall {
private HeartbeatRequest req;
public heartbeat_call(HeartbeatRequest req, AsyncMethodCallback resultHandler32, TAsyncClient client28, TProtocolFactory protocolFactory29, TNonblockingTransport transport30) throws TException {
super(client28, protocolFactory29, transport30, resultHandler32, false);
public heartbeat_call(HeartbeatRequest req, AsyncMethodCallback resultHandler36, TAsyncClient client32, TProtocolFactory protocolFactory33, TNonblockingTransport transport34) throws TException {
super(client32, protocolFactory33, transport34, resultHandler36, false);
this.req = req;
}

Expand All @@ -455,17 +455,17 @@ public HeartbeatResponse getResult() throws TException {
}
}

public void getState(GetStateRequest req, AsyncMethodCallback resultHandler36) throws TException {
public void getState(GetStateRequest req, AsyncMethodCallback resultHandler40) throws TException {
checkReady();
getState_call method_call = new getState_call(req, resultHandler36, this, ___protocolFactory, ___transport);
getState_call method_call = new getState_call(req, resultHandler40, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}

public static class getState_call extends TAsyncMethodCall {
private GetStateRequest req;
public getState_call(GetStateRequest req, AsyncMethodCallback resultHandler37, TAsyncClient client33, TProtocolFactory protocolFactory34, TNonblockingTransport transport35) throws TException {
super(client33, protocolFactory34, transport35, resultHandler37, false);
public getState_call(GetStateRequest req, AsyncMethodCallback resultHandler41, TAsyncClient client37, TProtocolFactory protocolFactory38, TNonblockingTransport transport39) throws TException {
super(client37, protocolFactory38, transport39, resultHandler41, false);
this.req = req;
}

Expand Down
Loading

0 comments on commit a33e486

Please sign in to comment.