forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.pb.go
4433 lines (4300 loc) · 113 KB
/
data.pb.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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-gogo.
// source: cockroach/pkg/roachpb/data.proto
// DO NOT EDIT!
package roachpb
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import cockroach_storage_engine_enginepb "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb"
import cockroach_util_hlc "github.com/cockroachdb/cockroach/pkg/util/hlc"
import github_com_cockroachdb_cockroach_pkg_util_uuid "github.com/cockroachdb/cockroach/pkg/util/uuid"
import bytes "bytes"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// ValueType defines a set of type constants placed in the "tag" field of Value
// messages. These are defined as a protocol buffer enumeration so that they
// can be used portably between our Go and C code. The tags are used by the
// RocksDB Merge Operator to perform specialized merges.
type ValueType int32
const (
// This is a subset of the SQL column type values, representing the underlying
// storage for various types. The DELIMITED_foo entries each represent a foo
// variant that self-delimits length.
ValueType_UNKNOWN ValueType = 0
ValueType_NULL ValueType = 7
ValueType_INT ValueType = 1
ValueType_FLOAT ValueType = 2
ValueType_BYTES ValueType = 3
ValueType_DELIMITED_BYTES ValueType = 8
ValueType_TIME ValueType = 4
ValueType_DECIMAL ValueType = 5
ValueType_DELIMITED_DECIMAL ValueType = 9
ValueType_DURATION ValueType = 6
// TUPLE represents a DTuple, encoded as repeated pairs of varint field number
// followed by a value encoded Datum.
ValueType_TUPLE ValueType = 10
// TIMESERIES is applied to values which contain InternalTimeSeriesData.
ValueType_TIMESERIES ValueType = 100
)
var ValueType_name = map[int32]string{
0: "UNKNOWN",
7: "NULL",
1: "INT",
2: "FLOAT",
3: "BYTES",
8: "DELIMITED_BYTES",
4: "TIME",
5: "DECIMAL",
9: "DELIMITED_DECIMAL",
6: "DURATION",
10: "TUPLE",
100: "TIMESERIES",
}
var ValueType_value = map[string]int32{
"UNKNOWN": 0,
"NULL": 7,
"INT": 1,
"FLOAT": 2,
"BYTES": 3,
"DELIMITED_BYTES": 8,
"TIME": 4,
"DECIMAL": 5,
"DELIMITED_DECIMAL": 9,
"DURATION": 6,
"TUPLE": 10,
"TIMESERIES": 100,
}
func (x ValueType) Enum() *ValueType {
p := new(ValueType)
*p = x
return p
}
func (x ValueType) String() string {
return proto.EnumName(ValueType_name, int32(x))
}
func (x *ValueType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(ValueType_value, data, "ValueType")
if err != nil {
return err
}
*x = ValueType(value)
return nil
}
func (ValueType) EnumDescriptor() ([]byte, []int) { return fileDescriptorData, []int{0} }
// ReplicaChangeType is a parameter of ChangeReplicasTrigger.
type ReplicaChangeType int32
const (
ADD_REPLICA ReplicaChangeType = 0
REMOVE_REPLICA ReplicaChangeType = 1
)
var ReplicaChangeType_name = map[int32]string{
0: "ADD_REPLICA",
1: "REMOVE_REPLICA",
}
var ReplicaChangeType_value = map[string]int32{
"ADD_REPLICA": 0,
"REMOVE_REPLICA": 1,
}
func (x ReplicaChangeType) Enum() *ReplicaChangeType {
p := new(ReplicaChangeType)
*p = x
return p
}
func (x ReplicaChangeType) String() string {
return proto.EnumName(ReplicaChangeType_name, int32(x))
}
func (x *ReplicaChangeType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(ReplicaChangeType_value, data, "ReplicaChangeType")
if err != nil {
return err
}
*x = ReplicaChangeType(value)
return nil
}
func (ReplicaChangeType) EnumDescriptor() ([]byte, []int) { return fileDescriptorData, []int{1} }
// TransactionStatus specifies possible states for a transaction.
type TransactionStatus int32
const (
// PENDING is the default state for a new transaction. Transactions
// move from PENDING to one of COMMITTED or ABORTED. Mutations made
// as part of a PENDING transactions are recorded as "intents" in
// the underlying MVCC model.
PENDING TransactionStatus = 0
// COMMITTED is the state for a transaction which has been
// committed. Mutations made as part of a transaction which is moved
// into COMMITTED state become durable and visible to other
// transactions, moving from "intents" to permanent versioned
// values.
COMMITTED TransactionStatus = 1
// ABORTED is the state for a transaction which has been aborted.
// Mutations made as part of a transaction which is moved into
// ABORTED state are deleted and are never made visible to other
// transactions.
ABORTED TransactionStatus = 2
)
var TransactionStatus_name = map[int32]string{
0: "PENDING",
1: "COMMITTED",
2: "ABORTED",
}
var TransactionStatus_value = map[string]int32{
"PENDING": 0,
"COMMITTED": 1,
"ABORTED": 2,
}
func (x TransactionStatus) Enum() *TransactionStatus {
p := new(TransactionStatus)
*p = x
return p
}
func (x TransactionStatus) String() string {
return proto.EnumName(TransactionStatus_name, int32(x))
}
func (x *TransactionStatus) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(TransactionStatus_value, data, "TransactionStatus")
if err != nil {
return err
}
*x = TransactionStatus(value)
return nil
}
func (TransactionStatus) EnumDescriptor() ([]byte, []int) { return fileDescriptorData, []int{2} }
// Span is supplied with every storage node request.
type Span struct {
// The key for request. If the request operates on a range, this
// represents the starting key for the range.
Key Key `protobuf:"bytes,3,opt,name=key,casttype=Key" json:"key,omitempty"`
// The end key is empty if the request spans only a single key. Otherwise,
// it must order strictly after Key. In such a case, the header indicates
// that the operation takes place on the key range from Key to EndKey,
// including Key and excluding EndKey.
EndKey Key `protobuf:"bytes,4,opt,name=end_key,json=endKey,casttype=Key" json:"end_key,omitempty"`
}
func (m *Span) Reset() { *m = Span{} }
func (*Span) ProtoMessage() {}
func (*Span) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{0} }
// Value specifies the value at a key. Multiple values at the same key are
// supported based on timestamp. The data stored within a value is typed
// (ValueType) and custom encoded into the raw_bytes field. A custom encoding
// is used instead of separate proto fields to avoid proto overhead and to
// avoid unnecessary encoding and decoding as the value gets read from disk and
// passed through the network. The format is:
//
// <4-byte-checksum><1-byte-tag><encoded-data>
//
// A CRC-32-IEEE checksum is computed from the associated key, tag and encoded
// data, in that order.
//
// TODO(peter): Is a 4-byte checksum overkill when most (all?) values
// will be less than 64KB?
type Value struct {
// raw_bytes contains the encoded value and checksum.
RawBytes []byte `protobuf:"bytes,1,opt,name=raw_bytes,json=rawBytes" json:"raw_bytes,omitempty"`
// Timestamp of value.
Timestamp cockroach_util_hlc.Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp"`
}
func (m *Value) Reset() { *m = Value{} }
func (m *Value) String() string { return proto.CompactTextString(m) }
func (*Value) ProtoMessage() {}
func (*Value) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{1} }
// KeyValue is a pair of Key and Value for returned Key/Value pairs
// from ScanRequest/ScanResponse. It embeds a Key and a Value.
type KeyValue struct {
Key Key `protobuf:"bytes,1,opt,name=key,casttype=Key" json:"key,omitempty"`
Value Value `protobuf:"bytes,2,opt,name=value" json:"value"`
}
func (m *KeyValue) Reset() { *m = KeyValue{} }
func (m *KeyValue) String() string { return proto.CompactTextString(m) }
func (*KeyValue) ProtoMessage() {}
func (*KeyValue) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{2} }
// A StoreIdent uniquely identifies a store in the cluster. The
// StoreIdent is written to the underlying storage engine at a
// store-reserved system key (KeyLocalIdent).
type StoreIdent struct {
ClusterID github_com_cockroachdb_cockroach_pkg_util_uuid.UUID `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,customtype=github.com/cockroachdb/cockroach/pkg/util/uuid.UUID" json:"cluster_id"`
NodeID NodeID `protobuf:"varint,2,opt,name=node_id,json=nodeId,casttype=NodeID" json:"node_id"`
StoreID StoreID `protobuf:"varint,3,opt,name=store_id,json=storeId,casttype=StoreID" json:"store_id"`
}
func (m *StoreIdent) Reset() { *m = StoreIdent{} }
func (m *StoreIdent) String() string { return proto.CompactTextString(m) }
func (*StoreIdent) ProtoMessage() {}
func (*StoreIdent) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{3} }
// A SplitTrigger is run after a successful commit of an AdminSplit
// command. It provides the updated left hand side of the split's
// range descriptor (left_desc) and the new range descriptor covering
// the right hand side of the split (right_desc). This information
// allows the final bookkeeping for the split to be completed and the
// new range put into operation.
type SplitTrigger struct {
LeftDesc RangeDescriptor `protobuf:"bytes,1,opt,name=left_desc,json=leftDesc" json:"left_desc"`
RightDesc RangeDescriptor `protobuf:"bytes,2,opt,name=right_desc,json=rightDesc" json:"right_desc"`
}
func (m *SplitTrigger) Reset() { *m = SplitTrigger{} }
func (m *SplitTrigger) String() string { return proto.CompactTextString(m) }
func (*SplitTrigger) ProtoMessage() {}
func (*SplitTrigger) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{4} }
// A MergeTrigger is run after a successful commit of an AdminMerge
// command. It provides the updated left hand side of the split's
// range descriptor (left_desc) that now encompasses what was
// originally both ranges and the soon-to-be-invalid range descriptor
// that used to cover the subsumed, right hand side of the merge
// (right_desc). This information allows the final bookkeeping for the
// merge to be completed and put into operation.
type MergeTrigger struct {
LeftDesc RangeDescriptor `protobuf:"bytes,1,opt,name=left_desc,json=leftDesc" json:"left_desc"`
RightDesc RangeDescriptor `protobuf:"bytes,2,opt,name=right_desc,json=rightDesc" json:"right_desc"`
}
func (m *MergeTrigger) Reset() { *m = MergeTrigger{} }
func (m *MergeTrigger) String() string { return proto.CompactTextString(m) }
func (*MergeTrigger) ProtoMessage() {}
func (*MergeTrigger) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{5} }
type ChangeReplicasTrigger struct {
ChangeType ReplicaChangeType `protobuf:"varint,1,opt,name=change_type,json=changeType,enum=cockroach.roachpb.ReplicaChangeType" json:"change_type"`
// The replica being modified.
Replica ReplicaDescriptor `protobuf:"bytes,2,opt,name=replica" json:"replica"`
// The new replica list with this change applied.
UpdatedReplicas []ReplicaDescriptor `protobuf:"bytes,3,rep,name=updated_replicas,json=updatedReplicas" json:"updated_replicas"`
NextReplicaID ReplicaID `protobuf:"varint,4,opt,name=next_replica_id,json=nextReplicaId,casttype=ReplicaID" json:"next_replica_id"`
}
func (m *ChangeReplicasTrigger) Reset() { *m = ChangeReplicasTrigger{} }
func (*ChangeReplicasTrigger) ProtoMessage() {}
func (*ChangeReplicasTrigger) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{6} }
// ModifiedSpanTrigger indicates that a specific span has been modified.
// This can be used to trigger scan-and-gossip for the given span.
type ModifiedSpanTrigger struct {
SystemConfigSpan bool `protobuf:"varint,1,opt,name=system_config_span,json=systemConfigSpan" json:"system_config_span"`
// node_liveness_span is set to indicate that node liveness records
// need re-gossiping after modification or range lease updates. The
// span is set to a single key when nodes update their liveness records
// with heartbeats to extend the expiration timestamp. Changes to the
// range lease for the range containing node liveness triggers re-gossip
// of the entire node liveness key range.
NodeLivenessSpan *Span `protobuf:"bytes,2,opt,name=node_liveness_span,json=nodeLivenessSpan" json:"node_liveness_span,omitempty"`
}
func (m *ModifiedSpanTrigger) Reset() { *m = ModifiedSpanTrigger{} }
func (m *ModifiedSpanTrigger) String() string { return proto.CompactTextString(m) }
func (*ModifiedSpanTrigger) ProtoMessage() {}
func (*ModifiedSpanTrigger) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{7} }
// InternalCommitTrigger encapsulates all of the internal-only commit triggers.
// Only one may be set.
type InternalCommitTrigger struct {
SplitTrigger *SplitTrigger `protobuf:"bytes,1,opt,name=split_trigger,json=splitTrigger" json:"split_trigger,omitempty"`
MergeTrigger *MergeTrigger `protobuf:"bytes,2,opt,name=merge_trigger,json=mergeTrigger" json:"merge_trigger,omitempty"`
ChangeReplicasTrigger *ChangeReplicasTrigger `protobuf:"bytes,3,opt,name=change_replicas_trigger,json=changeReplicasTrigger" json:"change_replicas_trigger,omitempty"`
ModifiedSpanTrigger *ModifiedSpanTrigger `protobuf:"bytes,4,opt,name=modified_span_trigger,json=modifiedSpanTrigger" json:"modified_span_trigger,omitempty"`
}
func (m *InternalCommitTrigger) Reset() { *m = InternalCommitTrigger{} }
func (m *InternalCommitTrigger) String() string { return proto.CompactTextString(m) }
func (*InternalCommitTrigger) ProtoMessage() {}
func (*InternalCommitTrigger) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{8} }
func (m *InternalCommitTrigger) GetSplitTrigger() *SplitTrigger {
if m != nil {
return m.SplitTrigger
}
return nil
}
func (m *InternalCommitTrigger) GetMergeTrigger() *MergeTrigger {
if m != nil {
return m.MergeTrigger
}
return nil
}
func (m *InternalCommitTrigger) GetChangeReplicasTrigger() *ChangeReplicasTrigger {
if m != nil {
return m.ChangeReplicasTrigger
}
return nil
}
func (m *InternalCommitTrigger) GetModifiedSpanTrigger() *ModifiedSpanTrigger {
if m != nil {
return m.ModifiedSpanTrigger
}
return nil
}
type ObservedTimestamp struct {
NodeID NodeID `protobuf:"varint,1,opt,name=node_id,json=nodeId,casttype=NodeID" json:"node_id"`
Timestamp cockroach_util_hlc.Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp"`
}
func (m *ObservedTimestamp) Reset() { *m = ObservedTimestamp{} }
func (m *ObservedTimestamp) String() string { return proto.CompactTextString(m) }
func (*ObservedTimestamp) ProtoMessage() {}
func (*ObservedTimestamp) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{9} }
// A Transaction is a unit of work performed on the database.
// Cockroach transactions support two isolation levels: snapshot
// isolation and serializable snapshot isolation. Each Cockroach
// transaction is assigned a random priority. This priority will be
// used to decide whether a transaction will be aborted during
// contention.
//
// If you add fields to Transaction you'll need to update
// Transaction.Clone. Failure to do so will result in test failures.
type Transaction struct {
// The transaction metadata. These are persisted with every intent.
cockroach_storage_engine_enginepb.TxnMeta `protobuf:"bytes,1,opt,name=meta,embedded=meta" json:"meta"`
// A free-text identifier for debug purposes.
Name string `protobuf:"bytes,2,opt,name=name" json:"name"`
Status TransactionStatus `protobuf:"varint,4,opt,name=status,enum=cockroach.roachpb.TransactionStatus" json:"status"`
LastHeartbeat cockroach_util_hlc.Timestamp `protobuf:"bytes,5,opt,name=last_heartbeat,json=lastHeartbeat" json:"last_heartbeat"`
// The original timestamp at which the transaction started. For serializable
// transactions, if the timestamp drifts from the original timestamp, the
// transaction will retry.
//
// This timestamp is the one at which all transactions will read. It is also,
// surprisingly, the timestamp at which transactions will provisionally
// _write_ (i.e. intents are written at this orig_timestamp and, after commit,
// when the intents are resolved, their timestamps are bumped to the to the
// commit timestamp).
// This is ultimately because of correctness concerns around SNAPSHOT
// transactions. Note first that for SERIALIZABLE transactions, the original
// and commit timestamps must not diverge, and so an intent which may be
// committed is always written when both timestamps coincide.
//
// For a SNAPSHOT transaction however, this is not the case. Intuitively,
// one could think that the timestamp at which intents should be written
// should be the provisional commit timestamp, and while this is morally
// true, consider the following scenario, where txn1 is a SNAPSHOT txn:
//
// - txn1 at orig_timestamp=5 reads key1: (value) 1.
// - txn1 writes elsewhere, has its commit timestamp increased to 20.
// - txn2 at orig_timestamp=10 reads key1: 1
// - txn2 increases the value by 5: key1: 6 and commits
// - txn1 increases the value by 1: key1: 2, attempts commit
//
// If txn1 uses its orig_timestamp for updating key1 (as it does), it
// conflicts with txn2's committed value (which is at timestamp 10, in the
// future of 5), and restarts.
// Using instead its candidate commit timestamp, it wouldn't see a conflict
// and commit, but this is not the expected outcome (the expected outcome is
// {key1: 6} (since txn2 is not expected to commit)) and we would be
// experiencing the Lost Update Anomaly.
//
// Note that in practice, before restarting, txn1 would still lay down an
// intent (just above the committed value) not with the intent to commit it,
// but to avoid being starved by short-lived transactions on that key which
// would otherwise not have to go through conflict resolution with txn1.
//
// Again, keep in mind that, when the transaction commits, all the intents are
// bumped to the commit timestamp (otherwise, pushing a transaction wouldn't
// achieve anything).
OrigTimestamp cockroach_util_hlc.Timestamp `protobuf:"bytes,6,opt,name=orig_timestamp,json=origTimestamp" json:"orig_timestamp"`
// Initial Timestamp + clock skew. Reads which encounter values with
// timestamps between timestamp and max_timestamp trigger a txn
// retry error, unless the node being read is listed in observed_timestamps
// (in which case no more read uncertainty can occur).
// The case max_timestamp < timestamp is possible for transactions which have
// been pushed; in this case, max_timestamp should be ignored.
MaxTimestamp cockroach_util_hlc.Timestamp `protobuf:"bytes,7,opt,name=max_timestamp,json=maxTimestamp" json:"max_timestamp"`
// A list of <NodeID, timestamp> pairs. The list maps NodeIDs to timestamps
// as observed from their local clock during this transaction. The purpose of
// this map is to avoid uncertainty related restarts which normally occur
// when reading a value in the near future as per the max_timestamp field.
//
// When this list holds a corresponding entry for the node the current
// request is executing on, we can run the command with the map's timestamp
// as the top boundary of our uncertainty interval, limiting (and often
// avoiding) uncertainty restarts.
//
// The list of observed timestamps is kept sorted by NodeID. Use
// Transaction.UpdateObservedTimestamp to maintain the sorted order.
ObservedTimestamps []ObservedTimestamp `protobuf:"bytes,8,rep,name=observed_timestamps,json=observedTimestamps" json:"observed_timestamps"`
// Writing is true if the transaction has previously executed a successful
// write request, i.e. a request that may have left intents (across retries).
Writing bool `protobuf:"varint,9,opt,name=writing" json:"writing"`
// If this is true, the transaction must retry. Relevant only for
// SNAPSHOT transactions: a SERIALIZABLE transaction would have to
// retry anyway due to its commit timestamp having moved forward.
// This bool is set instead of immediately returning a txn retry
// error so that intents can continue to be laid down, minimizing
// work required on txn restart.
WriteTooOld bool `protobuf:"varint,12,opt,name=write_too_old,json=writeTooOld" json:"write_too_old"`
// If retry_on_push is true, the transaction must retry in the event
// that the commit timestamp is pushed forward. This flag is set if
// the transaction contains any calls to DeleteRange, in order to
// prevent the LostDeleteRange anomaly. This flag is relevant only
// for SNAPSHOT transactions.
RetryOnPush bool `protobuf:"varint,13,opt,name=retry_on_push,json=retryOnPush" json:"retry_on_push"`
Intents []Span `protobuf:"bytes,11,rep,name=intents" json:"intents"`
}
func (m *Transaction) Reset() { *m = Transaction{} }
func (*Transaction) ProtoMessage() {}
func (*Transaction) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{10} }
// A Intent is a Span together with a Transaction metadata and its status.
type Intent struct {
Span `protobuf:"bytes,1,opt,name=span,embedded=span" json:"span"`
Txn cockroach_storage_engine_enginepb.TxnMeta `protobuf:"bytes,2,opt,name=txn" json:"txn"`
Status TransactionStatus `protobuf:"varint,3,opt,name=status,enum=cockroach.roachpb.TransactionStatus" json:"status"`
}
func (m *Intent) Reset() { *m = Intent{} }
func (m *Intent) String() string { return proto.CompactTextString(m) }
func (*Intent) ProtoMessage() {}
func (*Intent) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{11} }
// Lease contains information about range leases including the
// expiration and lease holder.
type Lease struct {
// The start is a timestamp at which the lease begins. This value
// must be greater than the last lease expiration or the lease request
// is considered invalid.
Start cockroach_util_hlc.Timestamp `protobuf:"bytes,1,opt,name=start" json:"start"`
// The expiration is a timestamp at which the lease expires. This means that
// a new lease can be granted for a later timestamp.
Expiration cockroach_util_hlc.Timestamp `protobuf:"bytes,2,opt,name=expiration" json:"expiration"`
// The address of the would-be lease holder.
Replica ReplicaDescriptor `protobuf:"bytes,3,opt,name=replica" json:"replica"`
// The start of the lease stasis period. This field is deprecated.
DeprecatedStartStasis cockroach_util_hlc.Timestamp `protobuf:"bytes,4,opt,name=deprecated_start_stasis,json=deprecatedStartStasis" json:"deprecated_start_stasis"`
// The current timestamp when this lease has been proposed. Used after a
// transfer and after a node restart to enforce that a node only uses leases
// proposed after the time of the said transfer or restart. This is nullable
// to help with the rollout (such that a lease applied by some nodes before
// the rollout and some nodes after the rollout is serialized the same).
// TODO(andrei): Make this non-nullable after the rollout.
ProposedTS *cockroach_util_hlc.Timestamp `protobuf:"bytes,5,opt,name=proposed_ts,json=proposedTs" json:"proposed_ts,omitempty"`
// The epoch of the lease holder's node liveness entry. If this value
// is non-zero, the start and expiration values are ignored.
Epoch *int64 `protobuf:"varint,6,opt,name=epoch" json:"epoch,omitempty"`
}
func (m *Lease) Reset() { *m = Lease{} }
func (*Lease) ProtoMessage() {}
func (*Lease) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{12} }
// AbortCacheEntry contains information about a transaction which has
// been aborted. It's written to a range's abort cache if the range
// may have contained intents of the aborted txn. In the event that
// the same transaction attempts to read keys it may have written
// previously, this entry informs the transaction that it has aborted
// and must start fresh with an updated priority.
type AbortCacheEntry struct {
// The key of the associated transaction.
Key Key `protobuf:"bytes,1,opt,name=key,casttype=Key" json:"key,omitempty"`
// The candidate commit timestamp the transaction record held at the time
// it was aborted.
Timestamp cockroach_util_hlc.Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp"`
// The priority of the transaction.
Priority int32 `protobuf:"varint,3,opt,name=priority" json:"priority"`
}
func (m *AbortCacheEntry) Reset() { *m = AbortCacheEntry{} }
func (m *AbortCacheEntry) String() string { return proto.CompactTextString(m) }
func (*AbortCacheEntry) ProtoMessage() {}
func (*AbortCacheEntry) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{13} }
// CSVOptions describe the format of csv data (delimiter, comment, etc).
type CSVOptions struct {
// comma is an optional delimiter used by the CSV file; defaults to a comma.
Comma int32 `protobuf:"varint,1,opt,name=comma" json:"comma"`
// comment is an optional comment rune; zero value means comments not enabled.
Comment int32 `protobuf:"varint,2,opt,name=comment" json:"comment"`
// nullif, if not nil, is the string which identifies a NULL. Can be the empty string.
Nullif *string `protobuf:"bytes,3,opt,name=nullif" json:"nullif,omitempty"`
}
func (m *CSVOptions) Reset() { *m = CSVOptions{} }
func (m *CSVOptions) String() string { return proto.CompactTextString(m) }
func (*CSVOptions) ProtoMessage() {}
func (*CSVOptions) Descriptor() ([]byte, []int) { return fileDescriptorData, []int{14} }
func init() {
proto.RegisterType((*Span)(nil), "cockroach.roachpb.Span")
proto.RegisterType((*Value)(nil), "cockroach.roachpb.Value")
proto.RegisterType((*KeyValue)(nil), "cockroach.roachpb.KeyValue")
proto.RegisterType((*StoreIdent)(nil), "cockroach.roachpb.StoreIdent")
proto.RegisterType((*SplitTrigger)(nil), "cockroach.roachpb.SplitTrigger")
proto.RegisterType((*MergeTrigger)(nil), "cockroach.roachpb.MergeTrigger")
proto.RegisterType((*ChangeReplicasTrigger)(nil), "cockroach.roachpb.ChangeReplicasTrigger")
proto.RegisterType((*ModifiedSpanTrigger)(nil), "cockroach.roachpb.ModifiedSpanTrigger")
proto.RegisterType((*InternalCommitTrigger)(nil), "cockroach.roachpb.InternalCommitTrigger")
proto.RegisterType((*ObservedTimestamp)(nil), "cockroach.roachpb.ObservedTimestamp")
proto.RegisterType((*Transaction)(nil), "cockroach.roachpb.Transaction")
proto.RegisterType((*Intent)(nil), "cockroach.roachpb.Intent")
proto.RegisterType((*Lease)(nil), "cockroach.roachpb.Lease")
proto.RegisterType((*AbortCacheEntry)(nil), "cockroach.roachpb.AbortCacheEntry")
proto.RegisterType((*CSVOptions)(nil), "cockroach.roachpb.CSVOptions")
proto.RegisterEnum("cockroach.roachpb.ValueType", ValueType_name, ValueType_value)
proto.RegisterEnum("cockroach.roachpb.ReplicaChangeType", ReplicaChangeType_name, ReplicaChangeType_value)
proto.RegisterEnum("cockroach.roachpb.TransactionStatus", TransactionStatus_name, TransactionStatus_value)
}
func (this *Span) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Span)
if !ok {
that2, ok := that.(Span)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !bytes.Equal(this.Key, that1.Key) {
return false
}
if !bytes.Equal(this.EndKey, that1.EndKey) {
return false
}
return true
}
func (this *Value) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Value)
if !ok {
that2, ok := that.(Value)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !bytes.Equal(this.RawBytes, that1.RawBytes) {
return false
}
if !this.Timestamp.Equal(&that1.Timestamp) {
return false
}
return true
}
func (this *SplitTrigger) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*SplitTrigger)
if !ok {
that2, ok := that.(SplitTrigger)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.LeftDesc.Equal(&that1.LeftDesc) {
return false
}
if !this.RightDesc.Equal(&that1.RightDesc) {
return false
}
return true
}
func (this *MergeTrigger) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*MergeTrigger)
if !ok {
that2, ok := that.(MergeTrigger)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.LeftDesc.Equal(&that1.LeftDesc) {
return false
}
if !this.RightDesc.Equal(&that1.RightDesc) {
return false
}
return true
}
func (this *ChangeReplicasTrigger) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*ChangeReplicasTrigger)
if !ok {
that2, ok := that.(ChangeReplicasTrigger)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.ChangeType != that1.ChangeType {
return false
}
if !this.Replica.Equal(&that1.Replica) {
return false
}
if len(this.UpdatedReplicas) != len(that1.UpdatedReplicas) {
return false
}
for i := range this.UpdatedReplicas {
if !this.UpdatedReplicas[i].Equal(&that1.UpdatedReplicas[i]) {
return false
}
}
if this.NextReplicaID != that1.NextReplicaID {
return false
}
return true
}
func (this *ModifiedSpanTrigger) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*ModifiedSpanTrigger)
if !ok {
that2, ok := that.(ModifiedSpanTrigger)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.SystemConfigSpan != that1.SystemConfigSpan {
return false
}
if !this.NodeLivenessSpan.Equal(that1.NodeLivenessSpan) {
return false
}
return true
}
func (this *InternalCommitTrigger) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*InternalCommitTrigger)
if !ok {
that2, ok := that.(InternalCommitTrigger)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.SplitTrigger.Equal(that1.SplitTrigger) {
return false
}
if !this.MergeTrigger.Equal(that1.MergeTrigger) {
return false
}
if !this.ChangeReplicasTrigger.Equal(that1.ChangeReplicasTrigger) {
return false
}
if !this.ModifiedSpanTrigger.Equal(that1.ModifiedSpanTrigger) {
return false
}
return true
}
func (this *ObservedTimestamp) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*ObservedTimestamp)
if !ok {
that2, ok := that.(ObservedTimestamp)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.NodeID != that1.NodeID {
return false
}
if !this.Timestamp.Equal(&that1.Timestamp) {
return false
}
return true
}
func (this *Transaction) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Transaction)
if !ok {
that2, ok := that.(Transaction)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.TxnMeta.Equal(&that1.TxnMeta) {
return false
}
if this.Name != that1.Name {
return false
}
if this.Status != that1.Status {
return false
}
if !this.LastHeartbeat.Equal(&that1.LastHeartbeat) {
return false
}
if !this.OrigTimestamp.Equal(&that1.OrigTimestamp) {
return false
}
if !this.MaxTimestamp.Equal(&that1.MaxTimestamp) {
return false
}
if len(this.ObservedTimestamps) != len(that1.ObservedTimestamps) {
return false
}
for i := range this.ObservedTimestamps {
if !this.ObservedTimestamps[i].Equal(&that1.ObservedTimestamps[i]) {
return false
}
}
if this.Writing != that1.Writing {
return false
}
if this.WriteTooOld != that1.WriteTooOld {
return false
}
if this.RetryOnPush != that1.RetryOnPush {
return false
}
if len(this.Intents) != len(that1.Intents) {
return false
}
for i := range this.Intents {
if !this.Intents[i].Equal(&that1.Intents[i]) {
return false
}
}
return true
}
func (this *Intent) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Intent)
if !ok {
that2, ok := that.(Intent)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Span.Equal(&that1.Span) {
return false
}
if !this.Txn.Equal(&that1.Txn) {
return false
}
if this.Status != that1.Status {
return false
}
return true
}
func (this *Lease) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Lease)
if !ok {
that2, ok := that.(Lease)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Start.Equal(&that1.Start) {
return false
}
if !this.Expiration.Equal(&that1.Expiration) {
return false
}
if !this.Replica.Equal(&that1.Replica) {
return false
}
if !this.DeprecatedStartStasis.Equal(&that1.DeprecatedStartStasis) {
return false
}
if !this.ProposedTS.Equal(that1.ProposedTS) {
return false
}
if this.Epoch != nil && that1.Epoch != nil {
if *this.Epoch != *that1.Epoch {
return false
}
} else if this.Epoch != nil {
return false
} else if that1.Epoch != nil {