File tree Expand file tree Collapse file tree
clients/da-vinci-client/src/main/java/com/linkedin/davinci
internal/venice-common/src/main/java/com/linkedin/venice Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff line change 11package com .linkedin .venice .pushstatushelper ;
22
33import com .linkedin .venice .common .VeniceSystemStoreUtils ;
4+ import com .linkedin .venice .exceptions .VeniceException ;
45import com .linkedin .venice .meta .Store ;
56import com .linkedin .venice .meta .StoreInfo ;
67import 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 (
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments