MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / Write

Method Write

hintfile.go:430–438  ·  view source on GitHub ↗

Write writes a hint entry to the file

(entry *HintEntry)

Source from the content-addressed store, hash-verified

428
429// Write writes a hint entry to the file
430func (w *HintFileWriter) Write(entry *HintEntry) error {
431 if entry == nil {
432 return ErrHintFileEntryInvalid
433 }
434
435 data := entry.Encode()
436 _, err := w.writer.Write(data)
437 return err
438}
439
440// Sync flushes the buffer and syncs the file to disk
441func (w *HintFileWriter) Sync() error {

Callers 7

BenchmarkHintFileWriteFunction · 0.95
BenchmarkHintFileReadFunction · 0.95
TestHintFileWriterReaderFunction · 0.95
TestHintFilePartialReadFunction · 0.95

Calls 2

WriteMethod · 0.65
EncodeMethod · 0.45

Tested by 6

BenchmarkHintFileWriteFunction · 0.76
BenchmarkHintFileReadFunction · 0.76
TestHintFileWriterReaderFunction · 0.76
TestHintFilePartialReadFunction · 0.76