Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidaguerre committed Apr 16, 2024
1 parent ba6224e commit 27b8f6a
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 27 deletions.
9 changes: 0 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ standalone: validate_plugin prebuild.go

rm -f prebuild.go

build: prebuild.go
$(MAKE) -C ./fdw clean
$(MAKE) -C ./fdw go
$(MAKE) -C ./fdw
$(MAKE) -C ./fdw inst

rm -f prebuild.go


# render target
render: validate_plugin prebuild.go
@echo "Rendering code for plugin: $(plugin)"
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/turbot/go-kit v0.10.0-rc.0
//join_timing
github.com/turbot/steampipe v1.7.0-rc.0.0.20240416091846-b11d8943513a
github.com/turbot/steampipe v1.7.0-rc.0.0.20240416155719-57f19d8b0a9e
github.com/turbot/steampipe-plugin-sdk/v5 v5.10.0-rc.3
go.opentelemetry.io/otel v1.24.0
google.golang.org/protobuf v1.33.0
Expand Down Expand Up @@ -197,5 +197,4 @@ replace (
github.com/piquette/edgr => github.com/e-gineer/edgr v0.0.2-0.20210901021602-7664639af765
github.com/vartanbeno/go-reddit/v2 => github.com/abhiturbot/go-reddit/v2 v2.0.0-20220917030010-f0fe7d8ac15c
oras.land/oras-go => oras.land/oras-go v1.1.0
github.com/turbot/steampipe => ../steampipe
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,8 @@ github.com/turbot/go-kit v0.10.0-rc.0 h1:kd+jp2ibbIV33Hc8SsMAN410Dl9Pz6SJ40axbKU
github.com/turbot/go-kit v0.10.0-rc.0/go.mod h1:fFQqR59I5z5JeeBLfK1PjSifn4Oprs3NiQx0CxeSJxs=
github.com/turbot/pipe-fittings v1.1.0 h1:GQ6Hc73uihduLJjiqqj4Iz97w0jQ+QGmd1628X9WnrQ=
github.com/turbot/pipe-fittings v1.1.0/go.mod h1:Cgy232VEhVjtDibJS8v5Zf4lKQnfZJOBtsuUNZ7MzTc=
github.com/turbot/steampipe v1.7.0-rc.0.0.20240416091846-b11d8943513a h1:viFKbPBX99c3Ml1VNMrz0ErPuQ0jBy9MDvJHIwv9cBg=
github.com/turbot/steampipe v1.7.0-rc.0.0.20240416091846-b11d8943513a/go.mod h1:FCNkoNAsGRk4f+C18Za7ttH2xRCb+zXr2e+jOFSfM9Y=
github.com/turbot/steampipe v1.7.0-rc.0.0.20240416155719-57f19d8b0a9e h1:D8jiRhpFg/OzU30sBU6W0idCFPIgRmqbbsv+HN51CTM=
github.com/turbot/steampipe v1.7.0-rc.0.0.20240416155719-57f19d8b0a9e/go.mod h1:FCNkoNAsGRk4f+C18Za7ttH2xRCb+zXr2e+jOFSfM9Y=
github.com/turbot/steampipe-plugin-sdk/v5 v5.10.0-rc.3 h1:QU64Yve9b1I4bhpG4mUyLpCBtaCIZTkTRAuBpii8qfQ=
github.com/turbot/steampipe-plugin-sdk/v5 v5.10.0-rc.3/go.mod h1:DJ9gPbPzmCe4M2sp+KzCmOhFuucl5/6hXnXvFvS/9nQ=
github.com/turbot/terraform-components v0.0.0-20231213122222-1f3526cab7a7 h1:qDMxFVd8Zo0rIhnEBdCIbR+T6WgjwkxpFZMN8zZmmjg=
Expand Down
10 changes: 0 additions & 10 deletions hub/hub_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ func (h *hubBase) StartScan(i Iterator) error {

// EndScan is called when Postgres terminates the scan (because it has received enough rows of data)
func (h *hubBase) EndScan(iter Iterator, limit int64) {
log.Printf("[INFO] hubBase EndScan")

// is the iterator still running? If so it means postgres is stopping a scan before all rows have been read
if iter.Status() == QueryStatusStarted {
log.Printf("[INFO] ending scan before iterator complete - limit: %v, iterator: %p", limit, iter)
Expand All @@ -203,7 +201,6 @@ func (h *hubBase) AddScanMetadata(i Iterator) {
// if iterator is not a pluginIterator, do nothing
iter, ok := i.(pluginIterator)
if !ok {
log.Printf("[INFO] AddScanMetadata - not a pluginIterator so returning")
return
}

Expand Down Expand Up @@ -247,9 +244,6 @@ func (h *hubBase) AddScanMetadata(i Iterator) {
}
// write the scan metadata and summary back to the hub
h.queryTiming.queryRowSummary[queryTimestamp] = querySummary

log.Printf("[INFO] AddScanMetadata complete - there are now %d entries for query timestamp %d", len(h.queryTiming.scanMetadata[queryTimestamp]), queryTimestamp)
log.Printf("[INFO] summary: %v", h.queryTiming.queryRowSummary)
}

// Close shuts down all plugin clients
Expand Down Expand Up @@ -286,15 +280,13 @@ func (h *hubBase) ApplySetting(key string, value string) error {
}

func (h *hubBase) GetSettingsSchema() map[string]*proto.TableSchema {
// todo kai only in remote???
return map[string]*proto.TableSchema{
constants.ForeignTableSettings: {
Columns: []*proto.ColumnDefinition{
{Name: constants.ForeignTableSettingsKeyColumn, Type: proto.ColumnType_STRING},
{Name: constants.ForeignTableSettingsValueColumn, Type: proto.ColumnType_STRING},
},
},
// todo kai only in remote???
constants.ForeignTableScanMetadata: {
Columns: []*proto.ColumnDefinition{
{Name: "connection", Type: proto.ColumnType_STRING},
Expand All @@ -309,7 +301,6 @@ func (h *hubBase) GetSettingsSchema() map[string]*proto.TableSchema {
{Name: "quals", Type: proto.ColumnType_JSON},
},
},
// todo kai only in remote???
constants.ForeignTableScanMetadataSummary: {
Columns: []*proto.ColumnDefinition{
{Name: "cached_rows_fetched", Type: proto.ColumnType_INT},
Expand Down Expand Up @@ -365,7 +356,6 @@ func (h *hubBase) executeCommandScan(connectionName, table string, queryTimestam

res := &QueryResult{}
for _, scansForQuery := range h.queryTiming.scanMetadata {
log.Printf("[INFO] metadata rows %d", len(scansForQuery))
for _, m := range scansForQuery {
res.Rows = append(res.Rows, m.AsResultRow())
}
Expand Down
1 change: 0 additions & 1 deletion hub/hub_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ func (l *HubLocal) startScanForConnection(connectionName string, table string, q

log.Printf("[TRACE] startScanForConnection creating a new scan iterator")
iterator := newScanIteratorLocal(l, connectionName, table, l.pluginName, connectionLimitMap, qualMap, columns, limit, scanTraceCtx)

return iterator, nil
}

Expand Down
1 change: 0 additions & 1 deletion hub/hub_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ func (h *RemoteHub) GetPathKeys(opts types.Options) ([]types.PathKey, error) {
//// internal implementation ////

// startScanForConnection starts a scan for a single connection, using a scanIterator or a legacyScanIterator

func (h *RemoteHub) startScanForConnection(connectionName string, table string, qualMap map[string]*proto.Quals, unhandledRestrictions int, columns []string, limit int64, scanTraceCtx *telemetry.TraceCtx, queryTimestamp int64) (_ Iterator, err error) {
defer func() {
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions hub/scan_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ func (i *scanIterator) execute(req *proto.ExecuteRequest) (row_stream.Receiver,
// note: if this is an aggregator query, we will have a scan metadata for each connection
// we need to combine them into a single scan metadata object
func (i *scanIterator) GetScanMetadata() []queryresult.ScanMetadataRow {
log.Printf("[INFO] scanIterator GetScanMetadata (%p) (%s)", i, i.callId)
defer log.Printf("[INFO] scanIterator GetScanMetadata end (%p) (%s)", i, i.callId)
// if we have scan metadata, return it
if len(i.scanMetadata) > 0 {
return maps.Values(i.scanMetadata)
Expand Down

0 comments on commit 27b8f6a

Please sign in to comment.