Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(warehouse): added base support for s3 datalake deletion as part of regulation API. #2515

Merged
merged 20 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ require (
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xitongsys/parquet-go-source v0.0.0-20220803203939-583c0659c569 // indirect
github.com/xitongsys/parquet-go-source v0.0.0-20220803203939-583c0659c569
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
go.opencensus.io v0.23.0 // indirect
Expand Down
3 changes: 2 additions & 1 deletion regulation-worker/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func Run(ctx context.Context) {
Deleter: delete.NewRouter(
&kvstore.KVDeleteManager{},
&batch.BatchManager{
FMFactory: &filemanager.FileManagerFactoryT{},
FMFactory: &filemanager.FileManagerFactoryT{},
FilesLimit: config.GetInt("REGULATION_WORKER_FILES_LIMIT", 1000),
},
&api.APIManager{
Client: &http.Client{Timeout: config.GetDuration("HttpClient.regulationWorker.timeout", 30, time.Second)},
Expand Down
6 changes: 2 additions & 4 deletions regulation-worker/internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ func (j *JobAPI) Get(ctx context.Context) (model.Job, error) {
ctx, cancel := context.WithTimeout(ctx, time.Minute)
defer cancel()

method := "GET"
genEndPoint := "/dataplane/workspaces/{workspace_id}/regulations/workerJobs"
url := fmt.Sprint(j.URLPrefix, prepURL(genEndPoint, j.WorkspaceID))
url := fmt.Sprintf("%s/dataplane/workspaces/%s/regulations/workerJobs", j.URLPrefix, j.WorkspaceID)
Copy link
Contributor

@saurav-malani saurav-malani Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating url like this is indeed more readable & better. We can use this same approach to create url in UpdateStatus func also & can get rid of prepURL func.

pkgLogger.Debugf("making GET request to URL: %v", url)

req, err := http.NewRequestWithContext(ctx, method, url, nil)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
if err != nil {
pkgLogger.Errorf("error while create new http request: %v", err)
return model.Job{}, err
Expand Down
Loading