Skip to content

Commit 45a0c7d

Browse files
committed
[wip] attempt to get into a working state
1 parent 8578cb6 commit 45a0c7d

965 files changed

Lines changed: 2223 additions & 8380 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/trcli/main.go

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package main
22

33
import (
4-
"context"
54
"net/http"
65
"os"
76
"strings"
8-
"time"
97

108
"github.com/prometheus/client_golang/prometheus/promhttp"
119
"github.com/spf13/cobra"
@@ -21,7 +19,6 @@ import (
2119
"github.com/transferia/transferia/pkg/abstract"
2220
coordinator "github.com/transferia/transferia/pkg/abstract/coordinator"
2321
"github.com/transferia/transferia/pkg/cobraaux"
24-
"github.com/transferia/transferia/pkg/coordinator/etcdcoordinator"
2522
"github.com/transferia/transferia/pkg/coordinator/s3coordinator"
2623
_ "github.com/transferia/transferia/pkg/dataplane"
2724
"github.com/transferia/transferia/pkg/serverutil"
@@ -48,12 +45,6 @@ func main() {
4845
logConfig := defaultLogConfig
4946
coordinatorTyp := defaultCoordinator
5047
coordinatorS3Bucket := ""
51-
coordinatorEtcdEndpoints := []string{}
52-
coordinatorEtcdUsername := ""
53-
coordinatorEtcdPassword := ""
54-
coordinatorEtcdCertFile := ""
55-
coordinatorEtcdKeyFile := ""
56-
coordinatorEtcdCAFile := ""
5748
runProfiler := false
5849

5950
promRegistry, registry := internal_metrics.NewPrometheusRegistryWithNameProcessor()
@@ -63,11 +54,7 @@ func main() {
6354
Short: "Transferia cli",
6455
Example: "./trcli help",
6556
SilenceUsage: true,
66-
Version: getVersionString(),
6757
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
68-
ctx := context.Background()
69-
cmd.SetContext(ctx)
70-
7158
if strings.Contains(cmd.CommandPath(), "describe") {
7259
return nil
7360
}
@@ -81,14 +68,7 @@ func main() {
8168
ErrorHandling: promhttp.PanicOnError,
8269
}))
8370
logger.Log.Infof("Prometheus is uprising on port %v", "9091")
84-
server := &http.Server{
85-
Addr: ":9091",
86-
ReadTimeout: 60 * time.Second,
87-
WriteTimeout: 60 * time.Second,
88-
Handler: rootMux,
89-
}
90-
91-
if err := server.ListenAndServe(); err != nil {
71+
if err := http.ListenAndServe(":9091", rootMux); err != nil {
9272
logger.Log.Error("failed to serve metrics", log.Error(err))
9373
}
9474
}()
@@ -137,19 +117,6 @@ func main() {
137117
if rt.CurrentJob > 0 || rt.ShardingUpload.JobCount > 1 {
138118
return xerrors.Errorf("for sharding upload memory coordinator won't work")
139119
}
140-
case "etcd":
141-
var err error
142-
cp, err = etcdcoordinator.NewEtcdCoordinator(cmd.Context(), etcdcoordinator.EtcdConfig{
143-
Endpoints: coordinatorEtcdEndpoints,
144-
Username: coordinatorEtcdUsername,
145-
Password: coordinatorEtcdPassword,
146-
CertFile: coordinatorEtcdCertFile,
147-
KeyFile: coordinatorEtcdKeyFile,
148-
CAFile: coordinatorEtcdCAFile,
149-
}, logger.Log)
150-
if err != nil {
151-
return xerrors.Errorf("unable to load etcd coordinator: %w", err)
152-
}
153120
case "s3":
154121
var err error
155122
cp, err = s3coordinator.NewS3(coordinatorS3Bucket, logger.Log)
@@ -172,16 +139,8 @@ func main() {
172139

173140
rootCommand.PersistentFlags().StringVar(&logLevel, "log-level", defaultLogLevel, "Specifies logging level for output logs (\"panic\", \"fatal\", \"error\", \"warning\", \"info\", \"debug\")")
174141
rootCommand.PersistentFlags().StringVar(&logConfig, "log-config", defaultLogConfig, "Specifies logging config for output logs (\"console\", \"json\", \"minimal\")")
175-
176-
rootCommand.PersistentFlags().StringVar(&coordinatorTyp, "coordinator", defaultCoordinator, "Specifies how to coordinate transfer nodes (\"memory\", \"s3\", \"etcd\")")
142+
rootCommand.PersistentFlags().StringVar(&coordinatorTyp, "coordinator", defaultCoordinator, "Specifies how to coordinate transfer nodes (\"memory\", \"s3\")")
177143
rootCommand.PersistentFlags().StringVar(&coordinatorS3Bucket, "coordinator-s3-bucket", "", "Bucket for s3 coordinator")
178-
rootCommand.PersistentFlags().StringSliceVar(&coordinatorEtcdEndpoints, "coordinator-etcd-endpoints", []string{"http://localhost:2379"}, "Endpoints for etcd coordinator")
179-
rootCommand.PersistentFlags().StringVar(&coordinatorEtcdUsername, "coordinator-etcd-username", "", "Username for etcd coordinator")
180-
rootCommand.PersistentFlags().StringVar(&coordinatorEtcdPassword, "coordinator-etcd-password", "", "Password for etcd coordinator")
181-
rootCommand.PersistentFlags().StringVar(&coordinatorEtcdCertFile, "coordinator-etcd-cert-file", "", "Path to the etcd client certificate file")
182-
rootCommand.PersistentFlags().StringVar(&coordinatorEtcdKeyFile, "coordinator-etcd-key-file", "", "Path to the etcd client key file")
183-
rootCommand.PersistentFlags().StringVar(&coordinatorEtcdCAFile, "coordinator-etcd-ca-file", "", "Path to the etcd CA certificate file")
184-
185144
rootCommand.PersistentFlags().BoolVar(&runProfiler, "run-profiler", true, "Run go pprof for performance profiles on 8080 port")
186145
rootCommand.PersistentFlags().IntVar(&rt.CurrentJob, "coordinator-job-index", 0, "Worker job index")
187146
rootCommand.PersistentFlags().IntVar(&rt.ShardingUpload.JobCount, "coordinator-job-count", 0, "Worker job count, if more then 1 - run consider as sharded, coordinator is required to be non memory")

go.mod

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ require (
151151
github.com/containerd/containerd v1.7.25 // indirect
152152
github.com/containerd/log v0.1.0 // indirect
153153
github.com/containerd/platforms v0.2.1 // indirect
154-
github.com/coreos/go-semver v0.3.0 // indirect
155-
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
156154
github.com/cpuguy83/dockercfg v0.3.1 // indirect
157155
github.com/creack/pty v1.1.21 // indirect
158156
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
@@ -190,7 +188,7 @@ require (
190188
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
191189
github.com/gorilla/css v1.0.1 // indirect
192190
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
193-
github.com/imdario/mergo v0.3.15 // indirect
191+
github.com/imdario/mergo v0.3.12 // indirect
194192
github.com/inconshreveable/mousetrap v1.1.0 // indirect
195193
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
196194
github.com/jackc/pgpassfile v1.0.0 // indirect
@@ -265,8 +263,6 @@ require (
265263
github.com/yusufpapurcu/wmi v1.2.4 // indirect
266264
github.com/zeebo/assert v1.3.1 // indirect
267265
github.com/zeebo/xxh3 v1.0.2 // indirect
268-
go.etcd.io/etcd/api/v3 v3.5.21 // indirect
269-
go.etcd.io/etcd/client/pkg/v3 v3.5.21 // indirect
270266
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
271267
go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect
272268
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect

go.sum

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,8 @@ github.com/Microsoft/hcsshim v0.9.4/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfy
862862
github.com/Microsoft/hcsshim v0.9.6/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc=
863863
github.com/Microsoft/hcsshim v0.9.10/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc=
864864
github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w=
865-
github.com/Microsoft/hcsshim v0.13.0 h1:/BcXOiS6Qi7N9XqUcv27vkIuVOkBEcWstd2pMlWSeaA=
866-
github.com/Microsoft/hcsshim v0.13.0/go.mod h1:9KWJ/8DgU+QzYGupX4tzMhRQE8h6w90lH6HAaclpEok=
865+
github.com/Microsoft/hcsshim v0.11.7 h1:vl/nj3Bar/CvJSYo7gIQPyRWc9f3c6IeSNavBTSZNZQ=
866+
github.com/Microsoft/hcsshim v0.11.7/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU=
867867
github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU=
868868
github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY=
869869
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
@@ -1197,15 +1197,13 @@ github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmeka
11971197
github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=
11981198
github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
11991199
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
1200-
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
12011200
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
12021201
github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
12031202
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
12041203
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
12051204
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
12061205
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
12071206
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
1208-
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
12091207
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
12101208
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
12111209
github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E=
@@ -1672,9 +1670,8 @@ github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ
16721670
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
16731671
github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
16741672
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
1673+
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
16751674
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
1676-
github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM=
1677-
github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
16781675
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
16791676
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
16801677
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
@@ -2354,15 +2351,9 @@ go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
23542351
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
23552352
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
23562353
go.etcd.io/etcd/api/v3 v3.5.5/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8=
2357-
go.etcd.io/etcd/api/v3 v3.5.21 h1:A6O2/JDb3tvHhiIz3xf9nJ7REHvtEFJJ3veW3FbCnS8=
2358-
go.etcd.io/etcd/api/v3 v3.5.21/go.mod h1:c3aH5wcvXv/9dqIw2Y810LDXJfhSYdHQ0vxmP3CCHVY=
23592354
go.etcd.io/etcd/client/pkg/v3 v3.5.5/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ=
2360-
go.etcd.io/etcd/client/pkg/v3 v3.5.21 h1:lPBu71Y7osQmzlflM9OfeIV2JlmpBjqBNlLtcoBqUTc=
2361-
go.etcd.io/etcd/client/pkg/v3 v3.5.21/go.mod h1:BgqT/IXPjK9NkeSDjbzwsHySX3yIle2+ndz28nVsjUs=
23622355
go.etcd.io/etcd/client/v2 v2.305.5/go.mod h1:zQjKllfqfBVyVStbt4FaosoX2iYd8fV/GRy/PbowgP4=
23632356
go.etcd.io/etcd/client/v3 v3.5.5/go.mod h1:aApjR4WGlSumpnJ2kloS75h6aHUmAyaPLjHMxpc7E7c=
2364-
go.etcd.io/etcd/client/v3 v3.5.21 h1:T6b1Ow6fNjOLOtM0xSoKNQt1ASPCLWrF9XMHcH9pEyY=
2365-
go.etcd.io/etcd/client/v3 v3.5.21/go.mod h1:mFYy67IOqmbRf/kRUvsHixzo3iG+1OF2W2+jVIQRAnU=
23662357
go.etcd.io/etcd/pkg/v3 v3.5.5/go.mod h1:6ksYFxttiUGzC2uxyqiyOEvhAiD0tuIqSZkX3TyPdaE=
23672358
go.etcd.io/etcd/raft/v3 v3.5.5/go.mod h1:76TA48q03g1y1VpTue92jZLr9lIHKUNcYdZOOGyx8rI=
23682359
go.etcd.io/etcd/server/v3 v3.5.5/go.mod h1:rZ95vDw/jrvsbj9XpTqPrTAB9/kzchVdhRirySPkUBc=
@@ -2395,8 +2386,8 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0/go.mod h1:
23952386
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.0/go.mod h1:9NiG9I2aHTKkcxqCILhjtyNA1QEiCjdBACv4IvrFQ+c=
23962387
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q=
23972388
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
2398-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus=
2399-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q=
2389+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRNDSWJOTobXh5HyQKjq6wUC5tNybqjIqDpAY4CU=
2390+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ=
24002391
go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU=
24012392
go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs=
24022393
go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=

pkg/abstract/async_sink.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type AsyncSink interface {
1919
// AsyncPushConcurrencyErr indicates a Push has been called on an already closed AsyncSink. This must not happen and means there are concurrency issues in the implementation of a source.
2020
var AsyncPushConcurrencyErr = xerrors.NewSentinel("AsyncPush is called after Close")
2121

22-
// PusherFromAsyncSink wraps the given sink into a (synchronous) pusher interface.
22+
// PusherFromAsyncSink wraps the given sink into a (synchronous) pusher interface
2323
func PusherFromAsyncSink(asink AsyncSink) Pusher {
2424
return func(items []ChangeItem) error {
2525
return <-asink.AsyncPush(items)

pkg/abstract/changeitem/change_item.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,10 @@ func (c *ChangeItem) MakeMapKeys() map[string]bool {
211211
return keyCols
212212
}
213213

214-
// ColumnName is an explicitly declared column name.
214+
// ColumnName is an explicitly declared column name
215215
type ColumnName string
216216

217-
// FastTableSchema is a mapping from column name to its schema.
217+
// FastTableSchema is a mapping from column name to its schema
218218
type FastTableSchema map[ColumnName]ColSchema
219219

220220
// MakeFastTableSchema produces a fast table schema from an array of schemas of each column. Column names are taken from these schemas.
@@ -227,7 +227,7 @@ func MakeFastTableSchema(slowTableSchema []ColSchema) FastTableSchema {
227227
}
228228

229229
// KeysChanged - checks if update changes primary keys
230-
// NOTE: this method is quite inefficient.
230+
// NOTE: this method is quite inefficient
231231
func (c *ChangeItem) KeysChanged() bool {
232232
if c.Kind != UpdateKind {
233233
return false
@@ -304,7 +304,7 @@ func (c *ChangeItem) IsToasted() bool {
304304
return false
305305
}
306306

307-
// OldOrCurrentKeys returns a string representing the values of the columns from the given set of columns, extracted from OldKeys or ColumnValues, if OldKeys are absent.
307+
// OldOrCurrentKeys returns a string representing the values of the columns from the given set of columns, extracted from OldKeys or ColumnValues, if OldKeys are absent
308308
func (c *ChangeItem) OldOrCurrentKeysString(keyColumns map[string]bool) string {
309309
if (c.Kind == UpdateKind || c.Kind == DeleteKind) && len(c.OldKeys.KeyValues) > 0 {
310310
keys := make(map[string]interface{})
@@ -360,7 +360,7 @@ func ContainsNonRowItem(s []ChangeItem) bool {
360360
return false
361361
}
362362

363-
// FindItemOfKind returns an item in the slice whose kind is among the given ones, or nil if there is no such item in it.
363+
// FindItemOfKind returns an item in the slice whose kind is among the given ones, or nil if there is no such item in it
364364
func FindItemOfKind(s []ChangeItem, kinds ...Kind) *ChangeItem {
365365
wanted := make(map[Kind]bool)
366366
for _, k := range kinds {
@@ -375,7 +375,7 @@ func FindItemOfKind(s []ChangeItem, kinds ...Kind) *ChangeItem {
375375
}
376376

377377
// IsMirror
378-
// mirror - it's special format with hardcoded schema - used for "mirroring" (queue->queue) - transfer messages between queues without changes.
378+
// mirror - it's special format with hardcoded schema - used for "mirroring" (queue->queue) - transfer messages between queues without changes
379379
func (c *ChangeItem) IsMirror() bool {
380380
if len(c.ColumnNames) != len(RawDataColumns) {
381381
return false
@@ -683,7 +683,7 @@ func (c *ChangeItem) SetTableSchema(tableSchema *TableSchema) {
683683
}
684684

685685
// RemoveColumns mutate change item to skip some columns from it.
686-
// it remove it from column names and column values.
686+
// it remove it from column names and column values
687687
func (c *ChangeItem) RemoveColumns(cols ...string) {
688688
toDelete := map[string]struct{}{}
689689
for _, col := range cols {

pkg/abstract/changeitem/kind.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const (
1010
// For each table being uploaded the following ChangeItems should be emited in order
1111
// InitShardedTableLoad -> N * (InitTableLoad -> row events -> DoneTableLoad) -> DoneShardedTableLoad
1212
// where N is number of table parts if table is sharded (thus N = 1 if table is not sharded)
13-
// Each ChangeItem of those kinds should contain TableSchema for the corresponding table.
13+
// Each ChangeItem of those kinds should contain TableSchema for the corresponding table
1414

1515
// InitShardedTableLoad is table header.
16-
// All Init/DoneTableLoad and data items for the same table should be sent strictly after this kind of item.
16+
// All Init/DoneTableLoad and data items for the same table should be sent strictly after this kind of item
1717
InitShardedTableLoad = Kind("init_sharded_table_load")
1818
// InitTableLoad is table part header. It should be sent for each table part before uploading any data for that part.
1919
// If the table is not sharded, it is considered to have a single part so InitTableLoad should be sent

pkg/abstract/changeitem/table_id.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (t TableID) Equals(other TableID) bool {
4848

4949
// Includes returns true if the given ID identifies a subset of tables identified by the current ID.
5050
//
51-
// In other words, it is a result of an operation "is a superset of".
51+
// In other words, it is a result of an operation "is a superset of"
5252
func (t TableID) Includes(sub TableID) bool {
5353
if t.Equals(sub) {
5454
return true

pkg/abstract/changeitem/table_part_id.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type TablePartID struct {
1414

1515
func (t *TablePartID) FqtnWithPartID() string {
1616
if t.PartID == "" {
17-
return t.Fqtn()
17+
return t.TableID.Fqtn()
1818
}
19-
return fmt.Sprintf("%s.%s", t.Fqtn(), t.PartID)
19+
return fmt.Sprintf("%s.%s", t.TableID.Fqtn(), t.PartID)
2020
}

pkg/abstract/changeitem/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
)
77

8-
// MakeMapColNameToIndex returns a mapping of a column name to an index in the given slice.
8+
// MakeMapColNameToIndex returns a mapping of a column name to an index in the given slice
99
func MakeMapColNameToIndex(in []ColSchema) map[string]int {
1010
result := make(map[string]int)
1111
for i, column := range in {
@@ -24,7 +24,7 @@ func KeyNames(in []ColSchema) []string {
2424
return result
2525
}
2626

27-
// Sniff dat data.
27+
// Sniff dat data
2828
func Sniff(input []ChangeItem) string {
2929
tables := make(map[TableID]ChangeItem)
3030
tablesCntr := make(map[TableID]int)

pkg/abstract/coordinator/editor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "github.com/transferia/transferia/pkg/abstract/model"
44

55
// Editor is obsolete interface to update entities on coordinator
66
//
7-
// Deprecated: do not rely on it anymore.
7+
// Deprecated: do not rely on it anymore
88
type Editor interface {
99
// GetEndpointTransfers get all *other* linked transfer to either source or target of provider *transferID*
1010
GetEndpointTransfers(transferID string, isSource bool) ([]*model.Transfer, error)

0 commit comments

Comments
 (0)