removed unused AsyncIndex interface
This commit is contained in:
parent
34ebd6ab08
commit
e1fb860a86
|
@ -13,7 +13,6 @@ import (
|
|||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/blevesearch/bleve/document"
|
||||
"github.com/blevesearch/bleve/index/store"
|
||||
|
@ -50,16 +49,6 @@ type Index interface {
|
|||
Advanced() (store.KVStore, error)
|
||||
}
|
||||
|
||||
// AsyncIndex is an interface for indexes which perform
|
||||
// some important operations asynchronously.
|
||||
type AsyncIndex interface {
|
||||
// Wait will block until asynchronous operations started
|
||||
// before this call have finished or until the specified
|
||||
// timeout has been reached. If the timeout is reached
|
||||
// an error is returned.
|
||||
Wait(timeout time.Duration) error
|
||||
}
|
||||
|
||||
type IndexReader interface {
|
||||
TermFieldReader(term []byte, field string, includeFreq, includeNorm, includeTermVectors bool) (TermFieldReader, error)
|
||||
|
||||
|
|
|
@ -19,10 +19,8 @@ import (
|
|||
"reflect"
|
||||
"regexp"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/blevesearch/bleve"
|
||||
bleveIndex "github.com/blevesearch/bleve/index"
|
||||
|
||||
// we must explicitly include any functionality we plan on testing
|
||||
_ "github.com/blevesearch/bleve/analysis/analyzers/keyword_analyzer"
|
||||
|
@ -136,19 +134,6 @@ func runTestDir(t *testing.T, dir, datasetName string) {
|
|||
}
|
||||
}
|
||||
|
||||
indexInternal, _, err := index.Advanced()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if indexInternal, ok := indexInternal.(bleveIndex.AsyncIndex); ok {
|
||||
start := time.Now()
|
||||
err = indexInternal.Wait(5 * time.Second)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Logf("we had to wait for %v", time.Since(start))
|
||||
}
|
||||
|
||||
// read the searches
|
||||
searchBytes, err := ioutil.ReadFile(dir + string(filepath.Separator) + "searches.json")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue