<commit_before>package vega

import (
	"errors"
	"strconv"
	"strings"
	"sync"

	"github.com/jmhodges/levigo"
	"github.com/ugorji/go/codec"
)

var ECorruptMailbox = errors.New("corrupt mailbox metadata")

type diskStorage struct {
	db *levigo.DB

	lock sync.Mutex
}

func NewDiskStorage(path string) (*diskStorage, error) {
	opts := levigo.NewOptions()
	opts.SetCache(levigo.NewLRUCache(3 << 30))
	opts.SetCreateIfMissing(true)

	db, err := levigo.Open(path, opts)
	if err != nil {
		return nil, err
	}

	return &diskStorage{db: db}, nil
}

func (d *diskStorage) Close() error {
	d.db.Close()
	return nil
}

type diskMailbox struct {
	sync.Mutex

	disk     *diskStorage
	prefix   []byte
	watchers []*watchChannel
}

type infoHeader struct {<commit_msg>Change the LRU cache size to 100M<commit_after>package vega

import (
	"errors"
	"strconv"
	"strings"
	"sync"

	"github.com/jmhodges/levigo"
	"github.com/ugorji/go/codec"
)

var ECorruptMailbox = errors.New("corrupt mailbox metadata")

type diskStorage struct {
	db *levigo.DB

	lock sync.Mutex
}

const LRUCacheSize = 100 * 1048576

func NewDiskStorage(path string) (*diskStorage, error) {
	opts := levigo.NewOptions()
	opts.SetCache(levigo.NewLRUCache(LRUCacheSize))
	opts.SetCreateIfMissing(true)

	db, err := levigo.Open(path, opts)
	if err != nil {
		return nil, err
	}

	return &diskStorage{db: db}, nil
}

func (d *diskStorage) Close() error {
	d.db.Close()
	return nil
}

type diskMailbox struct {
	sync.Mutex

	disk     *diskStorage
	prefix   []byte
	watchers []*watchChannel
}

type infoHeader struct {
{'fraction_non_alphanumeric': 0.12412028150991683, 'fraction_numerical': 0.010236724248240563, 'mean_word_length': 4.283783783783784, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2589318', 'n_tokens_mistral': 619, 'n_tokens_neox': 590, 'n_words': 141}