Skip to content

Commit 7e9ab58

Browse files
committed
address review comments
1 parent 81a08dd commit 7e9ab58

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

clients/da-vinci-client/src/main/java/com/linkedin/davinci/DaVinciBackend.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ public SubscriptionBasedReadOnlyStoreRepository getStoreRepository() {
561561
return storeRepository;
562562
}
563563

564+
/**
565+
* Resolves and returns the store object for the given store name.
566+
* For user system stores, this returns the SystemStoreAttributes from the parent user store.
567+
* For regular stores and shared system stores, this returns the Store object directly.
568+
*/
564569
public final Object getStore(String storeName) {
565570
VeniceSystemStoreType systemStoreType = VeniceSystemStoreType.getSystemStoreType(storeName);
566571
if (systemStoreType != null) {

internal/venice-common/src/main/java/com/linkedin/venice/pushstatushelper/PushStatusStoreVeniceWriterCache.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.linkedin.venice.pushstatushelper;
22

33
import com.linkedin.venice.common.VeniceSystemStoreUtils;
4+
import com.linkedin.venice.exceptions.VeniceException;
45
import com.linkedin.venice.meta.Store;
56
import com.linkedin.venice.meta.StoreInfo;
67
import com.linkedin.venice.meta.SystemStoreAttributes;
@@ -52,8 +53,10 @@ public VeniceWriter prepareVeniceWriter(String storeName) {
5253
rtTopic = Utils.getRealTimeTopicName((Store) store);
5354
} else if (store instanceof StoreInfo) {
5455
rtTopic = Utils.getRealTimeTopicName((StoreInfo) store);
55-
} else {
56+
} else if (store instanceof SystemStoreAttributes) {
5657
rtTopic = Utils.getRealTimeTopicName((SystemStoreAttributes) store);
58+
} else {
59+
throw new VeniceException("Unexpected store type for: " + storeName + ", type: " + store.getClass().getName());
5760
}
5861
VeniceWriterOptions options = new VeniceWriterOptions.Builder(rtTopic)
5962
.setKeyPayloadSerializer(

internal/venice-common/src/main/java/com/linkedin/venice/system/store/MetaStoreWriter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ public class MetaStoreWriter implements Closeable {
7979
private final PubSubTopicRepository pubSubTopicRepository;
8080
private final long closeTimeoutMs;
8181
private final int numOfConcurrentVwCloseOps;
82-
82+
/*
83+
* Function to resolve store names to Store objects. Used to fetch system store metadata
84+
* for determining the correct RT topic names.
85+
*/
8386
public Function<String, Store> storeResolver;
8487

8588
public MetaStoreWriter(
@@ -372,8 +375,10 @@ VeniceWriter getOrCreateMetaStoreWriter(String metaStoreName) {
372375
int largestUsedRTVersionNumber;
373376
VeniceSystemStoreType type = VeniceSystemStoreType.getSystemStoreType(store.getName());
374377
if (type != null && store.isSystemStore()) {
378+
// metaStoreName is user system store
375379
largestUsedRTVersionNumber = ((SystemStore) store).getVeniceStore().getLargestUsedRTVersionNumber();
376380
} else {
381+
// metaStoreName is zkShared system store
377382
largestUsedRTVersionNumber = store.getLargestUsedRTVersionNumber();
378383
}
379384
String rt = Utils.getRealTimeTopicName(store, largestUsedRTVersionNumber);

0 commit comments

Comments
 (0)