Skip to content

Commit

Permalink
test arm32 (#515)
Browse files Browse the repository at this point in the history
fix: arm 32 support
  • Loading branch information
hengfeiyang committed Sep 15, 2022
1 parent a47f4f5 commit 763711c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/bluge/search/search.go
Expand Up @@ -143,12 +143,12 @@ type Document struct {
}

type DocumentList struct {
docs []*Document
bucket *search.Bucket
from int64
size int64
len int64
next int64
docs []*Document
bucket *search.Bucket
sort search.SortOrder
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/core/index_shards.go
Expand Up @@ -45,13 +45,13 @@ const (
// then we will can not found the old document, maybe cause duplicate documents.
// First layer shard just used for distribute not really store documents.
type IndexShard struct {
open uint64
name string // shard name: index/shardID
root *Index
ref *meta.IndexShard
shards []*IndexSecondShard
wal *wal.Log
lock sync.RWMutex
open uint32
close chan struct{}
}

Expand Down Expand Up @@ -262,12 +262,12 @@ func (s *IndexShard) openWriter(shardID int64) error {
}

func (s *IndexShard) Close() error {
if atomic.LoadUint32(&s.open) == 0 {
if atomic.LoadUint64(&s.open) == 0 {
return nil
}

s.close <- struct{}{}
atomic.StoreUint32(&s.open, 0)
atomic.StoreUint64(&s.open, 0)

s.lock.Lock()
defer s.lock.Unlock()
Expand Down
4 changes: 2 additions & 2 deletions pkg/core/index_shards_wal.go
Expand Up @@ -37,7 +37,7 @@ const MaxBatchSize = 10240

// OpenWAL open WAL for index
func (s *IndexShard) OpenWAL() error {
if atomic.LoadUint32(&s.open) == 1 {
if atomic.LoadUint64(&s.open) == 1 {
return nil
}

Expand All @@ -57,7 +57,7 @@ func (s *IndexShard) OpenWAL() error {
s.lock.Unlock()

// set wal opened
atomic.StoreUint32(&s.open, 1)
atomic.StoreUint64(&s.open, 1)
s.close = make(chan struct{})

// check wal rollback
Expand Down
4 changes: 2 additions & 2 deletions pkg/meta/index.go
Expand Up @@ -16,20 +16,20 @@
package meta

type Index struct {
ShardNum int64 `json:"shard_num"`
Name string `json:"name"`
StorageType string `json:"storage_type"`
Settings *IndexSettings `json:"settings,omitempty"`
Mappings *Mappings `json:"mappings,omitempty"`
ShardNum int64 `json:"shard_num"`
Shards map[string]*IndexShard `json:"shards"`
Stats IndexStat `json:"stats"`
Version string `json:"version"`
}

type IndexShard struct {
ShardNum int64 `json:"shard_num"`
ID string `json:"id"`
NodeID string `json:"node_id"` // remote instance ID
ShardNum int64 `json:"shard_num"`
Shards []*IndexSecondShard `json:"shards"`
Stats IndexStat `json:"stats"`
}
Expand Down

0 comments on commit 763711c

Please sign in to comment.