func (x *ExtentObj) listen(notifyC chan<- struct{}) {
	x.ext.listen(notifyC)
}
listen registers a 'notification channel' that will be notified
of any newly available messages to read
package storehost
import (
	"sync/atomic"
	"time"
	"github.com/uber/cherami-server/services/storehost/load"
	"github.com/uber/cherami-server/storage"
	"github.com/uber/cherami-thrift/.generated/go/store"
)
type ExtentObj struct {
	ext    *extentContext
	intent OpenIntent
	notifyC chan<- struct{}  
	addr    storage.Address  
	next    storage.Address  
	nextKey storage.Key      
}
func newExtentObj(ext *extentContext, intent OpenIntent) (x *ExtentObj) {
	return &ExtentObj{ext: ext, intent: intent}
}
func (x *ExtentObj) Delete() {
	x.ext.delete()
}
func (x *ExtentObj) Close() {
	x.ext.xMgr.closeExtent(x.ext, x.intent, nil)
}
func (x *ExtentObj) Mode() Mode {
	return x.ext.mode
}
func (x *ExtentObj) extentLock() {
	x.ext.Lock()
}
func (x *ExtentObj) extentUnlock() {
	x.ext.Unlock()
}
func (x *ExtentObj) extentRLock() {
	x.ext.RLock()
}
func (x *ExtentObj) extentRUnlock() {
	x.ext.RUnlock()
}
func (x *ExtentObj) getFirstSeqNum() int64 {
	return atomic.LoadInt64(&x.ext.firstSeqNum)
}
func (x *ExtentObj) setFirstSeqNum(firstSeqNum int64) {
	atomic.StoreInt64(&x.ext.firstSeqNum, firstSeqNum)
}
func (x *ExtentObj) setFirstMsg(firstAddr, firstSeqNum, firstTimestamp int64) {
	atomic.StoreInt64(&x.ext.firstAddr, firstAddr)
	atomic.StoreInt64(&x.ext.firstSeqNum, firstSeqNum)
	atomic.StoreInt64(&x.ext.firstTimestamp, firstTimestamp)
}
func (x *ExtentObj) getLastSeqNum() int64 {
	return x.ext.lastSeqNum  
}
func (x *ExtentObj) setLastSeqNum(lastSeqNum int64) {
	x.ext.lastSeqNum = lastSeqNum  
}
func (x *ExtentObj) setLastMsg(lastAddr, lastSeqNum, lastTimestamp int64) {
	x.ext.lastAddr = lastAddr
	x.ext.lastSeqNum = lastSeqNum
	x.ext.lastTimestamp = lastTimestamp
}
func (x *ExtentObj) getSealSeqNum() int64 {
	return atomic.LoadInt64(&x.ext.sealSeqNum)
}
func (x *ExtentObj) setSealSeqNum(sealSeqNum int64) {
	atomic.StoreInt64(&x.ext.sealSeqNum, sealSeqNum)  
}
func (x *ExtentObj) messageVisibilityTime(msg *store.AppendMessage) (visibilityTime int64) {
	return x.ext.messageVisibilityTime(msg)
}
func (x *ExtentObj) constructKey(visibilityTime int64, seqNum int64) storage.Key {
	return x.ext.constructKey(visibilityTime, seqNum)
}
func (x *ExtentObj) deconstructKey(key storage.Key) (visibilityTime int64, seqNum int64) {
	vt, sn := x.ext.deconstructKey(key)
	return int64(vt), int64(sn)
}
func (x *ExtentObj) maxSeqNum() (seqNum int64) {
	return int64(x.ext.maxSeqNum())
}
func (x *ExtentObj) constructSealExtentKey(seqNum int64) storage.Key {
	return x.ext.constructSealExtentKey(int64(seqNum))
}
func (x *ExtentObj) deconstructSealExtentKey(key storage.Key) (seqNum int64) {
	return int64(x.ext.deconstructSealExtentKey(key))
}
func (x *ExtentObj) isSealExtentKey(key storage.Key) bool {
	return x.ext.isSealExtentKey(key)
}
func (x *ExtentObj) storePut(key storage.Key, val storage.Value) (addr storage.Address, err error) {
	t0 := time.Now().UnixNano()
	addr, err = x.ext.store.Put(key, val)
	if err != nil {
		tX := time.Now().UnixNano()
		x.ext.extMetrics.Add(load.ExtentMetricWriteLatency, tX-t0)
		x.ext.extMetrics.Increment(load.ExtentMetricMsgsWritten)
		x.ext.xMgr.hostMetrics.Increment(load.HostMetricMsgsWritten)
		x.ext.extMetrics.Add(load.ExtentMetricBytesWritten, int64(len(val)))
		x.ext.xMgr.hostMetrics.Add(load.HostMetricBytesWritten, int64(len(val)))
	}
	return
}
func (x *ExtentObj) storeSync() {
	x.ext.store.Sync()
}
func (x *ExtentObj) storeGet(addr storage.Address) (key storage.Key, val storage.Value, nextAddr storage.Address, nextKey storage.Key, err error) {
	t0 := time.Now().UnixNano()
	key, val, nextAddr, nextKey, err = x.ext.store.Get(addr)
	if err != nil {
		tX := time.Now().UnixNano()
		x.ext.extMetrics.Add(load.ExtentMetricReadLatency, tX-t0)
		x.ext.extMetrics.Increment(load.ExtentMetricMsgsRead)
		x.ext.xMgr.hostMetrics.Increment(load.HostMetricMsgsRead)
		x.ext.extMetrics.Add(load.ExtentMetricBytesRead, int64(len(val)))
		x.ext.xMgr.hostMetrics.Add(load.HostMetricBytesRead, int64(len(val)))
	}
	return
}
func (x *ExtentObj) storeGetMany(addr storage.Address, numMsgs int32, maxAddr storage.Address) (msgs []storage.KeyValue, nextAddr storage.Address, nextKey storage.Key, err error) {
	return x.ext.store.GetMany(addr, numMsgs, maxAddr)
}
func (x *ExtentObj) storeNext(addr storage.Address) (nextAddr storage.Address, nextKey storage.Key, err error) {
	return x.ext.store.Next(addr)
}
func (x *ExtentObj) storeSeekCeiling(ceilKey storage.Key) (addr storage.Address, key storage.Key, err error) {
	return x.ext.store.SeekCeiling(ceilKey)
}
func (x *ExtentObj) storeSeekFloor(floorKey storage.Key) (addr storage.Address, key storage.Key, err error) {
	return x.ext.store.SeekFloor(floorKey)
}
func (x *ExtentObj) storeSeekFirst() (addr storage.Address, key storage.Key, err error) {
	return x.ext.store.SeekFirst()
}
func (x *ExtentObj) storeSeekLast() (addr storage.Address, key storage.Key, err error) {
	return x.ext.store.SeekLast()
}
func (x *ExtentObj) storeGetKey(addr storage.Address) (key storage.Key, err error) {
	return x.ext.store.GetKey(addr)
}
func (x *ExtentObj) storePurge(endAddr storage.Address) (nextAddr storage.Address, nextKey storage.Key, err error) {
	return x.ext.store.Purge(endAddr)
}