Skip to content

Commit

Permalink
[FAB-6323] Improve comments for tstore helper
Browse files Browse the repository at this point in the history
This CR improves certain comments on store_helper.go in
transientstore.

Change-Id: Ia84b15158622768c15d7edbeb04aff55624e5db0
Signed-off-by: senthil <cendhu@gmail.com>
  • Loading branch information
cendhu committed Oct 5, 2017
1 parent af96475 commit be90a60
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/transientstore/store_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ func createTxidRangeEndKey(txid string) []byte {
endKey = append(endKey, prwsetPrefix)
endKey = append(endKey, compositeKeySep)
endKey = append(endKey, []byte(txid)...)
// As txid is a fixed length string (i.e., 128 bits long UUID), 0xff can be used as a stopper.
// Otherwise a super-string of a given txid would also fall under the end key of range query.
endKey = append(endKey, byte(0xff))
return endKey
}
Expand All @@ -137,7 +139,7 @@ func createPurgeIndexByHeightRangeStartKey(blockHeight uint64) []byte {
return startKey
}

// createPurgeIndexByHeightRangeStartKey returns a endKey to do a range query on index stored in transient store
// createPurgeIndexByHeightRangeEndKey returns a endKey to do a range query on index stored in transient store
// using blockHeight
func createPurgeIndexByHeightRangeEndKey(blockHeight uint64) []byte {
var endKey []byte
Expand All @@ -159,13 +161,15 @@ func createPurgeIndexByTxidRangeStartKey(txid string) []byte {
return startKey
}

// createPurgeIndexByTxidRangeStartKey returns a endKey to do a range query on index stored in transient store
// createPurgeIndexByTxidRangeEndKey returns a endKey to do a range query on index stored in transient store
// using txid
func createPurgeIndexByTxidRangeEndKey(txid string) []byte {
var endKey []byte
endKey = append(endKey, purgeIndexByTxidPrefix)
endKey = append(endKey, compositeKeySep)
endKey = append(endKey, []byte(txid)...)
// As txid is a fixed length string (i.e., 128 bits long UUID), 0xff can be used as a stopper.
// Otherwise a super-string of a given txid would also fall under the end key of range query.
endKey = append(endKey, byte(0xff))
return endKey
}
Expand Down

0 comments on commit be90a60

Please sign in to comment.