The TabletType is a protocol buffer message used in the vitess project to identify the type of tablet (shard) in a distributed database cluster. This message defines the tablet type as one of MASTER, REPLICA, RDONLY or BATCH. The TabletType is part of the topodata package in the go github.com.youtube.vitess.go.vt.proto library.
Example 1: Setting the TabletType to MASTER
tabletType := topodata.TabletType_MASTER
Example 2: Checking if a tablet is a replica
if tabletType == topodata.TabletType_REPLICA { // do something }
These examples show how to set and check tablet types using the TabletType message in the go github.com.youtube.vitess.go.vt.proto.topodata package.
Golang TabletType - 23 examples found. These are the top rated real world Golang examples of github.com/youtube/vitess/go/vt/proto/topodata.TabletType extracted from open source projects. You can rate examples to help us improve the quality of examples.