Skip to content

Commit

Permalink
Cleanup BQ uploader un-used fields
Browse files Browse the repository at this point in the history
Found two fields in BQSpec struct which are not in used. This CL clean them up.

Test: Manually upload a RPL log to bigquery table, see: b/361604740#2
Bug: b/338439004
Change-Id: I68f2490d7d4368be32b9c43bd6c56f0aeafcb45a
GitOrigin-RevId: 2baa6efe09abcc4c574341420362b57b6293e89c
  • Loading branch information
ywmei-brt1 authored and copybara-github committed Aug 26, 2024
1 parent 626571d commit 15e1925
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 2 additions & 4 deletions cmd/bigquery/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Example invocation (assuming the bigquery table already exists):
bazelisk run //cmd/bigquery:bigquery -- \
--log_path text:///tmp/reproxy_log.rpl \
--alsologtostderr=true \
--table <bigquery-dataset-id>.<bigquery-table-id> \
--project_id <gcp-project-id> # (ex:"foundry-x-experiments")
--bq_project <gcp-project-id> # (ex:"foundry-x-experiments") \
--bq_table <bigquery-dataset-id>.<bigquery-table-id>
If you don't have a bigquery table yet, you can create it using the following steps:
Expand Down Expand Up @@ -87,8 +87,6 @@ func main() {
log.Exitf("Failed creating bigquery client: %v", err)
}
bqSpec := &bigquery.BQSpec{
ProjectID: *bqProjectID,
TableSpec: *bqTableSpec,
BatchSizeMB: *bqBatchMB,
Client: client,
CleanUp: cleanUp,
Expand Down
2 changes: 0 additions & 2 deletions cmd/reproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,6 @@ func initializeLogger(mi *ignoremismatch.MismatchIgnorer, e *monitoring.Exporter
log.Errorf("Failed creating bigquery stream: %v", err)
} else {
bqSpec = &bigquery.BQSpec{
ProjectID: *bqProjectID,
TableSpec: *bqTableSpec,
BatchSizeMB: *bqBatchMB,
Client: client,
CleanUp: cleanUp,
Expand Down
2 changes: 0 additions & 2 deletions internal/pkg/bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ func NewInserter(ctx context.Context, resourceSpec, defaultProject string, ts *o
// BQSpec defines which bigquery table the LogRecords will be saved.
type BQSpec struct {
Err atomic.Pointer[error]
ProjectID string
TableSpec string
BatchSizeMB int
Client *bigquery.Inserter
CleanUp func() error
Expand Down

0 comments on commit 15e1925

Please sign in to comment.