File tree Expand file tree Collapse file tree 4 files changed +63
-0
lines changed
java/io/etcd/jetcd/maintenance
test/java/io/etcd/jetcd/impl
jetcd-grpc/src/main/proto Expand file tree Collapse file tree 4 files changed +63
-0
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package io .etcd .jetcd .maintenance ;
18
18
19
+ import java .util .List ;
20
+
19
21
import io .etcd .jetcd .Maintenance ;
20
22
import io .etcd .jetcd .impl .AbstractResponse ;
21
23
@@ -73,4 +75,40 @@ public long getRaftIndex() {
73
75
public long getRaftTerm () {
74
76
return getResponse ().getRaftTerm ();
75
77
}
78
+
79
+ /**
80
+ * Returns the current raft applied index of the responding member.
81
+ *
82
+ * @return the raft applied index.
83
+ */
84
+ public long getRaftAppliedIndex () {
85
+ return getResponse ().getRaftAppliedIndex ();
86
+ }
87
+
88
+ /**
89
+ * Return the information corresponding to the alarms, health and status.
90
+ *
91
+ * @return the list of errors
92
+ */
93
+ public List <String > getErrorList () {
94
+ return getResponse ().getErrorsList ();
95
+ }
96
+
97
+ /**
98
+ * Returns the size of the backend database logically in use, in bytes, of the responding member.
99
+ *
100
+ * @return dbSizeInUse
101
+ */
102
+ public long getDbSizeInUse () {
103
+ return getResponse ().getDbSizeInUse ();
104
+ }
105
+
106
+ /**
107
+ * Returns if the member is a raft learner.
108
+ *
109
+ * @return if the member is a raft learner
110
+ */
111
+ public boolean getIsLearner () {
112
+ return getResponse ().getIsLearner ();
113
+ }
76
114
}
Original file line number Diff line number Diff line change @@ -725,6 +725,14 @@ message StatusResponse {
725
725
uint64 raftIndex = 5 ;
726
726
// raftTerm is the current raft term of the responding member.
727
727
uint64 raftTerm = 6 ;
728
+ // raftAppliedIndex is the current raft applied index of the responding member.
729
+ uint64 raftAppliedIndex = 7 ;
730
+ // errors contains alarm/health information and status.
731
+ repeated string errors = 8 ;
732
+ // dbSizeInUse is the size of the backend database logically in use, in bytes, of the responding member.
733
+ int64 dbSizeInUse = 9 ;
734
+ // isLearner indicates if the member is raft learner.
735
+ bool isLearner = 10 ;
728
736
}
729
737
730
738
message AuthEnableRequest {
Original file line number Diff line number Diff line change @@ -72,6 +72,15 @@ public void setUp() {
72
72
public void testStatusMember () throws ExecutionException , InterruptedException {
73
73
StatusResponse statusResponse = maintenance .statusMember (endpoints .get (0 )).get ();
74
74
assertThat (statusResponse .getDbSize ()).isGreaterThan (0 );
75
+ assertThat (statusResponse .getRaftIndex ()).isGreaterThan (0 );
76
+ assertThat (statusResponse .getRaftAppliedIndex ())
77
+ .isGreaterThan (0 )
78
+ .isLessThanOrEqualTo (statusResponse .getRaftIndex ());
79
+ assertThat (statusResponse .getDbSizeInUse ())
80
+ .isGreaterThan (0 )
81
+ .isLessThanOrEqualTo (statusResponse .getDbSize ());
82
+ assertThat (statusResponse .getIsLearner ()).isFalse ();
83
+ assertThat (statusResponse .getErrorList ().size ()).isEqualTo (0 );
75
84
}
76
85
77
86
@ Test
Original file line number Diff line number Diff line change @@ -725,6 +725,14 @@ message StatusResponse {
725
725
uint64 raftIndex = 5 ;
726
726
// raftTerm is the current raft term of the responding member.
727
727
uint64 raftTerm = 6 ;
728
+ // raftAppliedIndex is the current raft applied index of the responding member.
729
+ uint64 raftAppliedIndex = 7 ;
730
+ // errors contains alarm/health information and status.
731
+ repeated string errors = 8 ;
732
+ // dbSizeInUse is the size of the backend database logically in use, in bytes, of the responding member.
733
+ int64 dbSizeInUse = 9 ;
734
+ // isLearner indicates if the member is raft learner.
735
+ bool isLearner = 10 ;
728
736
}
729
737
730
738
message AuthEnableRequest {
You can’t perform that action at this time.
0 commit comments