func (l PrimaryLayer) Seek(k int) (e *PrimaryEnumerator, ok bool) {
	l.lock.Lock()
	e, ok = l.store.Seek(k)
	l.lock.Unlock()
	return
}
Seek returns an PrimaryEnumerator positioned on a secondary layer such that k >= layer's key.
package btree2d
import (
	"io"
	"github.com/zenhotels/btree-2d/lockie"
	"github.com/zenhotels/btree-2d/util"
)
type PrimaryCmpFunc func(key1, key2 int) int
type PrimaryLayer struct {
	store  *PrimaryTree
	offset uint64
	synced *uint64  
	lock   lockie.Lockie
	cmp1   PrimaryCmpFunc
	cmp2   SecondaryCmpFunc
}
func NewPrimaryLayer(cmp1 PrimaryCmpFunc, cmp2 SecondaryCmpFunc) PrimaryLayer {
	var synced uint64
	return PrimaryLayer{
		synced: &synced,
		store:  NewPrimaryTree(cmp1),
		offset: uint64(util.RevOffset()),
		lock:   lockie.NewLockie(),
		cmp1:   cmp1,
		cmp2:   cmp2,
	}
}
func (l PrimaryLayer) Set(k int, layer SecondaryLayer) {
	l.lock.Lock()
	l.store.Put(k, func(oldLayer SecondaryLayer, exists bool) (newLayer SecondaryLayer, write bool) {
		if exists {
			oldLayer.Finalize()
		}
		return layer, true
	})
	l.lock.Unlock()
}
func (l PrimaryLayer) Rev() uint64 {
	return l.store.Ver() + l.offset
}
func (l PrimaryLayer) Put(k int, k2 string, finalizers ...func()) {
	l.lock.Lock()
	l.store.Put(k, func(oldLayer SecondaryLayer, exists bool) (newLayer SecondaryLayer, write bool) {
		if !exists {
			oldLayer = NewSecondaryLayer(l.cmp2)
		}
		oldLayer.Put(k2, finalizers...)
		return oldLayer, true
	})
	l.lock.Unlock()
}