-
Notifications
You must be signed in to change notification settings - Fork 116
/
cluster_not_supported.go
259 lines (205 loc) · 6.4 KB
/
cluster_not_supported.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
package cluster
import (
"time"
"github.com/libopenstorage/gossip/types"
"github.com/libopenstorage/openstorage/api"
"github.com/libopenstorage/openstorage/objectstore"
"github.com/libopenstorage/openstorage/osdconfig"
"github.com/libopenstorage/openstorage/pkg/clusterdomain"
"github.com/libopenstorage/openstorage/pkg/diags"
"github.com/libopenstorage/openstorage/pkg/job"
"github.com/libopenstorage/openstorage/pkg/nodedrain"
"github.com/libopenstorage/openstorage/pkg/storagepool"
"github.com/libopenstorage/openstorage/schedpolicy"
"github.com/libopenstorage/openstorage/secrets"
)
// NullClusterManager is a NULL implementation of the Cluster interface
// It is primarily used for testing the ClusterManager as well as the
// ClusterListener interface
type NullClusterManager struct {
NullClusterData
NullClusterRemove
NullClusterStatus
NullClusterAlerts
NullClusterPair
osdconfig.NullConfigCaller
secrets.NullSecrets
schedpolicy.NullSchedMgr
objectstore.NullObjectStoreMgr
clusterdomain.NullClusterDomainManager
storagepool.UnsupportedPoolProvider
job.UnsupportedJobProvider
nodedrain.UnsupportedNodeDrainProvider
diags.UnsupportedDiagsProvider
}
func NewDefaultClusterManager() Cluster {
return &NullClusterManager{}
}
// NullClusterData is a NULL implementation of the ClusterData interface
type NullClusterData struct {
}
func NewDefaultClusterData() ClusterData {
return &NullClusterData{}
}
// NullClusterRemove is a NULL implementation of the ClusterRemove interface
type NullClusterRemove struct {
}
func NewDefaultClusterRemove() ClusterRemove {
return &NullClusterRemove{}
}
// NullClusterStatus is a NULL implementation of the ClusterStatus interface
type NullClusterStatus struct {
}
func NewDefaultClusterStatus() ClusterStatus {
return &NullClusterStatus{}
}
// NullClusterAlerts is a NULL implementation of the ClusterAlerts interface
type NullClusterAlerts struct {
}
func NewDefaultClusterAlerts() ClusterAlerts {
return &NullClusterAlerts{}
}
// NullClusterPair is a NULL implementation of the ClusterPair interface
type NullClusterPair struct {
}
func NewDefaultCluterPair() ClusterPair {
return &NullClusterPair{}
}
// NullClusterManager implementations
// Inspect
func (m *NullClusterManager) Inspect(arg0 string) (api.Node, error) {
return api.Node{}, ErrNotImplemented
}
// AddEventListener
func (m *NullClusterManager) AddEventListener(arg0 ClusterListener) error {
return nil
}
// Enumerate
func (m *NullClusterManager) Enumerate() (api.Cluster, error) {
return api.Cluster{}, ErrNotImplemented
}
// SetSize
func (m *NullClusterManager) SetSize(arg0 int) error {
return ErrNotImplemented
}
// Shutdown
func (m *NullClusterManager) Shutdown() error {
return ErrNotImplemented
}
// Start
func (m *NullClusterManager) Start(arg1 bool, arg2 string, arg3 string) error {
return ErrNotImplemented
}
// StartWithConfiguration
func (m *NullClusterManager) StartWithConfiguration(arg1 bool, arg2 string, arg3 []string, arg4 string, arg5 *ClusterServerConfiguration) error {
return ErrNotImplemented
}
func (n *NullClusterManager) Uuid() string {
return ""
}
func (n *NullClusterManager) ClusterNotifyNodeDown(culpritNodeId string) (string, error) {
return "", ErrNotImplemented
}
func (n *NullClusterManager) ClusterNotifyClusterDomainsUpdate(types.ClusterDomainsActiveMap) error {
return ErrNotImplemented
}
// NullClusterData implementations
// UpdateData
func (m *NullClusterData) UpdateData(arg0 map[string]interface{}) error {
return ErrNotImplemented
}
// UpdateLabels
func (m *NullClusterData) UpdateLabels(arg0 map[string]string) error {
return ErrNotImplemented
}
// UpdateSchedulerNodeName
func (m *NullClusterData) UpdateSchedulerNodeName(arg0 string) error {
return ErrNotImplemented
}
// GetData
func (m *NullClusterData) GetData() (map[string]*api.Node, error) {
return nil, ErrNotImplemented
}
// GetNodeIdFromIp
func (m *NullClusterData) GetNodeIdFromIp(arg0 string) (string, error) {
return "", ErrNotImplemented
}
// EnableUpdates
func (m *NullClusterData) EnableUpdates() error {
return ErrNotImplemented
}
// DisableUpdates
func (m *NullClusterData) DisableUpdates() error {
return ErrNotImplemented
}
// GetGossipState
func (m *NullClusterData) GetGossipState() *ClusterState {
return nil
}
// GetGossipIntervals
func (c *NullClusterData) GetGossipIntervals() types.GossipIntervals {
return types.GossipIntervals{}
}
// NullClusterRemove implementations
// Remove
func (m *NullClusterRemove) Remove(arg0 []api.Node, arg1 bool) error {
return ErrNotImplemented
}
// NodeRemoveDone
func (m *NullClusterRemove) NodeRemoveDone(arg0 string, arg1 error) error {
return ErrNotImplemented
}
// NullClusterStatus implementations
// Nodestatus
func (m *NullClusterStatus) NodeStatus() (api.Status, error) {
return api.Status_STATUS_NONE, ErrNotImplemented
}
// PeerStatus
func (m *NullClusterStatus) PeerStatus(arg0 string) (map[string]api.Status, error) {
return nil, ErrNotImplemented
}
// NullClusterAlerts implementations
// EnumerateAlerts
func (m *NullClusterAlerts) EnumerateAlerts(arg0, arg1 time.Time, arg2 api.ResourceType) (*api.Alerts, error) {
return nil, ErrNotImplemented
}
// EraseAlert
func (m *NullClusterAlerts) EraseAlert(arg0 api.ResourceType, arg1 int64) error {
return ErrNotImplemented
}
// NullClusterPair implementations
// CreatePair
func (m *NullClusterPair) CreatePair(arg0 *api.ClusterPairCreateRequest) (*api.ClusterPairCreateResponse, error) {
return nil, ErrNotImplemented
}
// ProcessPairRequest
func (m *NullClusterPair) ProcessPairRequest(arg0 *api.ClusterPairProcessRequest) (*api.ClusterPairProcessResponse, error) {
return nil, ErrNotImplemented
}
// GetPair
func (m *NullClusterPair) GetPair(arg0 string) (*api.ClusterPairGetResponse, error) {
return nil, ErrNotImplemented
}
// RefreshPair
func (m *NullClusterPair) RefreshPair(arg0 string) error {
return ErrNotImplemented
}
func (m *NullClusterPair) GetPairMode() api.ClusterPairMode_Mode {
return api.ClusterPairMode_Default
}
// EnumeratePairs
func (m *NullClusterPair) EnumeratePairs() (*api.ClusterPairsEnumerateResponse, error) {
return nil, ErrNotImplemented
}
// ValidatePair
func (m *NullClusterPair) ValidatePair(arg0 string) error {
return ErrNotImplemented
}
// DeletePair
func (m *NullClusterPair) DeletePair(arg0 string) error {
return ErrNotImplemented
}
// GetPairToken
func (m *NullClusterPair) GetPairToken(arg0 bool) (*api.ClusterPairTokenGetResponse, error) {
return nil, ErrNotImplemented
}