@@ -29,11 +29,10 @@ func NewStorageEngineClient(nd *nodedialer.Dialer) *StorageEngineClient {
29
29
func (c * StorageEngineClient ) CompactEngineSpan (
30
30
ctx context.Context , nodeID , storeID int32 , startKey , endKey []byte ,
31
31
) error {
32
- conn , err := c .nd . Dial ( ctx , roachpb .NodeID (nodeID ), rpcbase .DefaultClass )
32
+ client , err := DialPerStoreClient ( c .nd , ctx , roachpb .NodeID (nodeID ), rpcbase .DefaultClass )
33
33
if err != nil {
34
34
return errors .Wrapf (err , "could not dial node ID %d" , nodeID )
35
35
}
36
- client := NewPerStoreClient (conn )
37
36
req := & CompactEngineSpanRequest {
38
37
StoreRequestHeader : StoreRequestHeader {
39
38
NodeID : roachpb .NodeID (nodeID ),
@@ -49,12 +48,10 @@ func (c *StorageEngineClient) CompactEngineSpan(
49
48
func (c * StorageEngineClient ) GetTableMetrics (
50
49
ctx context.Context , nodeID , storeID int32 , startKey , endKey []byte ,
51
50
) ([]enginepb.SSTableMetricsInfo , error ) {
52
- conn , err := c .nd . Dial ( ctx , roachpb .NodeID (nodeID ), rpcbase .DefaultClass )
51
+ client , err := DialPerStoreClient ( c .nd , ctx , roachpb .NodeID (nodeID ), rpcbase .DefaultClass )
53
52
if err != nil {
54
53
return []enginepb.SSTableMetricsInfo {}, errors .Wrapf (err , "could not dial node ID %d" , nodeID )
55
54
}
56
-
57
- client := NewPerStoreClient (conn )
58
55
req := & GetTableMetricsRequest {
59
56
StoreRequestHeader : StoreRequestHeader {
60
57
NodeID : roachpb .NodeID (nodeID ),
@@ -75,12 +72,10 @@ func (c *StorageEngineClient) GetTableMetrics(
75
72
func (c * StorageEngineClient ) ScanStorageInternalKeys (
76
73
ctx context.Context , nodeID , storeID int32 , startKey , endKey []byte , megabytesPerSecond int64 ,
77
74
) ([]enginepb.StorageInternalKeysMetrics , error ) {
78
- conn , err := c .nd . Dial ( ctx , roachpb .NodeID (nodeID ), rpcbase .DefaultClass )
75
+ client , err := DialPerStoreClient ( c .nd , ctx , roachpb .NodeID (nodeID ), rpcbase .DefaultClass )
79
76
if err != nil {
80
77
return []enginepb.StorageInternalKeysMetrics {}, errors .Wrapf (err , "could not dial node ID %d" , nodeID )
81
78
}
82
-
83
- client := NewPerStoreClient (conn )
84
79
req := & ScanStorageInternalKeysRequest {
85
80
StoreRequestHeader : StoreRequestHeader {
86
81
NodeID : roachpb .NodeID (nodeID ),
@@ -102,11 +97,10 @@ func (c *StorageEngineClient) ScanStorageInternalKeys(
102
97
func (c * StorageEngineClient ) SetCompactionConcurrency (
103
98
ctx context.Context , nodeID , storeID int32 , compactionConcurrency uint64 ,
104
99
) error {
105
- conn , err := c .nd . Dial ( ctx , roachpb .NodeID (nodeID ), rpcbase .DefaultClass )
100
+ client , err := DialPerStoreClient ( c .nd , ctx , roachpb .NodeID (nodeID ), rpcbase .DefaultClass )
106
101
if err != nil {
107
102
return errors .Wrapf (err , "could not dial node ID %d" , nodeID )
108
103
}
109
- client := NewPerStoreClient (conn )
110
104
req := & CompactionConcurrencyRequest {
111
105
StoreRequestHeader : StoreRequestHeader {
112
106
NodeID : roachpb .NodeID (nodeID ),
0 commit comments