@@ -31,9 +31,9 @@ import (
3131 "github.com/cockroachdb/cockroach/pkg/cloud"
3232 "github.com/cockroachdb/cockroach/pkg/gossip"
3333 "github.com/cockroachdb/cockroach/pkg/keys"
34- "github.com/cockroachdb/cockroach/pkg/kv/kvserver"
3534 "github.com/cockroachdb/cockroach/pkg/kv/kvserver/gc"
3635 "github.com/cockroachdb/cockroach/pkg/kv/kvserver/liveness/livenesspb"
36+ "github.com/cockroachdb/cockroach/pkg/kv/kvserver/print"
3737 "github.com/cockroachdb/cockroach/pkg/kv/kvserver/rditer"
3838 "github.com/cockroachdb/cockroach/pkg/roachpb"
3939 "github.com/cockroachdb/cockroach/pkg/security/username"
@@ -312,13 +312,13 @@ func runDebugKeys(cmd *cobra.Command, args []string) error {
312312 }
313313 return strings .Join (pairs , ", " ), nil
314314 }
315- kvserver .DebugSprintMVCCKeyValueDecoders = append (kvserver .DebugSprintMVCCKeyValueDecoders , fn )
315+ print .DebugSprintMVCCKeyValueDecoders = append (print .DebugSprintMVCCKeyValueDecoders , fn )
316316 }
317317 printer := printKey
318318 rangeKeyPrinter := printRangeKey
319319 if debugCtx .values {
320- printer = kvserver .PrintMVCCKeyValue
321- rangeKeyPrinter = kvserver .PrintMVCCRangeKeyValue
320+ printer = print .PrintMVCCKeyValue
321+ rangeKeyPrinter = print .PrintMVCCRangeKeyValue
322322 }
323323
324324 keyTypeOptions := keyTypeParams [debugCtx .keyTypes ]
@@ -509,7 +509,7 @@ func runDebugRangeData(cmd *cobra.Command, args []string) error {
509509 if err != nil {
510510 return err
511511 }
512- kvserver .PrintEngineKeyValue (key , v )
512+ print .PrintEngineKeyValue (key , v )
513513 results ++
514514 if results == debugCtx .maxResults {
515515 return iterutil .StopIteration ()
@@ -522,7 +522,7 @@ func runDebugRangeData(cmd *cobra.Command, args []string) error {
522522 return err
523523 }
524524 for _ , v := range iter .EngineRangeKeys () {
525- kvserver .PrintEngineRangeKeyValue (bounds , v )
525+ print .PrintEngineRangeKeyValue (bounds , v )
526526 results ++
527527 if results == debugCtx .maxResults {
528528 return iterutil .StopIteration ()
@@ -553,7 +553,7 @@ func loadRangeDescriptor(
553553 // We only want values, not MVCCMetadata.
554554 return nil
555555 }
556- if err := kvserver .IsRangeDescriptorKey (kv .Key ); err != nil {
556+ if err := print .IsRangeDescriptorKey (kv .Key ); err != nil {
557557 // Range descriptor keys are interleaved with others, so if it
558558 // doesn't parse as a range descriptor just skip it.
559559 return nil //nolint:returnerrcheck
@@ -609,10 +609,10 @@ func runDebugRangeDescriptors(cmd *cobra.Command, args []string) error {
609609 return db .MVCCIterate (cmd .Context (), start , end , storage .MVCCKeyAndIntentsIterKind ,
610610 storage .IterKeyTypePointsOnly , fs .UnknownReadCategory ,
611611 func (kv storage.MVCCKeyValue , _ storage.MVCCRangeKeyStack ) error {
612- if kvserver .IsRangeDescriptorKey (kv .Key ) != nil {
612+ if print .IsRangeDescriptorKey (kv .Key ) != nil {
613613 return nil
614614 }
615- kvserver .PrintMVCCKeyValue (kv )
615+ print .PrintMVCCKeyValue (kv )
616616 return nil
617617 })
618618}
@@ -693,7 +693,7 @@ Decode and print a hexadecimal-encoded key-value pair.
693693 // is already a roachpb.Key, so make a half-assed attempt to support both.
694694 if ! isTS {
695695 if k , ok := storage .DecodeEngineKey (bs [0 ]); ok {
696- kvserver .PrintEngineKeyValue (k , bs [1 ])
696+ print .PrintEngineKeyValue (k , bs [1 ])
697697 return nil
698698 }
699699 fmt .Printf ("unable to decode key: %v, assuming it's a roachpb.Key with fake timestamp;\n " +
@@ -705,7 +705,7 @@ Decode and print a hexadecimal-encoded key-value pair.
705705 }
706706 }
707707
708- kvserver .PrintMVCCKeyValue (storage.MVCCKeyValue {
708+ print .PrintMVCCKeyValue (storage.MVCCKeyValue {
709709 Key : k ,
710710 Value : bs [1 ],
711711 })
@@ -787,7 +787,7 @@ func runDebugRaftLog(cmd *cobra.Command, args []string) error {
787787 return db .MVCCIterate (cmd .Context (), start , end , storage .MVCCKeyIterKind ,
788788 storage .IterKeyTypePointsOnly , fs .UnknownReadCategory ,
789789 func (kv storage.MVCCKeyValue , _ storage.MVCCRangeKeyStack ) error {
790- kvserver .PrintMVCCKeyValue (kv )
790+ print .PrintMVCCKeyValue (kv )
791791 return nil
792792 })
793793}
@@ -1381,7 +1381,7 @@ func (m mvccValueFormatter) Format(f fmt.State, c rune) {
13811381 errors .FormatError (m .err , f , c )
13821382 return
13831383 }
1384- fmt .Fprint (f , kvserver .SprintMVCCKeyValue (m .kv , false /* printKey */ ))
1384+ fmt .Fprint (f , print .SprintMVCCKeyValue (m .kv , false /* printKey */ ))
13851385}
13861386
13871387// lockValueFormatter is a fmt.Formatter for lock values.
@@ -1391,7 +1391,7 @@ type lockValueFormatter struct {
13911391
13921392// Format implements the fmt.Formatter interface.
13931393func (m lockValueFormatter ) Format (f fmt.State , c rune ) {
1394- fmt .Fprint (f , kvserver .SprintIntent (m .value ))
1394+ fmt .Fprint (f , print .SprintIntent (m .value ))
13951395}
13961396
13971397// pebbleToolFS is the vfs.FS that the pebble tool should use.
0 commit comments