[ https://issues.apache.org/jira/browse/BEAM-13632?focusedWorklogId=710535&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-710535 ]
ASF GitHub Bot logged work on BEAM-13632: ----------------------------------------- Author: ASF GitHub Bot Created on: 18/Jan/22 14:18 Start Date: 18/Jan/22 14:18 Worklog Time Spent: 10m Work Description: ilya-kozyrev commented on a change in pull request #16493: URL: https://github.com/apache/beam/pull/16493#discussion_r786793309 ########## File path: playground/backend/cmd/server/controller.go ########## @@ -241,22 +241,27 @@ func (controller *playgroundController) Cancel(ctx context.Context, info *pb.Can } // GetPrecompiledObjects returns the list of examples +// - If SDK and category are unspecified in the request, gets the whole catalog from the cache +// - If there is no catalog in the cache, gets the catalog from the Storage and saves it to the cache +// - If SDK or category is specified in the request, gets the specific catalog from the Storage func (controller *playgroundController) GetPrecompiledObjects(ctx context.Context, info *pb.GetPrecompiledObjectsRequest) (*pb.GetPrecompiledObjectsResponse, error) { - bucket := cloud_bucket.New() - sdkToCategories, err := bucket.GetPrecompiledObjects(ctx, info.Sdk, info.Category) + if info.Sdk == pb.Sdk_SDK_UNSPECIFIED && info.Category == "" { Review comment: why we need this if here? ########## File path: playground/backend/internal/cache/cache.go ########## @@ -55,6 +55,9 @@ const ( // LogsIndex is the index of the start of the log LogsIndex SubKey = "LOGS_INDEX" + + // ExamplesCatalog is catalog of examples available in Playground + ExamplesCatalog SubKey = "EXAMPLES_CATALOG" Review comment: Instead, make workarounds with subkey without pipeline id. Can we extend the Cache interface and implementation with SetCatalog, GetKatalog? ########## File path: playground/backend/internal/utils/precompiled_objects_utils.go ########## @@ -37,3 +46,37 @@ func PutPrecompiledObjectsToCategory(categoryName string, precompiledObjects *cl } sdkCategory.Categories = append(sdkCategory.Categories, &category) } + +// GetPrecompiledObjectsCatalogFromCache returns the precompiled objects catalog from the cache +func GetPrecompiledObjectsCatalogFromCache(ctx context.Context, cacheService cache.Cache) ([]*pb.Categories, error) { Review comment: can we make this name shorter? GetPrecompiledObjectsFromCache -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 710535) Time Spent: 1h 20m (was: 1h 10m) > Save catalog data to the cache > ------------------------------ > > Key: BEAM-13632 > URL: https://issues.apache.org/jira/browse/BEAM-13632 > Project: Beam > Issue Type: Sub-task > Components: beam-playground > Reporter: Artur Khanin > Assignee: Artur Khanin > Priority: P2 > Labels: beam-playground-backend > Time Spent: 1h 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.20.1#820001)