<commit_before>package lrufile

import (
	"fmt"
	"io"
	"os"

	"github.com/hashicorp/golang-lru/simplelru"

	"github.com/go-errors/errors"
)

var lruFileDumpStats = os.Getenv("LRU)FILE_DUMP_STATS") == "1"

type File interface {
	io.ReadSeeker
	Reset(rs io.ReadSeeker) error
	Stats() Stats
}

type Stats struct {
	Hits   int64
	Misses int64
}

type lruFile struct {
	chunkSize  int64
	numEntries int

	rs   io.ReadSeeker
	size int64

	offset int64

	storage     []byte
	allocations []int64

	// maps chunkIndex to storageIndex
	lru *simplelru.LRU

	stats Stats
}<commit_msg>update to new simplelru interface<commit_after>package lrufile

import (
	"fmt"
	"io"
	"os"

	"github.com/hashicorp/golang-lru/simplelru"

	"github.com/go-errors/errors"
)

var lruFileDumpStats = os.Getenv("LRU)FILE_DUMP_STATS") == "1"

type File interface {
	io.ReadSeeker
	Reset(rs io.ReadSeeker) error
	Stats() Stats
}

type Stats struct {
	Hits   int64
	Misses int64
}

type lruFile struct {
	chunkSize  int64
	numEntries int

	rs   io.ReadSeeker
	size int64

	offset int64

	storage     []byte
	allocations []int64

	// maps chunkIndex to storageIndex
	lru simplelru.LRUCache

	stats Stats
}
{'fraction_non_alphanumeric': 0.09503424657534247, 'fraction_numerical': 0.02226027397260274, 'mean_word_length': 3.7714285714285714, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2194838', 'n_tokens_mistral': 507, 'n_tokens_neox': 459, 'n_words': 110}