mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-08 11:57:51 +00:00
Add darwin build to roaring-migrate-tool
This commit is contained in:
parent
f0b93da070
commit
feb8997ca8
3 changed files with 28 additions and 3 deletions
14
cmd/roaring-migrate/ctim_darwin.go
Normal file
14
cmd/roaring-migrate/ctim_darwin.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// +build darwin
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
func CTimeNano(stat *syscall.Stat_t) int64 {
|
||||
ts := stat.Ctimespec
|
||||
time.Unix(int64(ts.Sec), int64(ts.Nsec))
|
||||
return int64(ts.Sec)*1e9 + int64(ts.Nsec)
|
||||
}
|
||||
11
cmd/roaring-migrate/ctim_linux.go
Normal file
11
cmd/roaring-migrate/ctim_linux.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func CTimeNano(stat *syscall.Stat_t) int64 {
|
||||
return stat.Ctim.Nano()
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ import (
|
|||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/molecula/featurebase/v2"
|
||||
pilosa "github.com/molecula/featurebase/v2"
|
||||
"github.com/molecula/featurebase/v2/rbf"
|
||||
"github.com/molecula/featurebase/v2/rbf/cfg"
|
||||
"github.com/molecula/featurebase/v2/roaring"
|
||||
|
|
@ -148,7 +148,7 @@ func BuildSchema(dataDir string) ([]byte, error) {
|
|||
l = &local{
|
||||
Name: index,
|
||||
Fields: make([]*pilosa.FieldInfo, 0),
|
||||
CreatedAt: uint64(stat.Ctim.Nano()),
|
||||
CreatedAt: uint64(CTimeNano(stat)),
|
||||
Options: *io,
|
||||
}
|
||||
//index options
|
||||
|
|
@ -158,7 +158,7 @@ func BuildSchema(dataDir string) ([]byte, error) {
|
|||
|
||||
field := t[2]
|
||||
if field != "_exists" {
|
||||
fi, err := pilosa.UnmarshalFieldOptions(field, stat.Ctim.Nano(), content)
|
||||
fi, err := pilosa.UnmarshalFieldOptions(field, CTimeNano(stat), content)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue