@@ -28,11 +28,19 @@ public class SearchResp {
2828 private List <List <SearchResult >> searchResults ;
2929 private long sessionTs ; // default eventually ts
3030 private List <Float > recalls ;
31+ private Long cost ;
32+ private Long scannedRemoteBytes ;
33+ private Long scannedTotalBytes ;
34+ private Float cacheHitRatio ;
3135
3236 private SearchResp (SearchRespBuilder builder ) {
3337 this .searchResults = builder .searchResults ;
3438 this .sessionTs = builder .sessionTs ;
3539 this .recalls = builder .recalls ;
40+ this .cost = builder .cost ;
41+ this .scannedRemoteBytes = builder .scannedRemoteBytes ;
42+ this .scannedTotalBytes = builder .scannedTotalBytes ;
43+ this .cacheHitRatio = builder .cacheHitRatio ;
3644 }
3745
3846 public static SearchRespBuilder builder () {
@@ -63,19 +71,59 @@ public void setRecalls(List<Float> recalls) {
6371 this .recalls = recalls ;
6472 }
6573
74+ public Long getCost () {
75+ return cost ;
76+ }
77+
78+ public void setCost (Long cost ) {
79+ this .cost = cost ;
80+ }
81+
82+ public Long getScannedRemoteBytes () {
83+ return scannedRemoteBytes ;
84+ }
85+
86+ public void setScannedRemoteBytes (Long scannedRemoteBytes ) {
87+ this .scannedRemoteBytes = scannedRemoteBytes ;
88+ }
89+
90+ public Long getScannedTotalBytes () {
91+ return scannedTotalBytes ;
92+ }
93+
94+ public void setScannedTotalBytes (Long scannedTotalBytes ) {
95+ this .scannedTotalBytes = scannedTotalBytes ;
96+ }
97+
98+ public Float getCacheHitRatio () {
99+ return cacheHitRatio ;
100+ }
101+
102+ public void setCacheHitRatio (Float cacheHitRatio ) {
103+ this .cacheHitRatio = cacheHitRatio ;
104+ }
105+
66106 @ Override
67107 public String toString () {
68108 return "SearchResp{" +
69109 "searchResults=" + searchResults +
70110 ", sessionTs=" + sessionTs +
71111 ", recalls=" + recalls +
112+ ", cost=" + cost +
113+ ", scannedRemoteBytes=" + scannedRemoteBytes +
114+ ", scannedTotalBytes=" + scannedTotalBytes +
115+ ", cacheHitRatio=" + cacheHitRatio +
72116 '}' ;
73117 }
74118
75119 public static class SearchRespBuilder {
76120 private List <List <SearchResult >> searchResults = new ArrayList <>();
77121 private long sessionTs = 1L ; // default eventually ts
78122 private List <Float > recalls = new ArrayList <>();
123+ private Long cost ;
124+ private Long scannedRemoteBytes ;
125+ private Long scannedTotalBytes ;
126+ private Float cacheHitRatio ;
79127
80128 public SearchRespBuilder searchResults (List <List <SearchResult >> searchResults ) {
81129 this .searchResults = searchResults ;
@@ -92,6 +140,26 @@ public SearchRespBuilder recalls(List<Float> recalls) {
92140 return this ;
93141 }
94142
143+ public SearchRespBuilder cost (Long cost ) {
144+ this .cost = cost ;
145+ return this ;
146+ }
147+
148+ public SearchRespBuilder scannedRemoteBytes (Long scannedRemoteBytes ) {
149+ this .scannedRemoteBytes = scannedRemoteBytes ;
150+ return this ;
151+ }
152+
153+ public SearchRespBuilder scannedTotalBytes (Long scannedTotalBytes ) {
154+ this .scannedTotalBytes = scannedTotalBytes ;
155+ return this ;
156+ }
157+
158+ public SearchRespBuilder cacheHitRatio (Float cacheHitRatio ) {
159+ this .cacheHitRatio = cacheHitRatio ;
160+ return this ;
161+ }
162+
95163 public SearchResp build () {
96164 return new SearchResp (this );
97165 }
0 commit comments