Skip to content

Commit

Permalink
*: change startTs type to uint64 (pingcap#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
coocood committed Apr 9, 2016
1 parent 6d2f884 commit f325c0e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion kv/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ type Transaction interface {
// GetClient gets a client instance.
GetClient() Client
// StartTS returns the transaction start timestamp.
StartTS() int64
StartTS() uint64
}

// Client is used to send request to KV layer.
Expand Down
4 changes: 2 additions & 2 deletions kv/txn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func (t *mockTxn) GetClient() Client {
return nil
}

func (t *mockTxn) StartTS() int64 {
return int64(0)
func (t *mockTxn) StartTS() uint64 {
return uint64(0)
}
func (t *mockTxn) Get(k Key) ([]byte, error) {
return nil, nil
Expand Down
4 changes: 2 additions & 2 deletions store/hbase/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ func (txn *hbaseTxn) IsReadOnly() bool {
return !txn.dirty
}

func (txn *hbaseTxn) StartTS() int64 {
return int64(txn.tid)
func (txn *hbaseTxn) StartTS() uint64 {
return txn.tid
}

func (txn *hbaseTxn) GetClient() kv.Client {
Expand Down
4 changes: 2 additions & 2 deletions store/localstore/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ func (txn *dbTxn) IsReadOnly() bool {
return !txn.dirty
}

func (txn *dbTxn) StartTS() int64 {
return int64(txn.tid)
func (txn *dbTxn) StartTS() uint64 {
return txn.tid
}

func (txn *dbTxn) GetClient() kv.Client {
Expand Down
8 changes: 4 additions & 4 deletions store/localstore/xapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ func encodeColumnKV(tid, handle, cid int64, value types.Datum) (kv.Key, []byte,
return key, val, nil
}

func prepareSelectRequest(simpleInfo *simpleTableInfo, startTs int64) (*kv.Request, error) {
func prepareSelectRequest(simpleInfo *simpleTableInfo, startTs uint64) (*kv.Request, error) {
selReq := new(tipb.SelectRequest)
selReq.TableInfo = simpleInfo.toPBTableInfo()
selReq.StartTs = proto.Int64(startTs)
selReq.StartTs = proto.Uint64(startTs)
selReq.Ranges = []*tipb.KeyRange{fullPBTableRange}
data, err := proto.Marshal(selReq)
if err != nil {
Expand Down Expand Up @@ -266,10 +266,10 @@ func fullIndexRange(tid int64, idxID int64) kv.KeyRange {
}
}

func prepareIndexRequest(simpleInfo *simpleTableInfo, startTs int64) (*kv.Request, error) {
func prepareIndexRequest(simpleInfo *simpleTableInfo, startTs uint64) (*kv.Request, error) {
selReq := new(tipb.SelectRequest)
selReq.IndexInfo = simpleInfo.toPBIndexInfo(0)
selReq.StartTs = proto.Int64(startTs)
selReq.StartTs = proto.Uint64(startTs)
selReq.Ranges = []*tipb.KeyRange{fullPBIndexRange}
data, err := proto.Marshal(selReq)
if err != nil {
Expand Down

0 comments on commit f325c0e

Please sign in to comment.