Skip to content

Commit

Permalink
reorder interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
CascadingRadium committed Dec 9, 2024
1 parent d6ac8cd commit e2cede8
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ type PersistedSegment interface {
Path() string
}

type SynonymSegment interface {
Segment
Thesaurus(field string) (Thesaurus, error)
}

type TermDictionary interface {
PostingsList(term []byte, except *roaring.Bitmap, prealloc PostingsList) (PostingsList, error)

Expand All @@ -75,12 +70,6 @@ type TermDictionary interface {
Contains(key []byte) (bool, error)
}

type Thesaurus interface {
SynonymsList(term []byte, except *roaring.Bitmap, prealloc SynonymsList) (SynonymsList, error)

Contains(key []byte) (bool, error)
}

type DictionaryIterator interface {
Next() (*index.DictEntry, error)
}
Expand All @@ -100,12 +89,6 @@ type PostingsList interface {
// Or(other PostingsList) PostingsList
}

type SynonymsList interface {
Iterator(prealloc SynonymsIterator) SynonymsIterator

Size() int
}

type PostingsIterator interface {
DiskStatsReporter

Expand All @@ -124,16 +107,6 @@ type PostingsIterator interface {
Size() int
}

type SynonymsIterator interface {
// The caller is responsible for copying whatever it needs from
// the returned Posting instance before calling Next(), as some
// implementations may return a shared instance to reduce memory
// allocations.
Next() (Synonym, error)

Size() int
}

type DiskStatsReporter interface {
// BytesRead returns the bytes read from the disk as
// part of the current running query.
Expand Down Expand Up @@ -166,13 +139,6 @@ type Posting interface {
Size() int
}

type Synonym interface {
Term() string
DocNum() uint32
SynonymID() uint32
Size() int
}

type Location interface {
Field() string
Start() uint64
Expand Down Expand Up @@ -212,3 +178,37 @@ type FieldStats interface {
Aggregate(stats FieldStats)
Fetch() map[string]map[string]uint64
}

type ThesaurusSegment interface {
Segment
Thesaurus(field string) (Thesaurus, error)
}

type Thesaurus interface {
SynonymsList(term []byte, except *roaring.Bitmap, prealloc SynonymsList) (SynonymsList, error)

AutomatonIterator(a Automaton,
startKeyInclusive, endKeyExclusive []byte) ThesaurusIterator

Contains(key []byte) (bool, error)
}

type ThesaurusIterator interface {
Next() (*index.ThesaurusEntry, error)

Check failure on line 197 in segment.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, ubuntu-latest)

undefined: index.ThesaurusEntry

Check failure on line 197 in segment.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, macos-latest)

undefined: index.ThesaurusEntry

Check failure on line 197 in segment.go

View workflow job for this annotation

GitHub Actions / test (1.21.x, ubuntu-latest)

undefined: index.ThesaurusEntry

Check failure on line 197 in segment.go

View workflow job for this annotation

GitHub Actions / test (1.21.x, macos-latest)

undefined: index.ThesaurusEntry

Check failure on line 197 in segment.go

View workflow job for this annotation

GitHub Actions / test (1.22.x, ubuntu-latest)

undefined: index.ThesaurusEntry

Check failure on line 197 in segment.go

View workflow job for this annotation

GitHub Actions / test (1.22.x, macos-latest)

undefined: index.ThesaurusEntry
}

type SynonymsList interface {
Iterator(prealloc SynonymsIterator) SynonymsIterator
Size() int
}

type SynonymsIterator interface {
Next() (Synonym, error)
Size() int
}

type Synonym interface {
Number() uint32
Term() string
Size() int
}

0 comments on commit e2cede8

Please sign in to comment.