Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for newSMT (0.09 sec)

  1. pkg/ledger/smt_test.go

    	"istio.io/istio/pkg/cache"
    	"istio.io/istio/pkg/test/util/assert"
    )
    
    func TestSmtEmptyTrie(t *testing.T) {
    	smt := newSMT(hasher, nil, time.Minute)
    	if !bytes.Equal([]byte{}, smt.root) {
    		t.Fatal("empty trie root hash not correct")
    	}
    }
    
    func TestSmtUpdateAndGet(t *testing.T) {
    	smt := newSMT(hasher, nil, time.Minute)
    	smt.atomicUpdate = false
    
    	// Add data to empty trie
    	keys := getFreshData(10)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 08 16:43:05 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  2. pkg/ledger/ledger_test.go

    	"github.com/spaolacci/murmur3"
    	"golang.org/x/sync/errgroup"
    
    	"istio.io/istio/pkg/test/util/assert"
    )
    
    func TestLongKeys(t *testing.T) {
    	longKey := "virtual-service/frontend/default"
    	l := smtLedger{tree: newSMT(hasher, nil, time.Minute)}
    	_, err := l.Put(longKey+"1", "1")
    	assert.NoError(t, err)
    	_, err = l.Put(longKey+"2", "2")
    	assert.NoError(t, err)
    	res, err := l.Get(longKey + "1")
    	assert.NoError(t, err)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jul 12 16:12:59 UTC 2023
    - 4K bytes
    - Viewed (0)
  3. pkg/ledger/ledger.go

    }
    
    type smtLedger struct {
    	tree *smt
    }
    
    // Make returns a Ledger which will retain previous nodes after they are deleted.
    func Make(retention time.Duration) Ledger {
    	return smtLedger{tree: newSMT(hasher, nil, retention)}
    }
    
    // Put adds a key value pair to the ledger, overwriting previous values and marking them for
    // removal after the retention specified in Make()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  4. pkg/ledger/smt.go

    // rollover, causing an immediate expiration (ironic, eh?)
    const forever time.Duration = 1<<(63-1) - 1
    
    // newSMT creates a new smt given a keySize, hash function, cache (nil will be defaulted to TTLCache), and retention
    // duration for old nodes.
    func newSMT(hash func(data ...[]byte) []byte, updateCache cache.ExpiringCache, retentionDuration time.Duration) *smt {
    	if updateCache == nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 08 16:43:05 UTC 2023
    - 14K bytes
    - Viewed (0)
Back to top