0
0
Fork 0

BREAKING CHANGE - rename upside_down to upsidedown

This commit is contained in:
Marty Schoch 2016-09-30 11:30:17 -04:00
parent 35da361bfa
commit f90856b8d3
39 changed files with 83 additions and 81 deletions

View File

@ -17,7 +17,7 @@ package cmd
import (
"fmt"
"github.com/blevesearch/bleve/index/upside_down"
"github.com/blevesearch/bleve/index/upsidedown"
"github.com/spf13/cobra"
)
@ -43,7 +43,7 @@ var dumpCmd = &cobra.Command{
switch rowOrErr := rowOrErr.(type) {
case error:
return fmt.Errorf("error dumping: %v", rowOrErr)
case upside_down.UpsideDownCouchRow:
case upsidedown.UpsideDownCouchRow:
fmt.Printf("%v\n", rowOrErr)
fmt.Printf("Key: % -100x\nValue: % -100x\n\n", rowOrErr.Key(), rowOrErr.Value())
}

View File

@ -17,7 +17,7 @@ package cmd
import (
"fmt"
"github.com/blevesearch/bleve/index/upside_down"
"github.com/blevesearch/bleve/index/upsidedown"
"github.com/spf13/cobra"
)
@ -45,7 +45,7 @@ var dumpDocCmd = &cobra.Command{
switch rowOrErr := rowOrErr.(type) {
case error:
return fmt.Errorf("error dumping: %v", rowOrErr)
case upside_down.UpsideDownCouchRow:
case upsidedown.UpsideDownCouchRow:
fmt.Printf("%v\n", rowOrErr)
fmt.Printf("Key: % -100x\nValue: % -100x\n\n", rowOrErr.Key(), rowOrErr.Value())
}

View File

@ -17,7 +17,7 @@ package cmd
import (
"fmt"
"github.com/blevesearch/bleve/index/upside_down"
"github.com/blevesearch/bleve/index/upsidedown"
"github.com/spf13/cobra"
)
@ -41,7 +41,7 @@ var dumpFieldsCmd = &cobra.Command{
switch rowOrErr := rowOrErr.(type) {
case error:
return fmt.Errorf("error dumping: %v", rowOrErr)
case upside_down.UpsideDownCouchRow:
case upsidedown.UpsideDownCouchRow:
fmt.Printf("%v\n", rowOrErr)
fmt.Printf("Key: % -100x\nValue: % -100x\n\n", rowOrErr.Key(), rowOrErr.Value())
}

View File

@ -17,7 +17,7 @@ import (
"github.com/blevesearch/bleve/index"
"github.com/blevesearch/bleve/index/store/gtreap"
"github.com/blevesearch/bleve/index/upside_down"
"github.com/blevesearch/bleve/index/upsidedown"
"github.com/blevesearch/bleve/registry"
"github.com/blevesearch/bleve/search/highlight/highlighters/html"
)
@ -64,7 +64,7 @@ func init() {
Config.DefaultMemKVStore = gtreap.Name
// default index
Config.DefaultIndexType = upside_down.Name
Config.DefaultIndexType = upsidedown.Name
bootDuration := time.Since(bootStart)
bleveExpVar.Add("bootDuration", int64(bootDuration))

View File

@ -92,5 +92,5 @@ import (
// index types
_ "github.com/blevesearch/bleve/index/smolder"
_ "github.com/blevesearch/bleve/index/upside_down"
_ "github.com/blevesearch/bleve/index/upsidedown"
)

View File

@ -13,7 +13,7 @@ import (
"fmt"
"net/http"
"github.com/blevesearch/bleve/index/upside_down"
"github.com/blevesearch/bleve/index/upsidedown"
)
// DebugDocumentHandler allows you to debug the index content
@ -70,7 +70,7 @@ func (h *DebugDocumentHandler) ServeHTTP(w http.ResponseWriter, req *http.Reques
case error:
showError(w, req, fmt.Sprintf("error debugging document: %v", row), 500)
return
case upside_down.UpsideDownCouchRow:
case upsidedown.UpsideDownCouchRow:
tmp := struct {
Key []byte `json:"key"`
Val []byte `json:"val"`

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"github.com/blevesearch/bleve/analysis"

View File

@ -1,4 +1,4 @@
package upside_down
package upsidedown
import (
"testing"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"testing"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"os"

View File

@ -9,7 +9,7 @@
// +build cznicb
package upside_down
package upsidedown
import (
"testing"

View File

@ -9,7 +9,7 @@
// +build forestdb
package upside_down
package upsidedown
import (
"os"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"testing"

View File

@ -9,7 +9,7 @@
// +build rocksdb
package upside_down
package upsidedown
import (
"testing"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"testing"

View File

@ -9,7 +9,7 @@
// +build leveldb
package upside_down
package upsidedown
import (
"testing"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"testing"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"bytes"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"testing"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"fmt"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"reflect"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"github.com/blevesearch/bleve/document"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"bytes"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"reflect"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"bytes"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"encoding/binary"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"bytes"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"math"

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"encoding/json"

View File

@ -7,7 +7,9 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
//go:generate protoc --gofast_out=. upsidedown.proto
package upsidedown
import (
"encoding/binary"

View File

@ -1,19 +1,19 @@
// Code generated by protoc-gen-gogo.
// source: upside_down.proto
// source: upsidedown.proto
// DO NOT EDIT!
/*
Package upside_down is a generated protocol buffer package.
Package upsidedown is a generated protocol buffer package.
It is generated from these files:
upside_down.proto
upsidedown.proto
It has these top-level messages:
BackIndexTermEntry
BackIndexStoreEntry
BackIndexRowValue
*/
package upside_down
package upsidedown
import proto "github.com/golang/protobuf/proto"
import math "math"
@ -170,12 +170,12 @@ func (m *BackIndexTermEntry) Unmarshal(data []byte) error {
}
}
iNdEx -= sizeOfWire
skippy, err := skipUpsideDown(data[iNdEx:])
skippy, err := skipUpsidedown(data[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthUpsideDown
return ErrInvalidLengthUpsidedown
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
@ -258,12 +258,12 @@ func (m *BackIndexStoreEntry) Unmarshal(data []byte) error {
}
}
iNdEx -= sizeOfWire
skippy, err := skipUpsideDown(data[iNdEx:])
skippy, err := skipUpsidedown(data[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthUpsideDown
return ErrInvalidLengthUpsidedown
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
@ -315,7 +315,7 @@ func (m *BackIndexRowValue) Unmarshal(data []byte) error {
}
postIndex := iNdEx + msglen
if msglen < 0 {
return ErrInvalidLengthUpsideDown
return ErrInvalidLengthUpsidedown
}
if postIndex > l {
return io.ErrUnexpectedEOF
@ -343,7 +343,7 @@ func (m *BackIndexRowValue) Unmarshal(data []byte) error {
}
postIndex := iNdEx + msglen
if msglen < 0 {
return ErrInvalidLengthUpsideDown
return ErrInvalidLengthUpsidedown
}
if postIndex > l {
return io.ErrUnexpectedEOF
@ -363,12 +363,12 @@ func (m *BackIndexRowValue) Unmarshal(data []byte) error {
}
}
iNdEx -= sizeOfWire
skippy, err := skipUpsideDown(data[iNdEx:])
skippy, err := skipUpsidedown(data[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthUpsideDown
return ErrInvalidLengthUpsidedown
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
@ -380,7 +380,7 @@ func (m *BackIndexRowValue) Unmarshal(data []byte) error {
return nil
}
func skipUpsideDown(data []byte) (n int, err error) {
func skipUpsidedown(data []byte) (n int, err error) {
l := len(data)
iNdEx := 0
for iNdEx < l {
@ -427,7 +427,7 @@ func skipUpsideDown(data []byte) (n int, err error) {
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthUpsideDown
return 0, ErrInvalidLengthUpsidedown
}
return iNdEx, nil
case 3:
@ -449,7 +449,7 @@ func skipUpsideDown(data []byte) (n int, err error) {
if innerWireType == 4 {
break
}
next, err := skipUpsideDown(data[start:])
next, err := skipUpsidedown(data[start:])
if err != nil {
return 0, err
}
@ -469,7 +469,7 @@ func skipUpsideDown(data []byte) (n int, err error) {
}
var (
ErrInvalidLengthUpsideDown = fmt.Errorf("proto: negative length found during unmarshaling")
ErrInvalidLengthUpsidedown = fmt.Errorf("proto: negative length found during unmarshaling")
)
func (m *BackIndexTermEntry) Size() (n int) {
@ -477,10 +477,10 @@ func (m *BackIndexTermEntry) Size() (n int) {
_ = l
if m.Term != nil {
l = len(*m.Term)
n += 1 + l + sovUpsideDown(uint64(l))
n += 1 + l + sovUpsidedown(uint64(l))
}
if m.Field != nil {
n += 1 + sovUpsideDown(uint64(*m.Field))
n += 1 + sovUpsidedown(uint64(*m.Field))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
@ -492,11 +492,11 @@ func (m *BackIndexStoreEntry) Size() (n int) {
var l int
_ = l
if m.Field != nil {
n += 1 + sovUpsideDown(uint64(*m.Field))
n += 1 + sovUpsidedown(uint64(*m.Field))
}
if len(m.ArrayPositions) > 0 {
for _, e := range m.ArrayPositions {
n += 1 + sovUpsideDown(uint64(e))
n += 1 + sovUpsidedown(uint64(e))
}
}
if m.XXX_unrecognized != nil {
@ -511,13 +511,13 @@ func (m *BackIndexRowValue) Size() (n int) {
if len(m.TermEntries) > 0 {
for _, e := range m.TermEntries {
l = e.Size()
n += 1 + l + sovUpsideDown(uint64(l))
n += 1 + l + sovUpsidedown(uint64(l))
}
}
if len(m.StoredEntries) > 0 {
for _, e := range m.StoredEntries {
l = e.Size()
n += 1 + l + sovUpsideDown(uint64(l))
n += 1 + l + sovUpsidedown(uint64(l))
}
}
if m.XXX_unrecognized != nil {
@ -526,7 +526,7 @@ func (m *BackIndexRowValue) Size() (n int) {
return n
}
func sovUpsideDown(x uint64) (n int) {
func sovUpsidedown(x uint64) (n int) {
for {
n++
x >>= 7
@ -536,8 +536,8 @@ func sovUpsideDown(x uint64) (n int) {
}
return n
}
func sozUpsideDown(x uint64) (n int) {
return sovUpsideDown(uint64((x << 1) ^ uint64((int64(x) >> 63))))
func sozUpsidedown(x uint64) (n int) {
return sovUpsidedown(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *BackIndexTermEntry) Marshal() (data []byte, err error) {
size := m.Size()
@ -559,7 +559,7 @@ func (m *BackIndexTermEntry) MarshalTo(data []byte) (n int, err error) {
} else {
data[i] = 0xa
i++
i = encodeVarintUpsideDown(data, i, uint64(len(*m.Term)))
i = encodeVarintUpsidedown(data, i, uint64(len(*m.Term)))
i += copy(data[i:], *m.Term)
}
if m.Field == nil {
@ -567,7 +567,7 @@ func (m *BackIndexTermEntry) MarshalTo(data []byte) (n int, err error) {
} else {
data[i] = 0x10
i++
i = encodeVarintUpsideDown(data, i, uint64(*m.Field))
i = encodeVarintUpsidedown(data, i, uint64(*m.Field))
}
if m.XXX_unrecognized != nil {
i += copy(data[i:], m.XXX_unrecognized)
@ -595,13 +595,13 @@ func (m *BackIndexStoreEntry) MarshalTo(data []byte) (n int, err error) {
} else {
data[i] = 0x8
i++
i = encodeVarintUpsideDown(data, i, uint64(*m.Field))
i = encodeVarintUpsidedown(data, i, uint64(*m.Field))
}
if len(m.ArrayPositions) > 0 {
for _, num := range m.ArrayPositions {
data[i] = 0x10
i++
i = encodeVarintUpsideDown(data, i, uint64(num))
i = encodeVarintUpsidedown(data, i, uint64(num))
}
}
if m.XXX_unrecognized != nil {
@ -629,7 +629,7 @@ func (m *BackIndexRowValue) MarshalTo(data []byte) (n int, err error) {
for _, msg := range m.TermEntries {
data[i] = 0xa
i++
i = encodeVarintUpsideDown(data, i, uint64(msg.Size()))
i = encodeVarintUpsidedown(data, i, uint64(msg.Size()))
n, err := msg.MarshalTo(data[i:])
if err != nil {
return 0, err
@ -641,7 +641,7 @@ func (m *BackIndexRowValue) MarshalTo(data []byte) (n int, err error) {
for _, msg := range m.StoredEntries {
data[i] = 0x12
i++
i = encodeVarintUpsideDown(data, i, uint64(msg.Size()))
i = encodeVarintUpsidedown(data, i, uint64(msg.Size()))
n, err := msg.MarshalTo(data[i:])
if err != nil {
return 0, err
@ -655,7 +655,7 @@ func (m *BackIndexRowValue) MarshalTo(data []byte) (n int, err error) {
return i, nil
}
func encodeFixed64UpsideDown(data []byte, offset int, v uint64) int {
func encodeFixed64Upsidedown(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
@ -666,14 +666,14 @@ func encodeFixed64UpsideDown(data []byte, offset int, v uint64) int {
data[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32UpsideDown(data []byte, offset int, v uint32) int {
func encodeFixed32Upsidedown(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintUpsideDown(data []byte, offset int, v uint64) int {
func encodeVarintUpsidedown(data []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
v >>= 7

View File

@ -11,4 +11,4 @@ message BackIndexStoreEntry {
message BackIndexRowValue {
repeated BackIndexTermEntry termEntries = 1;
repeated BackIndexStoreEntry storedEntries = 2;
}
}

View File

@ -7,7 +7,7 @@
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
package upside_down
package upsidedown
import (
"log"

View File

@ -22,7 +22,7 @@ import (
"github.com/blevesearch/bleve/document"
"github.com/blevesearch/bleve/index"
"github.com/blevesearch/bleve/index/store"
"github.com/blevesearch/bleve/index/upside_down"
"github.com/blevesearch/bleve/index/upsidedown"
"github.com/blevesearch/bleve/mapping"
"github.com/blevesearch/bleve/registry"
"github.com/blevesearch/bleve/search"
@ -135,7 +135,7 @@ func openIndexUsing(path string, runtimeConfig map[string]interface{}) (rv *inde
// backwards compatibility if index type is missing
if rv.meta.IndexType == "" {
rv.meta.IndexType = upside_down.Name
rv.meta.IndexType = upsidedown.Name
}
storeConfig := rv.meta.Config

View File

@ -14,7 +14,7 @@ import (
"io/ioutil"
"os"
"github.com/blevesearch/bleve/index/upside_down"
"github.com/blevesearch/bleve/index/upsidedown"
)
const metaFilename = "index_meta.json"
@ -48,7 +48,7 @@ func openIndexMeta(path string) (*indexMeta, error) {
return nil, ErrorIndexMetaCorrupt
}
if im.IndexType == "" {
im.IndexType = upside_down.Name
im.IndexType = upsidedown.Name
}
return &im, nil
}

View File

@ -18,7 +18,7 @@ import (
"github.com/blevesearch/bleve/document"
"github.com/blevesearch/bleve/index"
"github.com/blevesearch/bleve/index/store/gtreap"
"github.com/blevesearch/bleve/index/upside_down"
"github.com/blevesearch/bleve/index/upsidedown"
)
var twoDocIndex index.Index //= upside_down.NewUpsideDownCouch(inmem.MustOpen())
@ -26,7 +26,7 @@ var twoDocIndex index.Index //= upside_down.NewUpsideDownCouch(inmem.MustOpen())
func init() {
analysisQueue := index.NewAnalysisQueue(1)
var err error
twoDocIndex, err = upside_down.NewUpsideDownCouch(
twoDocIndex, err = upsidedown.NewUpsideDownCouch(
gtreap.Name,
map[string]interface{}{
"path": "",

View File

@ -15,13 +15,13 @@ import (
"github.com/blevesearch/bleve/document"
"github.com/blevesearch/bleve/index"
"github.com/blevesearch/bleve/index/store/gtreap"
"github.com/blevesearch/bleve/index/upside_down"
"github.com/blevesearch/bleve/index/upsidedown"
"github.com/blevesearch/bleve/search"
)
func testDocIDSearcher(t *testing.T, indexed, searched, wanted []string) {
analysisQueue := index.NewAnalysisQueue(1)
i, err := upside_down.NewUpsideDownCouch(
i, err := upsidedown.NewUpsideDownCouch(
gtreap.Name,
map[string]interface{}{
"path": "",

View File

@ -16,7 +16,7 @@ import (
"github.com/blevesearch/bleve/document"
"github.com/blevesearch/bleve/index"
"github.com/blevesearch/bleve/index/store/gtreap"
"github.com/blevesearch/bleve/index/upside_down"
"github.com/blevesearch/bleve/index/upsidedown"
"github.com/blevesearch/bleve/search"
)
@ -28,7 +28,7 @@ func TestTermSearcher(t *testing.T) {
var queryExplain = true
analysisQueue := index.NewAnalysisQueue(1)
i, err := upside_down.NewUpsideDownCouch(
i, err := upsidedown.NewUpsideDownCouch(
gtreap.Name,
map[string]interface{}{
"path": "",