From b06ecf33204647656bfa828e2f4f4ff2cdb07377 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Wed, 5 Aug 2015 22:50:38 -0600 Subject: [PATCH] Update import path This commit updates the import path from: ``` pilosa/* ``` to: ``` github.com/umbel/pilosa/* ``` This follows standard Go convention and makes the project "go gettable". The README was also updated to reflect the changes. --- .gitignore | 1 + README.md | 55 +++++- commands/pilosa-loader/loader.go | 101 ---------- commands/pilosa-nexter/nexter.go | 187 ------------------ .../cruncher.go => pilosa/main.go} | 15 +- config/config.go | 2 +- config/config_test.go | 1 + core/batch.go | 5 +- core/etcd.go | 8 +- core/http.go | 13 +- core/load.go | 3 +- core/ping.go | 5 +- core/query.go | 10 +- core/remotebits.go | 6 +- core/service.go | 15 +- core/topn.go | 10 +- cruncher/cruncher.go | 8 +- db/db.go | 3 +- db/topology.go | 6 +- db/topology_test.go | 2 +- deps.json | 6 +- dispatch/dispatch.go | 7 +- executor/executor.go | 11 +- executor/utils.go | 2 +- hold/hold.go | 5 +- hold/hold_test.go | 2 +- index/bitmap.go | 2 +- index/bitmap_test.go | 5 - index/brand.go | 19 +- index/brand_test.go | 4 - index/commands.go | 3 +- index/fragment_container.go | 7 +- index/fragment_container_test.go | 5 +- index/general.go | 6 +- index/storage_cass.go | 8 +- index/storage_leveldb.go | 5 +- index/storage_test.go | 3 - interfaces/core.go | 4 +- query/lexer.go | 3 +- query/lexer_test.go | 1 + query/parser.go | 6 +- query/planner.go | 8 +- query/planner_test.go | 4 +- query/query.go | 7 +- query/query_test.go | 1 + transport/http.go | 3 +- transport/inproc.go | 1 - transport/tcp.go | 11 +- transport/transport.go | 1 - transport/transport_test.go | 20 -- util/id.go | 2 +- util/statd.go | 4 +- util/storage.go | 2 +- 53 files changed, 175 insertions(+), 459 deletions(-) create mode 100644 .gitignore delete mode 100644 commands/pilosa-loader/loader.go delete mode 100644 commands/pilosa-nexter/nexter.go rename commands/{pilosa-cruncher/cruncher.go => pilosa/main.go} (85%) delete mode 100644 transport/inproc.go delete mode 100644 transport/transport.go delete mode 100644 transport/transport_test.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..4d4ef0e36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +default.etcd/ diff --git a/README.md b/README.md index 5f9716a32..9dfcb19db 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,55 @@ # pilosa -requires etcd to be running on the local machine -https://github.com/coreos/etcd +Pilosa is a bitmap index database. -in order to build, just clone run depman in the project directory then launch with the following command line -PILOSA_CONFIG=default.yaml ../bin/pilosa-cruncher +## Getting Started -That assumes that cassandra and etcd are running locally and that cassandra keyspace pilosa has been setup as describe in the file -index/storage_cass.go +To download the source, run `go get`: -If you don't want backend storage you can comment out storage_backend in the yaml file and it will just operate out of memory +```sh +$ go get github.com/umbel/pilosa +``` + +You can update the dependencies to specific versions using [`depman`][depman]: + +```sh +$ go get github.com/vube/depman +``` + +And then run `depman` from the project directory: + +```sh +$ cd $GOPATH/src/github.com/umbel/pilosa +$ depman +``` + +Now you can install the `pilosa` binary: + +```sh +$ go install github.com/umbel/pilosa/... +``` + +Pilosa requires that [etcd][] is running locally for coordinating the cluster: + +```sh +# In another terminal window +$ etcd +``` + +Now run `pilosa` with the default configuration: + +```sh +PILOSA_CONFIG=default.yaml pilosa +``` + +This setup assumes that cassandra and etcd are running locally and that +cassandra keyspace pilosa has been setup as describe in the file +`index/storage_cass.go`. + +If you don't want backend storage you can comment out storage_backend in the +yaml file and it will just operate out of memory. + +[etcd]: https://github.com/coreos/etcd +[depman]: https://github.com/vube/depman diff --git a/commands/pilosa-loader/loader.go b/commands/pilosa-loader/loader.go deleted file mode 100644 index c9c3c96cb..000000000 --- a/commands/pilosa-loader/loader.go +++ /dev/null @@ -1,101 +0,0 @@ -package main - -import ( - "bufio" - "flag" - "fmt" - "io/ioutil" - "log" - "net/http" - "net/url" - "os" - "pilosa/db" - "pilosa/index" - "strconv" - "strings" -) - -func post(database, base_url, id, compressed_string, frame_type string, slice int) { - values := make(url.Values) - values.Set("db", database) - values.Set("id", id) - values.Set("frame", frame_type) - values.Set("slice", fmt.Sprintf("%d", slice)) - values.Set("bitmap", compressed_string) - r, err := http.PostForm(base_url, values) - if err != nil { - log.Printf("error posting stat to stathat: %s", err) - return - } - //body, _ := ioutil.ReadAll(r.Body) - ioutil.ReadAll(r.Body) - r.Body.Close() -} - -func Load(database, url, fullpath string, frame_type string) error { - f, err := os.Open(fullpath) - if err != nil { - fmt.Printf("error opening file: %v\n", err) - os.Exit(1) - } - r := bufio.NewReader(f) - line, e := Readln(r) - for e == nil { - recs := strings.Split(line, "|") - id := recs[0] - log.Println(id) - bm := index.NewBitmap() - slice := -1 - last_slice := -1 - for _, pid := range recs[1:] { - profile_id, _ := strconv.ParseUint(strings.TrimSpace(pid), 10, 64) - - if slice < 0 { - slice = db.GetSlice(profile_id) - last_slice = slice - } else { - slice = db.GetSlice(profile_id) - } - if last_slice != slice { - post(database, url, id, bm.ToCompressString(), frame_type, last_slice) - bm = index.NewBitmap() - last_slice = slice - } - - index.SetBit(bm, profile_id) - - } - if slice != -1 { - post(database, url, id, bm.ToCompressString(), frame_type, slice) - } - - line, e = Readln(r) - } - return nil -} - -// note, that variables are pointers -var database = flag.String("database", "main", "Database Name") -var host_port = flag.String("url", "127.0.0.1:15001", "pilosa point of entry host:port") -var file = flag.String("file", "input_file", "input file name") -var frame = flag.String("frame", "brand", "Fragment Type") - -func Readln(r *bufio.Reader) (string, error) { - var ( - isPrefix bool = true - err error = nil - line, ln []byte - ) - for isPrefix && err == nil { - line, isPrefix, err = r.ReadLine() - ln = append(ln, line...) - } - return string(ln), err -} - -func main() { - flag.Parse() - full_url := fmt.Sprintf("http://%s/batch", *host_port) - //fun(*file) - Load(*database, full_url, *file, *frame) -} diff --git a/commands/pilosa-nexter/nexter.go b/commands/pilosa-nexter/nexter.go deleted file mode 100644 index 7f5df9ed7..000000000 --- a/commands/pilosa-nexter/nexter.go +++ /dev/null @@ -1,187 +0,0 @@ -package main - -import ( - "encoding/json" - "flag" - "fmt" - "log" - "net/http" - "os" - "strconv" - "strings" - - "github.com/cactus/go-statsd-client/statsd" - "github.com/coreos/go-etcd/etcd" -) - -type stringslice []string - -func (self *stringslice) String() string { - return fmt.Sprintf("%d", *self) -} - -func (self *stringslice) Set(value string) error { - *self = append(*self, value) - return nil -} - -var port uint -var blocksize uint64 -var etcd_nodes stringslice -var stats string -var logfile string - -func init() { - flag.UintVar(&port, "port", 9000, "Port to run HTTP server on") - flag.Uint64Var(&blocksize, "blocksize", 64, "Block size") - flag.Var(&etcd_nodes, "etcd", "Etcd server") - flag.StringVar(&stats, "statsd", "127.0.0.1:8125", "Statsd server") - flag.StringVar(&logfile, "log", "/tmp/nexter.log", "Log file name") - flag.Parse() -} - -type Req interface{} - -type IncReq struct { - id int - ret chan uint64 -} - -type DelReq struct { - id int -} - -type Nexter struct { - reqchan chan Req - done chan bool - stats *statsd.Client -} - -func (self *Nexter) countloop(ch chan uint64, id int, client *etcd.Client) { - var start uint64 - var end uint64 - path := "nexter/" + strconv.Itoa(id) - - for { - node, err := client.Get(path, false, false) - if err != nil { - ee, ok := err.(*etcd.EtcdError) - if ok && ee.ErrorCode == 100 { // node does not exist - _, err := client.Create(path, "0", 0) - if err != nil { - ee, ok := err.(*etcd.EtcdError) - // Catch race condition where another node did the same client.Create() - if ok && ee.ErrorCode == 105 { // Node has been created - continue - } else { - log.Fatal(err) - } - } - continue - } else { - log.Fatal(err) - } - } else { // No error, get start of series from etcd node - start, err = strconv.ParseUint(node.Node.Value, 10, 0) - if err != nil { - log.Fatal(err) - } - end = start + blocksize - } - _, err = client.CompareAndSwap(path, strconv.FormatUint(end, 10), 0, strconv.FormatUint(start, 10), 0) - if err != nil { - log.Println("CAS failure", path, start, end) - continue - } - self.stats.Gauge("nexter."+strconv.Itoa(id), int64(end), 1.0) - log.Println("Allocated", id, start, end) - for c := start; c < end; c += 1 { - ch <- c - log.Println("Send", id, c) - } - } -} - -func (self *Nexter) loop() { - counters := make(map[int]chan uint64) - client := etcd.NewClient(etcd_nodes) - for { - select { - case req := <-self.reqchan: - switch req.(type) { - case *IncReq: - countreq := req.(*IncReq) - counter, ok := counters[countreq.id] - if !ok { - counter = make(chan uint64) - counters[countreq.id] = counter - go self.countloop(counter, countreq.id, client) - } - go func() { countreq.ret <- <-counter }() - case *DelReq: - delreq := req.(*DelReq) - delete(counters, delreq.id) - path := "nexter/" + strconv.Itoa(delreq.id) - client.Delete(path, true) - default: - } - case <-self.done: - break - } - } -} - -func (self *Nexter) GetCount(id int) uint64 { - ret := make(chan uint64) - self.reqchan <- &IncReq{id, ret} - return <-ret -} -func (self *Nexter) Delete(id int) { - self.reqchan <- &DelReq{id} -} -func (self *Nexter) Stop() { - self.done <- true -} - -func NewNexter() (*Nexter, error) { - stats, err := statsd.New(stats, "") - if err != nil { - return nil, err - } - nexter := &Nexter{make(chan Req), make(chan bool), stats} - go nexter.loop() - return nexter, nil -} - -func main() { - logf, err := os.OpenFile(logfile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) - if err != nil { - log.Println("Error opening file: %v", err) - } - log.SetOutput(logf) - log.Println("Starting Nexter...") - nexter, err := NewNexter() - if err != nil { - log.Fatal(err) - } - http.HandleFunc("/nexter/", func(w http.ResponseWriter, r *http.Request) { - url := r.URL.Path - splits := strings.Split(url, "/") - if len(splits) < 3 { - http.Error(w, "Missing property id", http.StatusBadRequest) - return - } - id_string := splits[2] - id, err := strconv.Atoi(id_string) - if err != nil { - http.Error(w, "Property id is not a number", http.StatusBadRequest) - return - } - - num := nexter.GetCount(id) - dec := json.NewEncoder(w) - dec.Encode(num) - }) - port_string := strconv.FormatUint(uint64(port), 10) - http.ListenAndServe(":"+port_string, nil) -} diff --git a/commands/pilosa-cruncher/cruncher.go b/commands/pilosa/main.go similarity index 85% rename from commands/pilosa-cruncher/cruncher.go rename to commands/pilosa/main.go index f71adf9c5..510cfde05 100644 --- a/commands/pilosa-cruncher/cruncher.go +++ b/commands/pilosa/main.go @@ -2,15 +2,16 @@ package main import ( "flag" + "os" + "runtime/pprof" + log "github.com/cihub/seelog" "github.com/mitchellh/panicwrap" - "os" - "pilosa/config" - "pilosa/core" - "pilosa/cruncher" - "pilosa/index" - "pilosa/util" - "runtime/pprof" + "github.com/umbel/pilosa/config" + "github.com/umbel/pilosa/core" + "github.com/umbel/pilosa/cruncher" + "github.com/umbel/pilosa/index" + "github.com/umbel/pilosa/util" ) var ( diff --git a/config/config.go b/config/config.go index b0b7d8946..0c117428e 100644 --- a/config/config.go +++ b/config/config.go @@ -2,11 +2,11 @@ package config import ( "errors" - log "github.com/cihub/seelog" "io/ioutil" "os" "sync" + log "github.com/cihub/seelog" "launchpad.net/goyaml" ) diff --git a/config/config_test.go b/config/config_test.go index 967638791..695f06399 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -3,6 +3,7 @@ package config import ( "os" "testing" + . "github.com/smartystreets/goconvey/convey" ) diff --git a/core/batch.go b/core/batch.go index 31bb71e55..c577c407c 100644 --- a/core/batch.go +++ b/core/batch.go @@ -2,9 +2,10 @@ package core import ( "encoding/gob" + log "github.com/cihub/seelog" - "pilosa/db" - "pilosa/util" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/util" ) type BatchRequest struct { diff --git a/core/etcd.go b/core/etcd.go index 66f14ae1a..fb17685d0 100644 --- a/core/etcd.go +++ b/core/etcd.go @@ -3,19 +3,19 @@ package core import ( "errors" "fmt" - log "github.com/cihub/seelog" "os" - "pilosa/config" - "pilosa/db" - "pilosa/util" "runtime/debug" "sort" "strconv" "strings" "sync" + log "github.com/cihub/seelog" "github.com/coreos/go-etcd/etcd" "github.com/davecgh/go-spew/spew" + "github.com/umbel/pilosa/config" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/util" ) type TopologyMapper struct { diff --git a/core/http.go b/core/http.go index e9e740684..0ed9be6f7 100644 --- a/core/http.go +++ b/core/http.go @@ -8,25 +8,22 @@ import ( "encoding/json" "fmt" "io/ioutil" - //"log" - log "github.com/cihub/seelog" "net/http" "net/http/httputil" - "pilosa/config" - "pilosa/db" - "pilosa/index" - "pilosa/util" "reflect" "runtime" "strconv" "strings" - "time" notify "github.com/bitly/go-notify" + log "github.com/cihub/seelog" "github.com/davecgh/go-spew/spew" "github.com/gorilla/websocket" - // _ "net/http/pprof" + "github.com/umbel/pilosa/config" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/index" + "github.com/umbel/pilosa/util" ) type WebService struct { diff --git a/core/load.go b/core/load.go index 811259a2e..7a99e4f3e 100644 --- a/core/load.go +++ b/core/load.go @@ -8,8 +8,9 @@ import ( "encoding/base64" "encoding/binary" "errors" + log "github.com/cihub/seelog" - "pilosa/index" + "github.com/umbel/pilosa/index" ) func copy_raw(src [32]uint64) index.BlockArray { diff --git a/core/ping.go b/core/ping.go index 62fd3efb5..644788072 100644 --- a/core/ping.go +++ b/core/ping.go @@ -2,9 +2,10 @@ package core import ( "encoding/gob" - "pilosa/db" - "pilosa/util" "time" + + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/util" ) type PingRequest struct { diff --git a/core/query.go b/core/query.go index bb5964163..a54869673 100644 --- a/core/query.go +++ b/core/query.go @@ -1,14 +1,14 @@ package core import ( - log "github.com/cihub/seelog" - "pilosa/db" - "pilosa/index" - "pilosa/query" - "pilosa/util" "sort" + log "github.com/cihub/seelog" "github.com/davecgh/go-spew/spew" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/index" + "github.com/umbel/pilosa/query" + "github.com/umbel/pilosa/util" ) /* diff --git a/core/remotebits.go b/core/remotebits.go index bd1b75707..70e7be0fa 100644 --- a/core/remotebits.go +++ b/core/remotebits.go @@ -1,11 +1,11 @@ package core import ( - // "github.com/davecgh/go-spew/spew" "encoding/gob" + log "github.com/cihub/seelog" - "pilosa/db" - "pilosa/util" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/util" ) type RemoteSetBit struct { diff --git a/core/service.go b/core/service.go index d73f1348a..142d93774 100644 --- a/core/service.go +++ b/core/service.go @@ -2,19 +2,18 @@ package core import ( "fmt" - //"log" - log "github.com/cihub/seelog" "os" "os/signal" - "pilosa/config" - "pilosa/db" - "pilosa/hold" - "pilosa/index" - "pilosa/interfaces" - "pilosa/util" "syscall" + log "github.com/cihub/seelog" "github.com/coreos/go-etcd/etcd" + "github.com/umbel/pilosa/config" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/hold" + "github.com/umbel/pilosa/index" + "github.com/umbel/pilosa/interfaces" + "github.com/umbel/pilosa/util" ) type Service struct { diff --git a/core/topn.go b/core/topn.go index a0aee9b5c..c895b7132 100644 --- a/core/topn.go +++ b/core/topn.go @@ -2,13 +2,13 @@ package core import ( "encoding/gob" - log "github.com/cihub/seelog" - "pilosa/db" - "pilosa/index" - "pilosa/query" - "pilosa/util" + log "github.com/cihub/seelog" "github.com/davecgh/go-spew/spew" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/index" + "github.com/umbel/pilosa/query" + "github.com/umbel/pilosa/util" ) type Task struct { diff --git a/cruncher/cruncher.go b/cruncher/cruncher.go index 0ccc3f756..50349f9d7 100644 --- a/cruncher/cruncher.go +++ b/cruncher/cruncher.go @@ -1,10 +1,10 @@ package cruncher import ( - "pilosa/core" - "pilosa/dispatch" - "pilosa/executor" - "pilosa/transport" + "github.com/umbel/pilosa/core" + "github.com/umbel/pilosa/dispatch" + "github.com/umbel/pilosa/executor" + "github.com/umbel/pilosa/transport" ) type Cruncher struct { diff --git a/db/db.go b/db/db.go index 11489b0e9..cde9fa215 100644 --- a/db/db.go +++ b/db/db.go @@ -2,7 +2,8 @@ package db import ( "encoding/gob" - . "pilosa/util" + + . "github.com/umbel/pilosa/util" ) type Message struct { diff --git a/db/topology.go b/db/topology.go index e5e1e5456..b343b2444 100644 --- a/db/topology.go +++ b/db/topology.go @@ -3,12 +3,12 @@ package db import ( "errors" "fmt" - log "github.com/cihub/seelog" - "pilosa/config" - "pilosa/util" "sync" + log "github.com/cihub/seelog" "github.com/stathat/consistent" + "github.com/umbel/pilosa/config" + "github.com/umbel/pilosa/util" ) var FrameDoesNotExistError = errors.New("Frame does not exist.") diff --git a/db/topology_test.go b/db/topology_test.go index 2367d1ea1..fe4bd70ee 100644 --- a/db/topology_test.go +++ b/db/topology_test.go @@ -2,11 +2,11 @@ package db import ( "log" - "pilosa/util" "testing" "github.com/davecgh/go-spew/spew" . "github.com/smartystreets/goconvey/convey" + "github.com/umbel/pilosa/util" ) func TestTopology(t *testing.T) { diff --git a/deps.json b/deps.json index 22ef96c74..b61836739 100644 --- a/deps.json +++ b/deps.json @@ -6,7 +6,7 @@ }, "etcd": { "repo": "github.com/coreos/go-etcd/etcd", - "version": "2af7a9525b09fb715b215a1fb852dd4814ef52b5", + "version": "9847b93751a5fbaf227b893d172cee0104ac6427", "type": "git" }, "gkvlite": { @@ -21,12 +21,12 @@ }, "gocql": { "repo": "github.com/gocql/gocql", - "version": "730396a4f658d3266f8b8be4fdaea06b6de92a82", + "version": "f8fb76bb772442ea938e4be46ab1666e542411a5", "type": "git" }, "goleveldb": { "repo": "github.com/syndtr/goleveldb/leveldb", - "version": "63c9e642efad852f49e20a6f90194cae112fd2ac", + "version": "183614d6b32571e867df4cf086f5480ceefbdfac", "type": "git" }, "google-crypto": { diff --git a/dispatch/dispatch.go b/dispatch/dispatch.go index b3cdabd5b..3c865971e 100644 --- a/dispatch/dispatch.go +++ b/dispatch/dispatch.go @@ -2,11 +2,10 @@ package dispatch import ( log "github.com/cihub/seelog" - "pilosa/core" - "pilosa/db" - "pilosa/query" - "github.com/davecgh/go-spew/spew" + "github.com/umbel/pilosa/core" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/query" ) type Dispatch struct { diff --git a/executor/executor.go b/executor/executor.go index 770aeb5b9..26b0b4e57 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -2,13 +2,12 @@ package executor import ( log "github.com/cihub/seelog" - "pilosa/config" - "pilosa/core" - "pilosa/db" - "pilosa/query" - "pilosa/util" - "github.com/davecgh/go-spew/spew" + "github.com/umbel/pilosa/config" + "github.com/umbel/pilosa/core" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/query" + "github.com/umbel/pilosa/util" ) type Executor struct { diff --git a/executor/utils.go b/executor/utils.go index a1fdf0af0..1acc44530 100644 --- a/executor/utils.go +++ b/executor/utils.go @@ -3,11 +3,11 @@ package executor import ( "bytes" "io/ioutil" - "pilosa/query" "strings" "github.com/davecgh/go-spew/spew" "github.com/robertkrimen/otto" + "github.com/umbel/pilosa/query" ) func GetPlugin(file_name string, filter string, filters []string) interface{} { diff --git a/hold/hold.go b/hold/hold.go index 2dd94bebd..65154eacb 100644 --- a/hold/hold.go +++ b/hold/hold.go @@ -2,9 +2,10 @@ package hold import ( "errors" - log "github.com/cihub/seelog" - . "pilosa/util" "time" + + log "github.com/cihub/seelog" + . "github.com/umbel/pilosa/util" ) type holdchan chan interface{} diff --git a/hold/hold_test.go b/hold/hold_test.go index c0dea289b..ffe83929d 100644 --- a/hold/hold_test.go +++ b/hold/hold_test.go @@ -1,11 +1,11 @@ package hold import ( - "pilosa/util" "testing" "time" . "github.com/smartystreets/goconvey/convey" + "github.com/umbel/pilosa/util" ) func TestHoldChan(t *testing.T) { diff --git a/index/bitmap.go b/index/bitmap.go index 31d7ed148..a3b002fb2 100644 --- a/index/bitmap.go +++ b/index/bitmap.go @@ -8,9 +8,9 @@ import ( "encoding/base64" "encoding/binary" "encoding/gob" - log "github.com/cihub/seelog" "io/ioutil" + log "github.com/cihub/seelog" "github.com/yasushi-saito/rbtree" ) diff --git a/index/bitmap_test.go b/index/bitmap_test.go index 3216efb9b..e242ad2e0 100644 --- a/index/bitmap_test.go +++ b/index/bitmap_test.go @@ -1,12 +1,7 @@ package index import ( - // "fmt" - // "math/rand" "testing" - // "time" - - // . "github.com/smartystreets/goconvey/convey" ) func TestBitmaps(t *testing.T) { diff --git a/index/brand.go b/index/brand.go index aef2add23..afd16186a 100644 --- a/index/brand.go +++ b/index/brand.go @@ -1,20 +1,17 @@ package index -import ( - "math/rand" - "sync" - "time" - - _ "github.com/go-sql-driver/mysql" -) - import ( "encoding/json" "fmt" - log "github.com/cihub/seelog" - "pilosa/config" - "pilosa/util" + "math/rand" "sort" + "sync" + "time" + + log "github.com/cihub/seelog" + _ "github.com/go-sql-driver/mysql" + "github.com/umbel/pilosa/config" + "github.com/umbel/pilosa/util" ) var globalLock *sync.Mutex diff --git a/index/brand_test.go b/index/brand_test.go index b039fbff3..aaf3ecf80 100644 --- a/index/brand_test.go +++ b/index/brand_test.go @@ -1,12 +1,8 @@ package index import ( - // "fmt" "math/rand" "testing" - // "time" - - // . "github.com/smartystreets/goconvey/convey" ) var ( diff --git a/index/commands.go b/index/commands.go index 09f4a7e72..8f1c6baf2 100644 --- a/index/commands.go +++ b/index/commands.go @@ -3,9 +3,10 @@ package index import ( "bytes" "compress/gzip" - log "github.com/cihub/seelog" "io/ioutil" "time" + + log "github.com/cihub/seelog" ) type Result struct { diff --git a/index/fragment_container.go b/index/fragment_container.go index 6a63dad2f..f757f7830 100644 --- a/index/fragment_container.go +++ b/index/fragment_container.go @@ -2,20 +2,19 @@ package index import ( "database/sql" - "encoding/gob" "errors" "fmt" - log "github.com/cihub/seelog" - "pilosa/config" - "pilosa/util" "strings" "sync" "syscall" "time" + log "github.com/cihub/seelog" _ "github.com/go-sql-driver/mysql" "github.com/golang/groupcache/lru" + "github.com/umbel/pilosa/config" + "github.com/umbel/pilosa/util" ) type FragmentContainer struct { diff --git a/index/fragment_container_test.go b/index/fragment_container_test.go index 0c04f5030..f19d0dda9 100644 --- a/index/fragment_container_test.go +++ b/index/fragment_container_test.go @@ -3,11 +3,8 @@ package index import ( "testing" - // "io/ioutil" - // "time" - "pilosa/util" - . "github.com/smartystreets/goconvey/convey" + "github.com/umbel/pilosa/util" ) func TestFragment(t *testing.T) { diff --git a/index/general.go b/index/general.go index 24c92dde9..73d767838 100644 --- a/index/general.go +++ b/index/general.go @@ -3,11 +3,11 @@ package index import ( "encoding/json" "fmt" - log "github.com/cihub/seelog" - "pilosa/config" - "pilosa/util" + log "github.com/cihub/seelog" "github.com/golang/groupcache/lru" + "github.com/umbel/pilosa/config" + "github.com/umbel/pilosa/util" ) type General struct { diff --git a/index/storage_cass.go b/index/storage_cass.go index 272fa82de..edf7b27ae 100644 --- a/index/storage_cass.go +++ b/index/storage_cass.go @@ -3,14 +3,12 @@ package index // #cgo CFLAGS:-mpopcnt import ( - log "github.com/cihub/seelog" - "pilosa/config" - "pilosa/util" - - //"sync/atomic" "time" + log "github.com/cihub/seelog" "github.com/gocql/gocql" + "github.com/umbel/pilosa/config" + "github.com/umbel/pilosa/util" ) type CassandraStorage struct { diff --git a/index/storage_leveldb.go b/index/storage_leveldb.go index d08115803..579a5578d 100644 --- a/index/storage_leveldb.go +++ b/index/storage_leveldb.go @@ -6,12 +6,11 @@ import ( "bytes" "encoding/binary" "log" - "pilosa/util" + "time" "github.com/syndtr/goleveldb/leveldb" . "github.com/syndtr/goleveldb/leveldb/util" - - "time" + "github.com/umbel/pilosa/util" ) type LevelDBStorage struct { diff --git a/index/storage_test.go b/index/storage_test.go index 78fe1cf01..b099d3c83 100644 --- a/index/storage_test.go +++ b/index/storage_test.go @@ -6,9 +6,6 @@ import ( "testing" "time" - // "io/ioutil" - // "time" - . "github.com/smartystreets/goconvey/convey" ) diff --git a/interfaces/core.go b/interfaces/core.go index 87e2e6b03..1922b7025 100644 --- a/interfaces/core.go +++ b/interfaces/core.go @@ -1,8 +1,8 @@ package interfaces import ( - "pilosa/db" - "pilosa/util" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/util" ) type Transporter interface { diff --git a/query/lexer.go b/query/lexer.go index ffe95d177..7ac91396d 100644 --- a/query/lexer.go +++ b/query/lexer.go @@ -3,10 +3,11 @@ package query import ( "errors" "fmt" - log "github.com/cihub/seelog" "strings" "unicode" "unicode/utf8" + + log "github.com/cihub/seelog" ) const ( diff --git a/query/lexer_test.go b/query/lexer_test.go index 2c0118850..bf845eedf 100644 --- a/query/lexer_test.go +++ b/query/lexer_test.go @@ -2,6 +2,7 @@ package query import ( "testing" + . "github.com/smartystreets/goconvey/convey" ) diff --git a/query/parser.go b/query/parser.go index 75b7a93c2..a18bf51cd 100644 --- a/query/parser.go +++ b/query/parser.go @@ -3,13 +3,13 @@ package query import ( "errors" "fmt" - log "github.com/cihub/seelog" - "pilosa/index" - "pilosa/util" "strconv" "time" + log "github.com/cihub/seelog" "github.com/davecgh/go-spew/spew" + "github.com/umbel/pilosa/index" + "github.com/umbel/pilosa/util" ) var InvalidQueryError = errors.New("Invalid query format.") diff --git a/query/planner.go b/query/planner.go index b5ef01f5a..ef1294f8c 100644 --- a/query/planner.go +++ b/query/planner.go @@ -4,14 +4,14 @@ import ( "encoding/gob" "errors" "fmt" - log "github.com/cihub/seelog" "math/rand" - "pilosa/db" - "pilosa/index" - "pilosa/util" "time" + log "github.com/cihub/seelog" "github.com/davecgh/go-spew/spew" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/index" + "github.com/umbel/pilosa/util" ) type PortableQueryStep interface { diff --git a/query/planner_test.go b/query/planner_test.go index 1ffe6ec2d..e2cfc8e82 100644 --- a/query/planner_test.go +++ b/query/planner_test.go @@ -2,12 +2,12 @@ package query import ( "log" - "pilosa/db" - "pilosa/util" "testing" "github.com/davecgh/go-spew/spew" . "github.com/smartystreets/goconvey/convey" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/util" ) func basic_database() (*db.Database, *db.Fragment) { diff --git a/query/query.go b/query/query.go index aa7a7819a..dbc39e7ce 100644 --- a/query/query.go +++ b/query/query.go @@ -1,10 +1,11 @@ package query import ( - log "github.com/cihub/seelog" - "pilosa/db" - "pilosa/util" "strings" + + log "github.com/cihub/seelog" + "github.com/umbel/pilosa/db" + "github.com/umbel/pilosa/util" ) type QueryInput interface{} diff --git a/query/query_test.go b/query/query_test.go index 38eb53caa..8e1fa5ec5 100644 --- a/query/query_test.go +++ b/query/query_test.go @@ -2,6 +2,7 @@ package query import ( "testing" + . "github.com/smartystreets/goconvey/convey" ) diff --git a/transport/http.go b/transport/http.go index f9504f2a9..dc62e3ed4 100644 --- a/transport/http.go +++ b/transport/http.go @@ -2,7 +2,8 @@ package transport import ( "log" - "pilosa/db" + + "github.com/umbel/pilosa/db" ) type HttpTransport struct { diff --git a/transport/inproc.go b/transport/inproc.go deleted file mode 100644 index d11d0be55..000000000 --- a/transport/inproc.go +++ /dev/null @@ -1 +0,0 @@ -package transport diff --git a/transport/tcp.go b/transport/tcp.go index dcaccddb6..248579a76 100644 --- a/transport/tcp.go +++ b/transport/tcp.go @@ -3,17 +3,16 @@ package transport import ( "encoding/gob" "fmt" - log "github.com/cihub/seelog" "net" "os" - "pilosa/config" - "pilosa/core" - "pilosa/db" - . "pilosa/util" - "time" notify "github.com/bitly/go-notify" + log "github.com/cihub/seelog" + "github.com/umbel/pilosa/config" + "github.com/umbel/pilosa/core" + "github.com/umbel/pilosa/db" + . "github.com/umbel/pilosa/util" ) type connection struct { diff --git a/transport/transport.go b/transport/transport.go deleted file mode 100644 index d11d0be55..000000000 --- a/transport/transport.go +++ /dev/null @@ -1 +0,0 @@ -package transport diff --git a/transport/transport_test.go b/transport/transport_test.go deleted file mode 100644 index d2378ceb8..000000000 --- a/transport/transport_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package transport - -import ( - "testing" - //"pilosa/db" - . "github.com/smartystreets/goconvey/convey" -) - -func TestHttpTransport(t *testing.T) { - Convey("Test HTTP transport", t, func() { - /* - var com Transporter - com = NewHttpTransport(9009) - com.Init() - com.Send("derp", &db.Message{"derp", 42, db.Location{}}) - com.Close() - So(1, ShouldEqual, 1) - */ - }) -} diff --git a/util/id.go b/util/id.go index 4c46eaf81..109ff6a69 100644 --- a/util/id.go +++ b/util/id.go @@ -5,12 +5,12 @@ import ( "encoding/binary" "encoding/hex" "fmt" - log "github.com/cihub/seelog" "math/rand" "os" "strings" "time" + log "github.com/cihub/seelog" "github.com/gocql/gocql" ) diff --git a/util/statd.go b/util/statd.go index 9a836d176..bb4bb2481 100644 --- a/util/statd.go +++ b/util/statd.go @@ -1,11 +1,11 @@ package util import ( - log "github.com/cihub/seelog" - "pilosa/config" "time" "github.com/cactus/go-statsd-client/statsd" + log "github.com/cihub/seelog" + "github.com/umbel/pilosa/config" ) type args struct { diff --git a/util/storage.go b/util/storage.go index 21cfac17e..1a766fd86 100644 --- a/util/storage.go +++ b/util/storage.go @@ -3,10 +3,10 @@ package util import ( "io" "os" - "pilosa/config" "strings" "github.com/kr/s3/s3util" + "github.com/umbel/pilosa/config" ) func setup_storage() {