public static void validateUserStoreNamesOnNode ( AdminClient adminClient , Integer nodeId , List < String > storeNames ) { List < StoreDefinition > storeDefList = adminClient . metadataMgmtOps . getRemoteStoreDefList ( nodeId ) . getValue ( ) ; Map < String , Boolean > existingStoreNames = new HashMap < String , Boolean > ( ) ; for ( StoreDefinition storeDef : storeDefList ) { existingStoreNames . put ( storeDef . getName ( ) , true ) ; } for ( String storeName : storeNames ) { if ( ! Boolean . TRUE . equals ( existingStoreNames . get ( storeName ) ) ) { Utils . croak ( "Store " + storeName + " does not exist!" ) ; } } }
Utility function that checks if store names are valid on a node .