|
108 | 108 | import com.linkedin.venice.meta.StoreDataAudit; |
109 | 109 | import com.linkedin.venice.meta.StoreInfo; |
110 | 110 | import com.linkedin.venice.meta.Version; |
| 111 | +import com.linkedin.venice.meta.VersionImpl; |
| 112 | +import com.linkedin.venice.meta.VersionStatus; |
111 | 113 | import com.linkedin.venice.protocols.controller.ClusterStoreGrpcInfo; |
112 | 114 | import com.linkedin.venice.protocols.controller.GetRepushInfoGrpcRequest; |
113 | 115 | import com.linkedin.venice.protocols.controller.GetRepushInfoGrpcResponse; |
|
116 | 118 | import com.linkedin.venice.protocols.controller.RepushInfoGrpc; |
117 | 119 | import com.linkedin.venice.protocols.controller.ValidateStoreDeletedGrpcRequest; |
118 | 120 | import com.linkedin.venice.protocols.controller.ValidateStoreDeletedGrpcResponse; |
| 121 | +import com.linkedin.venice.protocols.controller.VersionGrpc; |
119 | 122 | import com.linkedin.venice.pubsub.PubSubTopicRepository; |
120 | 123 | import com.linkedin.venice.pubsub.api.PubSubTopic; |
121 | 124 | import com.linkedin.venice.pubsub.api.exceptions.PubSubTopicDoesNotExistException; |
@@ -283,8 +286,7 @@ public void internalHandle(Request request, RepushInfoResponse veniceResponse) { |
283 | 286 | veniceResponse.setName(storeName); |
284 | 287 |
|
285 | 288 | // Convert proto RepushInfo back to Java RepushInfo for HTTP response |
286 | | - RepushInfoGrpc repushInfoProto = grpcResponse.getRepushInfo(); |
287 | | - RepushInfo repushInfo = admin.getRepushInfo(clusterName, storeName, Optional.ofNullable(fabricName)); |
| 289 | + RepushInfo repushInfo = mapGrpcRepushInfoToRepushInfo(grpcResponse.getRepushInfo(), storeName); |
288 | 290 |
|
289 | 291 | veniceResponse.setRepushInfo(repushInfo); |
290 | 292 | } |
@@ -1245,4 +1247,34 @@ public void internalHandle(Request request, StoreDeletedValidationResponse venic |
1245 | 1247 | } |
1246 | 1248 | }; |
1247 | 1249 | } |
| 1250 | + |
| 1251 | + /** |
| 1252 | + * Converts a gRPC RepushInfoGrpc message to a RepushInfo object. |
| 1253 | + * @param repushInfoProto the gRPC message |
| 1254 | + * @param storeName the store name needed for Version creation |
| 1255 | + * @return the converted RepushInfo object |
| 1256 | + */ |
| 1257 | + RepushInfo mapGrpcRepushInfoToRepushInfo(RepushInfoGrpc repushInfoProto, String storeName) { |
| 1258 | + Version version = null; |
| 1259 | + if (repushInfoProto.hasVersion()) { |
| 1260 | + VersionGrpc versionProto = repushInfoProto.getVersion(); |
| 1261 | + version = new VersionImpl( |
| 1262 | + storeName, |
| 1263 | + versionProto.getNumber(), |
| 1264 | + versionProto.getCreatedTime(), |
| 1265 | + versionProto.getPushJobId(), |
| 1266 | + versionProto.getPartitionCount(), |
| 1267 | + null, |
| 1268 | + null); |
| 1269 | + version.setStatus(VersionStatus.getVersionStatusFromInt(versionProto.getStatus())); |
| 1270 | + } |
| 1271 | + |
| 1272 | + return RepushInfo.createRepushInfo( |
| 1273 | + version, |
| 1274 | + repushInfoProto.getKafkaBrokerUrl(), |
| 1275 | + repushInfoProto.hasSystemSchemaClusterD2ServiceName() |
| 1276 | + ? repushInfoProto.getSystemSchemaClusterD2ServiceName() |
| 1277 | + : null, |
| 1278 | + repushInfoProto.hasSystemSchemaClusterD2ZkHost() ? repushInfoProto.getSystemSchemaClusterD2ZkHost() : null); |
| 1279 | + } |
1248 | 1280 | } |
0 commit comments