[
https://issues.apache.org/jira/browse/BEAM-13633?focusedWorklogId=714564&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-714564
]
ASF GitHub Bot logged work on BEAM-13633:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 25/Jan/22 15:13
Start Date: 25/Jan/22 15:13
Worklog Time Spent: 10m
Work Description: pavel-avilov commented on a change in pull request
#16484:
URL: https://github.com/apache/beam/pull/16484#discussion_r791815557
##########
File path: playground/backend/internal/utils/precompiled_objects_utils.go
##########
@@ -34,7 +43,61 @@ func PutPrecompiledObjectsToCategory(categoryName string,
precompiledObjects *cl
Type: object.Type,
PipelineOptions: object.PipelineOptions,
Link: object.Link,
+ DefaultExample: object.DefaultExample,
})
}
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) {
+ value, err := cacheService.GetValue(ctx, ExamplesDataPipelineId,
cache.ExamplesCatalog)
+ if err != nil {
+ logger.Errorf("%s: cache.GetValue: %s\n",
ExamplesDataPipelineId, err.Error())
+ return nil, err
+ }
+ catalog, converted := value.([]*pb.Categories)
+ if !converted {
+ logger.Errorf("%s: couldn't convert value to catalog: %s",
cache.ExamplesCatalog, value)
+ return nil, errors.InternalError("Error during getting the
catalog from cache", "Error during getting catalog")
+ }
+ return catalog, nil
+}
+
+// GetPrecompiledObjectsCatalogFromStorage returns the precompiled objects
catalog from the cloud storage
+func GetPrecompiledObjectsCatalogFromStorage(ctx context.Context, sdk pb.Sdk,
category string) ([]*pb.Categories, error) {
Review comment:
This goes from [[BEAM-13632]](https://github.com/apache/beam/pull/16493)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 714564)
Time Spent: 4h 40m (was: 4.5h)
> Implement method to get a default example for each SDKs
> -------------------------------------------------------
>
> Key: BEAM-13633
> URL: https://issues.apache.org/jira/browse/BEAM-13633
> Project: Beam
> Issue Type: Sub-task
> Components: beam-playground
> Reporter: Pavel Avilov
> Assignee: Pavel Avilov
> Priority: P2
> Labels: beam-playground-backend, beam-playground-sprint-7
> Time Spent: 4h 40m
> Remaining Estimate: 0h
>
> Need to implement a method that will return a default example for each SDKs.
> Store the description of default examples in the config.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)