Documentation ¶
Index ¶
- Constants
- Variables
- func Fallocate(filePath string, offset int64, length int64) error
- func Get_cache_dir(msgidhash string, src string) (string, string, string)
- func Make_cache_dir(cachedir string, bodycache bool, headcache bool)
- func MapRegion(filePath string, minPos int64, maxPos int64) (mmap.Map, *os.File, error)
- type CYCBUF
- type CacheItem
- type CycBufHandler
- func (handler *CycBufHandler) CreateCycBuf(ident string, ctype int, bufpath string, datpath string, initsize int64, ...) (*CYCBUF, error)
- func (handler *CycBufHandler) InitCycBufs(basedir string, depth int, initsize int64, growby int64, readers int64, ...) (bool, error)
- func (handler *CycBufHandler) Load_CycBufs(indexfile string) bool
- func (handler *CycBufHandler) SetOffset(cb *CYCBUF, wid int, offset int64)
- type RC
- type ReadItem
- type ReadReq
- type RedisLink
- type SC
- func (sc *SC) Add(countername string, value uint64)
- func (sc *SC) Checkmap()
- func (sc *SC) Dec(countername string)
- func (sc *SC) Del(countername string)
- func (sc *SC) Get(countername string) uint64
- func (sc *SC) Inc(countername string)
- func (sc *SC) Init(countername string, value uint64)
- func (sc *SC) Make_SC()
- func (sc *SC) Set(countername string, value uint64)
- func (sc *SC) Sub(countername string, value uint64)
- type WC
- type XL
- type XREF
Constants ¶
View Source
const ( DefaultCycBufsBaseDir = "/mnt/cb" // without trailing slash! DefaultReaders, DefaultWriters int64 = 1, 1 MinInitSize int64 = 1024 * 1024 MinGrowSize int64 = 1024 * 1024 DefaultSize1G int64 = 1024 * 1024 * 1024 DefaultFlushEveryBytes int64 = 64 * 1024 DefaultFlushEverySeconds int64 = 5 DefaultFlushEveryMessages = 200 CycBufType_Head = 0xAAA CycBufType_Body = 0xBBB CycBufType_Comb = 0xCCC )
Variables ¶
View Source
var (
DOTSTUFFING bool // default false = off. frontend reader/writer should handle it.
)
Functions ¶
func Make_cache_dir ¶
Types ¶
type CYCBUF ¶
type CYCBUF struct { // the ident of this cycbuf must be unique! Ident string Hash string // location to this cycbuf as full path or relative // identified by Cookie string without file extension // Path contains: /mnt/cycbuf/{Cookie} // later appending .[cycbuf|cycdat] Path string // 64 chars uniq random string to identify this cycbuf // used as fileident.cycbuf in CycBufDir Cookie string // defines what this cycbuf stores: [head|body|comb] Type int // initial size of this cycbuf InitCycBufSize int64 // total number of cycles the cycbuf has done (print with 2 decimals) Cycles float64 // if Rollover == true: cycbuf will grow up to InitCycBufSize // and revert back to start when reaching the end overwriting old messages // if cycbuf has more than 1 writer: every area can rollower on its own Rollover bool // if Rollover == false: cycbuf will grow by this amount of bytes // if set to 0: cycbuf will not grow and server stops accepting articles Growby int64 // spawn this many dedicated readers for this cycbuf // can be changed later without problems Readers int64 // spawn this many dedicated writers for this cycbuf // every writer writes in own area: InitCycBufSize / Writers // note: it is impossible to change writers later! Writers int64 // flushing options LastFlush int64 // timestamp FlushEveryBytes int64 FlushEveryMessages int FlushEverySeconds int64 // counter when to flush CtrB int CtrM int CtrS int TimeOpen int64 // timestamp of opening // cb.Offsets[0] contains no value // cb.Offsets[1:] used by writers Offsets map[int]*area // key: writerID, val: offset / position in cycbuf-area // contains filtered or unexported fields } // end CYCBUF struct
type CycBufHandler ¶
type CycBufHandler struct { Depth int /// 0 uses routing from storage.conf, >0 puts hashs in files 0__ - f__ BaseDir string CycBufs map[string]*CYCBUF // key: ident, val: pointer to a CYCBUF // contains filtered or unexported fields }
var ( // CycBufsDepth values can be: // 0 or 16, 256, 4096, 65536 // // if CycBufsDepth == 0: // uses routing from storage config // routing should allow setting min/max size of articles and groups we want in this cycbuf // // if CycBufsDepth (16 || 256 || 4096): // creates this many CycBufs for hashs 0__ - f__ without the use of routing // AvailableCycBufsDepths = []int{0, 16, 256, 4096, 65536} CBH CycBufHandler )
func (*CycBufHandler) CreateCycBuf ¶
func (*CycBufHandler) InitCycBufs ¶
func (*CycBufHandler) Load_CycBufs ¶
func (handler *CycBufHandler) Load_CycBufs(indexfile string) bool
type RC ¶
type RC struct { Debug bool RC_head_chan chan ReadReq RC_body_chan chan ReadReq // contains filtered or unexported fields } // end storage.RC struct
var (
ReadCache RC
)
func (*RC) Load_Readcache ¶
func (*RC) RC_Worker_DN ¶
func (*RC) RC_Worker_Set ¶
func (*RC) RC_Worker_UP ¶
type RedisLink ¶
type RedisLink struct { // contains filtered or unexported fields } // end RedisLink struct
type SC ¶
type SC struct { MapSize int // contains filtered or unexported fields } // end SC struct
StorageCounter is safe to use concurrently.
var (
StorageCounter SC
)
type WC ¶
type WC struct { Debug bool WC_body_chan chan CacheItem WC_head_chan chan CacheItem Log_cache_history_chan chan *[]string // contains filtered or unexported fields }
var (
WriteCache WC
)
func (*WC) Load_Writecache ¶
func (*WC) WC_Worker_DN ¶
func (*WC) WC_Worker_Set ¶
func (*WC) WC_Worker_UP ¶
Click to show internal directories.
Click to hide internal directories.