mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-12 07:41:02 +00:00
Merge pull request #1719 from 54mir/54mir/log-roaring-migrate
CORE-874 Add darwin build to roaring-migrate-tool
This commit is contained in:
commit
231e11ffe8
3 changed files with 55 additions and 3 deletions
27
cmd/roaring-migrate/ctim_darwin.go
Normal file
27
cmd/roaring-migrate/ctim_darwin.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build darwin
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func CTimeNano(stat *syscall.Stat_t) int64 {
|
||||
NANOS := int64(1e9) // number of nanosecs in 1 sec
|
||||
ts := stat.Ctimespec
|
||||
return ts.Sec*NANOS + ts.Nsec
|
||||
}
|
||||
25
cmd/roaring-migrate/ctim_linux.go
Normal file
25
cmd/roaring-migrate/ctim_linux.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +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