log.Warn("chunk for cleanup","key",fmt.Sprintf("%x",key),"ck",fmt.Sprintf("%x",ck),"dkey",fmt.Sprintf("%x",datakey),"dataidx",index.Idx,"po",po,"len data",len(data),"len sdata",len(c.sdata),"size",cs)
s.delete(index.Idx,getIndexKey(key[1:]),po)
removed++
@ -730,6 +731,30 @@ func (s *LDBStore) tryAccessIdx(ikey []byte, index *dpaDBIndex) bool {
returntrue
}
// GetSchema is returning the current named schema of the datastore as read from LevelDB
func(s*LDBStore)GetSchema()(string,error){
s.lock.Lock()
defers.lock.Unlock()
data,err:=s.db.Get(keySchema)
iferr!=nil{
iferr==leveldb.ErrNotFound{
return"",nil
}
return"",err
}
returnstring(data),nil
}
// PutSchema is saving a named schema to the LevelDB datastore