Skip to content

Commit 4921626

Browse files
committed
Clean unnecessary code
Signed-off-by: Noble Mittal <[email protected]>
1 parent ff0f1ef commit 4921626

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

go/cmd/vtctldclient/command/vreplication/lookupvindex/lookupvindex.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ func registerCommands(root *cobra.Command) {
476476
// This will create the lookup vindex in the specified keyspace
477477
// and setup a VReplication workflow to backfill its lookup table.
478478
create.Flags().StringVar(&createOptions.Keyspace, "keyspace", "", "The keyspace to create the Lookup Vindex in. This is also where the table-owner must exist.")
479-
base.MarkPersistentFlagRequired("keyspace")
479+
create.MarkFlagRequired("keyspace")
480480
create.Flags().StringVar(&createOptions.Type, "type", "", "The type of Lookup Vindex to create.")
481481
create.Flags().StringVar(&createOptions.TableOwner, "table-owner", "", "The table holding the data which we should use to backfill the Lookup Vindex. This must exist in the same keyspace as the Lookup Vindex.")
482482
create.Flags().StringSliceVar(&createOptions.TableOwnerColumns, "table-owner-columns", nil, "The columns to read from the owner table. These will be used to build the hash which gets stored as the keyspace_id value in the lookup table.")

go/vt/vtctl/workflow/lookup_vindex.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func newLookupVindex(ws *Server) *lookupVindex {
6262
}
6363
}
6464

65-
// prepareMultipleCreate performs the preparatory steps for creating a LookupVindex.
65+
// prepareCreate performs the preparatory steps for creating a LookupVindex.
6666
func (lv *lookupVindex) prepareCreate(ctx context.Context, workflow, keyspace string, specs *vschemapb.Keyspace, continueAfterCopyWithOwner bool) (
6767
ms *vtctldatapb.MaterializeSettings, sourceVSchema, targetVSchema *topo.KeyspaceVSchemaInfo, cancelFunc func() error, err error) {
6868
var (

go/vt/vtctl/workflow/server.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -604,16 +604,7 @@ func (s *Server) LookupVindexCreate(ctx context.Context, req *vtctldatapb.Lookup
604604

605605
lv := newLookupVindex(s)
606606

607-
var (
608-
ms *vtctldatapb.MaterializeSettings
609-
sourceVSchema *topo.KeyspaceVSchemaInfo
610-
targetVSchema *topo.KeyspaceVSchemaInfo
611-
cancelFunc func() error
612-
err error
613-
)
614-
615-
ms, sourceVSchema, targetVSchema, cancelFunc, err = lv.prepareCreate(ctx, req.Workflow, req.Keyspace, req.Vindex, req.ContinueAfterCopyWithOwner)
616-
607+
ms, sourceVSchema, targetVSchema, cancelFunc, err := lv.prepareCreate(ctx, req.Workflow, req.Keyspace, req.Vindex, req.ContinueAfterCopyWithOwner)
617608
if err != nil {
618609
return nil, err
619610
}

0 commit comments

Comments
 (0)