func (s *Store) Close() {
	for _, queue := range s.queues {
		queue.Close()
	}
	for _, handle := range s.cfHandles {
		handle.Destroy()
	}
	s.DB.Close()
}
Close the rocksdb database
package rocksq
import (
	"fmt"
	"os"
	"runtime"
	"sync"
	"github.com/mijia/sweb/log"
	rocks "github.com/tecbot/gorocksdb"
)
type StoreOptions struct {
	Directory             string
	WriteBufferSize       int
	WriteBufferNumber     int
	MemorySize            int
	FileSizeBase          uint64
	Compression           rocks.CompressionType
	Parallel              int
	DisableAutoCompaction bool
	DisableWAL            bool
	DisableTailing        bool
	Sync                  bool
	IsDebug               bool
}
func (so *StoreOptions) SetDefaults() {
	if so.MemorySize <= 0 {
		so.MemorySize = 8 * 1024 * 1024
	}
	if so.FileSizeBase <= 0 {
		so.FileSizeBase = 64 * 1024 * 1024
	}
	if so.WriteBufferSize <= 0 {
		so.WriteBufferSize = 64 * 1024 * 1024
	}
	if so.WriteBufferNumber <= 0 {
		so.WriteBufferNumber = 4
	}
	if so.Parallel <= 0 {
		so.Parallel = runtime.NumCPU()
	}
}
type Store struct {
	*rocks.DB
	sync.RWMutex
	directory  string
	useTailing bool
	dbOpts     *rocks.Options
	cfHandles map[string]*rocks.ColumnFamilyHandle
	queues    map[string]*Queue
	ro        *rocks.ReadOptions
	wo        *rocks.WriteOptions
}
func (s *Store) NewQueue(name string) (*Queue, error) {
	s.Lock()
	defer s.Unlock()
	if q, ok := s.queues[name]; ok {
		return q, nil
	}
	var cfHandle *rocks.ColumnFamilyHandle
	if handle, ok := s.cfHandles[name]; ok {
		cfHandle = handle
	} else {
		if handle, err := s.CreateColumnFamily(s.dbOpts, name); err != nil {
			log.Errorf("Failed to create column family %q, %s", name, err)
			return nil, err
		} else {
			cfHandle = handle
			s.cfHandles[name] = cfHandle
		}
	}
	return newQueue(name, s, cfHandle, s.useTailing), nil
}