vitess.io/vitess@v0.16.2/go/vt/vttablet/tabletmanager/events/state_change.go (about) 1 /* 2 Copyright 2019 The Vitess Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // Package events contains event structs used by the tabletmanager package. 18 package events 19 20 import topodatapb "vitess.io/vitess/go/vt/proto/topodata" 21 22 // StateChange is an event that describes state changes in the tablet as seen 23 // by the TabletManager. It is triggered after the tablet has processed a state 24 // change, which might have been initiated internally, or when the tablet 25 // noticed that an external process modified its topo record. 26 type StateChange struct { 27 // OldTablet is the topo record of the tablet before the change. 28 OldTablet topodatapb.Tablet 29 // NewTablet is the topo record representing the current state. 30 NewTablet topodatapb.Tablet 31 // Reason is an optional string that describes the source of the change. 32 Reason string 33 }