diff --git a/store/dbadapter/store.go b/store/dbadapter/store.go index 369a173ec1..d69e4ebf13 100644 --- a/store/dbadapter/store.go +++ b/store/dbadapter/store.go @@ -10,7 +10,7 @@ import ( "cosmossdk.io/store/types" ) -// Wrapper type for dbm.Db with implementation of KVStore +// Store is wrapper type for dbm.Db with implementation of KVStore type Store struct { dbm.DB } diff --git a/store/gaskv/store.go b/store/gaskv/store.go index e0f96af715..41242d4928 100644 --- a/store/gaskv/store.go +++ b/store/gaskv/store.go @@ -26,12 +26,12 @@ func NewStore(parent types.KVStore, gasMeter types.GasMeter, gasConfig types.Gas return kvs } -// Implements Store. +// GetStoreType implements Store. func (gs *Store) GetStoreType() types.StoreType { return gs.parent.GetStoreType() } -// Implements KVStore. +// Get implements KVStore. func (gs *Store) Get(key []byte) (value []byte) { gs.gasMeter.ConsumeGas(gs.gasConfig.ReadCostFlat, types.GasReadCostFlatDesc) value = gs.parent.Get(key) @@ -43,7 +43,7 @@ func (gs *Store) Get(key []byte) (value []byte) { return value } -// Implements KVStore. +// Set implements KVStore. func (gs *Store) Set(key, value []byte) { types.AssertValidKey(key) types.AssertValidValue(value) @@ -54,13 +54,13 @@ func (gs *Store) Set(key, value []byte) { gs.parent.Set(key, value) } -// Implements KVStore. +// Has implements KVStore. func (gs *Store) Has(key []byte) bool { gs.gasMeter.ConsumeGas(gs.gasConfig.HasCost, types.GasHasDesc) return gs.parent.Has(key) } -// Implements KVStore. +// Delete implements KVStore. func (gs *Store) Delete(key []byte) { // charge gas to prevent certain attack vectors even though space is being freed gs.gasMeter.ConsumeGas(gs.gasConfig.DeleteCost, types.GasDeleteDesc) @@ -82,7 +82,7 @@ func (gs *Store) ReverseIterator(start, end []byte) types.Iterator { return gs.iterator(start, end, false) } -// Implements KVStore. +// CacheWrap implements KVStore. func (gs *Store) CacheWrap() types.CacheWrap { panic("cannot CacheWrap a GasKVStore") } @@ -120,12 +120,12 @@ func newGasIterator(gasMeter types.GasMeter, gasConfig types.GasConfig, parent t } } -// Implements Iterator. +// Domain implements Iterator. func (gi *gasIterator) Domain() (start, end []byte) { return gi.parent.Domain() } -// Implements Iterator. +// Valid implements Iterator. func (gi *gasIterator) Valid() bool { return gi.parent.Valid() } @@ -152,7 +152,7 @@ func (gi *gasIterator) Value() (value []byte) { return value } -// Implements Iterator. +// Close implements Iterator. func (gi *gasIterator) Close() error { return gi.parent.Close() } diff --git a/store/iavl/store.go b/store/iavl/store.go index 04d170b73e..8e1905b7a3 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -179,12 +179,12 @@ func (st *Store) GetAllVersions() []int { return st.tree.AvailableVersions() } -// Implements Store. +// GetStoreType implements Store. func (st *Store) GetStoreType() types.StoreType { return types.StoreTypeIAVL } -// Implements Store. +// CacheWrap implements Store. func (st *Store) CacheWrap() types.CacheWrap { return cachekv.NewStore(st) } @@ -194,7 +194,7 @@ func (st *Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.Ca return cachekv.NewStore(tracekv.NewStore(st, w, tc)) } -// Implements types.KVStore. +// Set implements types.KVStore. func (st *Store) Set(key, value []byte) { types.AssertValidKey(key) types.AssertValidValue(value) @@ -204,7 +204,7 @@ func (st *Store) Set(key, value []byte) { } } -// Implements types.KVStore. +// Get implements types.KVStore. func (st *Store) Get(key []byte) []byte { defer st.metrics.MeasureSince("store", "iavl", "get") value, err := st.tree.Get(key) @@ -214,7 +214,7 @@ func (st *Store) Get(key []byte) []byte { return value } -// Implements types.KVStore. +// Has implements types.KVStore. func (st *Store) Has(key []byte) (exists bool) { defer st.metrics.MeasureSince("store", "iavl", "has") has, err := st.tree.Has(key) @@ -224,7 +224,7 @@ func (st *Store) Has(key []byte) (exists bool) { return has } -// Implements types.KVStore. +// Delete implements types.KVStore. func (st *Store) Delete(key []byte) { defer st.metrics.MeasureSince("store", "iavl", "delete") _, _, err := st.tree.Remove(key) @@ -246,7 +246,7 @@ func (st *Store) LoadVersionForOverwriting(targetVersion int64) error { return st.tree.LoadVersionForOverwriting(targetVersion) } -// Implements types.KVStore. +// Iterator implements types.KVStore. func (st *Store) Iterator(start, end []byte) types.Iterator { iterator, err := st.tree.Iterator(start, end, true) if err != nil { @@ -255,7 +255,7 @@ func (st *Store) Iterator(start, end []byte) types.Iterator { return iterator } -// Implements types.KVStore. +// ReverseIterator implements types.KVStore. func (st *Store) ReverseIterator(start, end []byte) types.Iterator { iterator, err := st.tree.Iterator(start, end, false) if err != nil { @@ -270,7 +270,7 @@ func (st *Store) SetInitialVersion(version int64) { st.tree.SetInitialVersion(uint64(version)) } -// Exports the IAVL store at the given version, returning an iavl.Exporter for the tree. +// Export exports the IAVL store at the given version, returning an iavl.Exporter for the tree. func (st *Store) Export(version int64) (*iavl.Exporter, error) { istore, err := st.GetImmutable(version) if err != nil { diff --git a/store/internal/maps/maps.go b/store/internal/maps/maps.go index 40aa0b44d9..6db2be666c 100644 --- a/store/internal/maps/maps.go +++ b/store/internal/maps/maps.go @@ -120,7 +120,7 @@ func (sm *simpleMap) Sort() { sm.sorted = true } -// Returns a copy of sorted KVPairs. +// KVPairs returns a copy of sorted KVPairs. // NOTE these contain the hashed key and value. func (sm *simpleMap) KVPairs() kv.Pairs { sm.Sort() @@ -134,7 +134,7 @@ func (sm *simpleMap) KVPairs() kv.Pairs { //---------------------------------------- -// A local extension to KVPair that can be hashed. +// KVPair is a local extension to KVPair that can be hashed. // Key and value are length prefixed and concatenated, // then hashed. type KVPair kv.Pair diff --git a/store/prefix/store.go b/store/prefix/store.go index 62f451fa43..26b8b0344a 100644 --- a/store/prefix/store.go +++ b/store/prefix/store.go @@ -42,12 +42,12 @@ func (s Store) key(key []byte) (res []byte) { return } -// Implements Store +// GetStoreType implements Store func (s Store) GetStoreType() types.StoreType { return s.parent.GetStoreType() } -// Implements CacheWrap +// CacheWrap implements CacheWrap func (s Store) CacheWrap() types.CacheWrap { return cachekv.NewStore(s) } @@ -57,30 +57,30 @@ func (s Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.Cach return cachekv.NewStore(tracekv.NewStore(s, w, tc)) } -// Implements KVStore +// Get implements KVStore func (s Store) Get(key []byte) []byte { res := s.parent.Get(s.key(key)) return res } -// Implements KVStore +// Has implements KVStore func (s Store) Has(key []byte) bool { return s.parent.Has(s.key(key)) } -// Implements KVStore +// Set implements KVStore func (s Store) Set(key, value []byte) { types.AssertValidKey(key) types.AssertValidValue(value) s.parent.Set(s.key(key), value) } -// Implements KVStore +// Delete implements KVStore func (s Store) Delete(key []byte) { s.parent.Delete(s.key(key)) } -// Implements KVStore +// Iterator implements KVStore // Check https://github.com/cometbft/cometbft/blob/master/libs/db/prefix_db.go#L106 func (s Store) Iterator(start, end []byte) types.Iterator { newstart := cloneAppend(s.prefix, start) @@ -134,17 +134,17 @@ func newPrefixIterator(prefix, start, end []byte, parent types.Iterator) *prefix } } -// Implements Iterator +// Domain implements Iterator func (pi *prefixIterator) Domain() ([]byte, []byte) { return pi.start, pi.end } -// Implements Iterator +// Valid implements Iterator func (pi *prefixIterator) Valid() bool { return pi.valid && pi.iter.Valid() } -// Implements Iterator +// Next implements Iterator func (pi *prefixIterator) Next() { if !pi.valid { panic("prefixIterator invalid, cannot call Next()") @@ -156,7 +156,7 @@ func (pi *prefixIterator) Next() { } } -// Implements Iterator +// Key implements Iterator func (pi *prefixIterator) Key() (key []byte) { if !pi.valid { panic("prefixIterator invalid, cannot call Key()") @@ -168,7 +168,7 @@ func (pi *prefixIterator) Key() (key []byte) { return } -// Implements Iterator +// Value implements Iterator func (pi *prefixIterator) Value() []byte { if !pi.valid { panic("prefixIterator invalid, cannot call Value()") @@ -177,7 +177,7 @@ func (pi *prefixIterator) Value() []byte { return pi.iter.Value() } -// Implements Iterator +// Close implements Iterator func (pi *prefixIterator) Close() error { return pi.iter.Close() } diff --git a/store/rootmulti/proof.go b/store/rootmulti/proof.go index 78217a1600..5f1503be4b 100644 --- a/store/rootmulti/proof.go +++ b/store/rootmulti/proof.go @@ -17,6 +17,8 @@ func RequireProof(subpath string) bool { //----------------------------------------------------------------------------- +// DefaultProofRuntime returns a new ProofRuntime with default op decoders registered. +// It registers decoders for IAVL commitment and Simple Merkle commitment proof operations. // XXX: This should be managed by the rootMultiStore which may want to register // more proof ops? func DefaultProofRuntime() (prt *merkle.ProofRuntime) { diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 1be58ea36d..ab6402447f 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -725,7 +725,7 @@ func (rs *Store) PruneStores(pruningHeight int64) (err error) { return nil } -// getStoreByName performs a lookup of a StoreKey given a store name typically +// GetStoreByName performs a lookup of a StoreKey given a store name typically // provided in a path. The StoreKey is then used to perform a lookup and return // a Store. If the Store is wrapped in an inter-block cache, it will be unwrapped // prior to being returned. If the StoreKey does not exist, nil is returned. diff --git a/store/snapshots/store.go b/store/snapshots/store.go index aa593f5bac..c58461a68b 100644 --- a/store/snapshots/store.go +++ b/store/snapshots/store.go @@ -92,7 +92,7 @@ func (s *Store) Get(height uint64, format uint32) (*types.Snapshot, error) { return snapshot, nil } -// Get fetches the latest snapshot from the database, if any. +// GetLatest fetches the latest snapshot from the database, if any. func (s *Store) GetLatest() (*types.Snapshot, error) { iter, err := s.db.ReverseIterator(encodeKey(0, 0), encodeKey(uint64(math.MaxUint64), math.MaxUint32)) if err != nil { diff --git a/store/snapshots/types/convert.go b/store/snapshots/types/convert.go index f326878757..a5ed10929c 100644 --- a/store/snapshots/types/convert.go +++ b/store/snapshots/types/convert.go @@ -7,7 +7,7 @@ import ( "cosmossdk.io/errors" ) -// Converts an ABCI snapshot to a snapshot. Mainly to decode the SDK metadata. +// SnapshotFromABCI converts an ABCI snapshot to a snapshot. Mainly to decode the SDK metadata. func SnapshotFromABCI(in *abci.Snapshot) (Snapshot, error) { snapshot := Snapshot{ Height: in.Height, @@ -22,7 +22,7 @@ func SnapshotFromABCI(in *abci.Snapshot) (Snapshot, error) { return snapshot, nil } -// Converts a Snapshot to its ABCI representation. Mainly to encode the SDK metadata. +// ToABCI converts a Snapshot to its ABCI representation. Mainly to encode the SDK metadata. func (s Snapshot) ToABCI() (abci.Snapshot, error) { out := abci.Snapshot{ Height: s.Height, diff --git a/store/streaming/abci/grpc.go b/store/streaming/abci/grpc.go index b838a153be..89e1c01c2b 100644 --- a/store/streaming/abci/grpc.go +++ b/store/streaming/abci/grpc.go @@ -17,7 +17,7 @@ type GRPCClient struct { client ABCIListenerServiceClient } -// ListenEndBlock listens to end block request and responses. +// ListenFinalizeBlock listens to end block request and responses. // In addition, it retrieves a types.Context from a context.Context instance. // It panics if a types.Context was not properly attached. // When the node is configured to stop on listening errors, diff --git a/store/transient/store.go b/store/transient/store.go index 2794d3d9a1..d72a72476e 100644 --- a/store/transient/store.go +++ b/store/transient/store.go @@ -18,13 +18,13 @@ type Store struct { dbadapter.Store } -// Constructs new MemDB adapter +// NewStore constructs new MemDB adapter func NewStore() *Store { return &Store{Store: dbadapter.Store{DB: dbm.NewMemDB()}} } -// Implements CommitStore // Commit cleans up Store. +// Implements CommitStore func (ts *Store) Commit() (id types.CommitID) { ts.Store = dbadapter.Store{DB: dbm.NewMemDB()} return @@ -38,7 +38,7 @@ func (ts *Store) GetPruning() pruningtypes.PruningOptions { return pruningtypes.NewPruningOptions(pruningtypes.PruningUndefined) } -// Implements CommitStore +// LastCommitID implements CommitStore func (ts *Store) LastCommitID() types.CommitID { return types.CommitID{} } @@ -47,7 +47,7 @@ func (ts *Store) WorkingHash() []byte { return []byte{} } -// Implements Store. +// GetStoreType implements Store. func (ts *Store) GetStoreType() types.StoreType { return types.StoreTypeTransient } diff --git a/store/types/codec.go b/store/types/codec.go index 4a5f424873..3b5203747c 100644 --- a/store/types/codec.go +++ b/store/types/codec.go @@ -19,12 +19,13 @@ type Codec interface { // in the value pointed to by v. Unmarshal(bz []byte, ptr proto.Message) error - // Unmarshal parses the data encoded with UnmarshalLengthPrefixed method and stores + // UnmarshalLengthPrefixed parses the data encoded with UnmarshalLengthPrefixed method and stores // the result in the value pointed to by v. UnmarshalLengthPrefixed(bz []byte, ptr proto.Message) error } // ============= TestCodec ============= + // TestCodec defines a codec that utilizes Protobuf for both binary and JSON // encoding. type TestCodec struct{} diff --git a/store/types/store.go b/store/types/store.go index ea9667691d..7846876eeb 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -17,7 +17,7 @@ type Store interface { CacheWrapper } -// something that can persist to disk +// Committer is something that can persist to disk type Committer interface { Commit() CommitID LastCommitID() CommitID @@ -37,6 +37,8 @@ type PausablePruner interface { PausePruning(bool) } +// CommitStore represents a store that can be committed and provides basic store operations. +// It combines the functionality of Committer and Store interfaces. // Stores of MultiStore must implement CommitStore. type CommitStore interface { Committer @@ -131,7 +133,7 @@ func (s *StoreUpgrades) RenamedFrom(key string) string { type MultiStore interface { Store - // Branches MultiStore into a cached storage object. + // CacheMultiStore branches MultiStore into a cached storage object. // NOTE: Caller should probably not call .Write() on each, but // call CacheMultiStore.Write(). CacheMultiStore() CacheMultiStore @@ -140,7 +142,7 @@ type MultiStore interface { // each stored is loaded at a specific version (height). CacheMultiStoreWithVersion(version int64) (CacheMultiStore, error) - // Convenience for fetching substores. + // GetStore is convenience for fetching substores. // If the store does not exist, panics. GetStore(StoreKey) Store GetKVStore(StoreKey) KVStore @@ -162,7 +164,7 @@ type MultiStore interface { LatestVersion() int64 } -// From MultiStore.CacheMultiStore().... +// CacheMultiStore is from MultiStore.CacheMultiStore().... type CacheMultiStore interface { MultiStore Write() // Writes operations to underlying KVStore @@ -174,17 +176,17 @@ type CommitMultiStore interface { MultiStore snapshottypes.Snapshotter - // Mount a store of type using the given db. + // MountStoreWithDB mount a store of type using the given db. // If db == nil, the new store will use the CommitMultiStore db. MountStoreWithDB(key StoreKey, typ StoreType, db dbm.DB) - // Panics on a nil key. + // GetCommitStore panics on a nil key. GetCommitStore(key StoreKey) CommitStore - // Panics on a nil key. + // GetCommitKVStore panics on a nil key. GetCommitKVStore(key StoreKey) CommitKVStore - // Load the latest persisted version. Called once after all calls to + // LoadLatestVersion load the latest persisted version. Called once after all calls to // Mount*Store() are complete. LoadLatestVersion() error @@ -198,13 +200,13 @@ type CommitMultiStore interface { // in order to handle breaking formats in migrations LoadVersionAndUpgrade(ver int64, upgrades *StoreUpgrades) error - // Load a specific persisted version. When you load an old version, or when + // LoadVersion load a specific persisted version. When you load an old version, or when // the last commit attempt didn't complete, the next commit after loading // must be idempotent (return the same commit id). Otherwise the behavior is // undefined. LoadVersion(ver int64) error - // Set an inter-block (persistent) cache that maintains a mapping from + // SetInterBlockCache set an inter-block (persistent) cache that maintains a mapping from // StoreKeys to CommitKVStores. SetInterBlockCache(MultiStorePersistentCache) @@ -265,7 +267,7 @@ type KVStore interface { // Exceptionally allowed for cachekv.Store, safe to write in the modules. Iterator(start, end []byte) Iterator - // Iterator over a domain of keys in descending order. End is exclusive. + // ReverseIterator iterates over a domain of keys in descending order. End is exclusive. // Start must be less than end, or the Iterator is invalid. // Iterator must be closed by caller. // CONTRACT: No writes may happen within a domain while an iterator exists over it. @@ -282,7 +284,7 @@ type Iterator = dbm.Iterator type CacheKVStore interface { KVStore - // Writes operations to underlying KVStore + // Write writes operations to underlying KVStore Write() } @@ -329,7 +331,7 @@ func (cid CommitID) String() string { //---------------------------------------- // Store types -// kind of store +// StoreType is kind of store type StoreType int const ( @@ -425,7 +427,7 @@ type TransientStoreKey struct { name string } -// Constructs new TransientStoreKey +// NewTransientStoreKey constructs new TransientStoreKey // Must return a pointer according to the ocap principle func NewTransientStoreKey(name string) *TransientStoreKey { return &TransientStoreKey{ @@ -433,12 +435,12 @@ func NewTransientStoreKey(name string) *TransientStoreKey { } } -// Implements StoreKey +// Name implements StoreKey func (key *TransientStoreKey) Name() string { return key.name } -// Implements StoreKey +// String implements StoreKey func (key *TransientStoreKey) String() string { return fmt.Sprintf("TransientStoreKey{%p, %s}", key, key.name) } @@ -494,11 +496,11 @@ func (tc TraceContext) Merge(newTc TraceContext) TraceContext { // MultiStorePersistentCache defines an interface which provides inter-block // (persistent) caching capabilities for multiple CommitKVStores based on StoreKeys. type MultiStorePersistentCache interface { - // Wrap and return the provided CommitKVStore with an inter-block (persistent) + // GetStoreCache wrap and return the provided CommitKVStore with an inter-block (persistent) // cache. GetStoreCache(key StoreKey, store CommitKVStore) CommitKVStore - // Return the underlying CommitKVStore for a StoreKey. + // Unwrap return the underlying CommitKVStore for a StoreKey. Unwrap(key StoreKey) CommitKVStore // Reset the entire set of internal caches. diff --git a/store/types/validity.go b/store/types/validity.go index a1fbaba999..73b15bdacc 100644 --- a/store/types/validity.go +++ b/store/types/validity.go @@ -1,9 +1,12 @@ package types var ( - // 128K - 1 + // MaxKeyLength is the maximum allowed length for a key in bytes. + // It is set to 128K - 1 (131,071 bytes). MaxKeyLength = (1 << 17) - 1 - // 2G - 1 + + // MaxValueLength is the maximum allowed length for a value in bytes. + // It is set to 2G - 1 (2,147,483,647 bytes). MaxValueLength = (1 << 31) - 1 ) diff --git a/store/v2/db/prefixdb.go b/store/v2/db/prefixdb.go index 643f2e95f7..fc13bbb5af 100644 --- a/store/v2/db/prefixdb.go +++ b/store/v2/db/prefixdb.go @@ -247,7 +247,7 @@ func (itr *prefixDBIterator) Next() { } } -// Next implements Iterator. +// Key implements Iterator. func (itr *prefixDBIterator) Key() []byte { itr.assertIsValid() key := itr.source.Key() diff --git a/store/v2/internal/encoding/encoding.go b/store/v2/internal/encoding/encoding.go index 40d558da38..b73b923f11 100644 --- a/store/v2/internal/encoding/encoding.go +++ b/store/v2/internal/encoding/encoding.go @@ -28,7 +28,7 @@ var uvarintPool = &sync.Pool{ }, } -// decodeBytes decodes a varint length-prefixed byte slice, returning it along with the number +// DecodeBytes decodes a varint length-prefixed byte slice, returning it along with the number // of input bytes read. // Assumes bz will not be mutated. func DecodeBytes(bz []byte) ([]byte, int, error) { @@ -55,7 +55,7 @@ func DecodeBytes(bz []byte) ([]byte, int, error) { return bz[n:end], end, nil } -// decodeUvarint decodes a varint-encoded unsigned integer from a byte slice, returning it and the +// DecodeUvarint decodes a varint-encoded unsigned integer from a byte slice, returning it and the // number of bytes decoded. func DecodeUvarint(bz []byte) (uint64, int, error) { u, n := binary.Uvarint(bz) @@ -71,7 +71,7 @@ func DecodeUvarint(bz []byte) (uint64, int, error) { return u, n, nil } -// decodeVarint decodes a varint-encoded integer from a byte slice, returning it and the number of +// DecodeVarint decodes a varint-encoded integer from a byte slice, returning it and the number of // bytes decoded. func DecodeVarint(bz []byte) (int64, int, error) { i, n := binary.Varint(bz) @@ -96,7 +96,7 @@ func EncodeBytes(w io.Writer, bz []byte) error { return err } -// encodeBytesSlice length-prefixes the byte slice and returns it. +// EncodeBytesSlice length-prefixes the byte slice and returns it. func EncodeBytesSlice(bz []byte) ([]byte, error) { buf := bufPool.Get().(*bytes.Buffer) buf.Reset() @@ -110,7 +110,7 @@ func EncodeBytesSlice(bz []byte) ([]byte, error) { return bytesCopy, err } -// encodeBytesSize returns the byte size of the given slice including length-prefixing. +// EncodeBytesSize returns the byte size of the given slice including length-prefixing. func EncodeBytesSize(bz []byte) int { return EncodeUvarintSize(uint64(len(bz))) + len(bz) } diff --git a/store/v2/storage/pebbledb/comparator.go b/store/v2/storage/pebbledb/comparator.go index 08b360e6c0..337ff7698d 100644 --- a/store/v2/storage/pebbledb/comparator.go +++ b/store/v2/storage/pebbledb/comparator.go @@ -202,7 +202,9 @@ func MVCCKeyCompare(a, b []byte) int { return bytes.Compare(aTS, bTS) } -// \x00[]<#version-bytes> +// MVCCEncode encodes a key and version into an MVCC format. +// The format is: \x00[]<#version-bytes> +// If the version is 0, only the key and a null byte are encoded. func MVCCEncode(key []byte, version uint64) (dst []byte) { dst = append(dst, key...) dst = append(dst, 0) diff --git a/store/v2/validation.go b/store/v2/validation.go index e1bfcfa78b..a495f83b78 100644 --- a/store/v2/validation.go +++ b/store/v2/validation.go @@ -1,10 +1,12 @@ package store var ( - // 128K - 1 + // MaxKeyLength is the maximum allowed length for a key in bytes. + // It is set to 128K - 1 (131,071 bytes). MaxKeyLength = (1 << 17) - 1 - // 2G - 1 + // MaxValueLength is the maximum allowed length for a value in bytes. + // It is set to 2G - 1 (2,147,483,647 bytes). MaxValueLength = (1 << 31) - 1 )