forked from mirror/ledisdb
upd
This commit is contained in:
parent
d35789ec47
commit
2ff8098b91
|
@ -22,7 +22,7 @@ This document explains how to contribute changes to the Ledisdb project.
|
||||||
Please search the issues on the issue tracker with a variety of keywords
|
Please search the issues on the issue tracker with a variety of keywords
|
||||||
to ensure your bug is not already reported.
|
to ensure your bug is not already reported.
|
||||||
|
|
||||||
If unique, [open an issue](https://github.com/ledisdb/ledisdb/issues/new)
|
If unique, [open an issue](https://git.internal/re/ledisdb/issues/new)
|
||||||
and answer the questions so we can understand and reproduce the
|
and answer the questions so we can understand and reproduce the
|
||||||
problematic behavior.
|
problematic behavior.
|
||||||
|
|
||||||
|
|
10
Dockerfile
10
Dockerfile
|
@ -23,16 +23,16 @@ RUN apt-get update && \
|
||||||
libgflags-dev
|
libgflags-dev
|
||||||
|
|
||||||
# get LedisDB
|
# get LedisDB
|
||||||
RUN wget -O ledisdb-src.tar.gz "https://github.com/ledisdb/ledisdb/archive/v$LEDISDB_VERSION.tar.gz" && \
|
RUN wget -O ledisdb-src.tar.gz "https://git.internal/re/ledisdb/archive/v$LEDISDB_VERSION.tar.gz" && \
|
||||||
tar -zxf ledisdb-src.tar.gz && \
|
tar -zxf ledisdb-src.tar.gz && \
|
||||||
mkdir -p /go/src/github.com/ledisdb/ && \
|
mkdir -p /go/src/github.com/ledisdb/ && \
|
||||||
mv ledisdb-$LEDISDB_VERSION /go/src/github.com/ledisdb/ledisdb
|
mv ledisdb-$LEDISDB_VERSION /go/src/git.internal/re/ledisdb
|
||||||
|
|
||||||
# build LevelDB
|
# build LevelDB
|
||||||
RUN wget -O leveldb-src.tar.gz "https://github.com/google/leveldb/archive/$LEVELDB_VERSION.tar.gz" && \
|
RUN wget -O leveldb-src.tar.gz "https://github.com/google/leveldb/archive/$LEVELDB_VERSION.tar.gz" && \
|
||||||
tar -zxf leveldb-src.tar.gz && \
|
tar -zxf leveldb-src.tar.gz && \
|
||||||
cd leveldb-$LEVELDB_VERSION && \
|
cd leveldb-$LEVELDB_VERSION && \
|
||||||
patch -p0 < /go/src/github.com/ledisdb/ledisdb/tools/leveldb.patch && \
|
patch -p0 < /go/src/git.internal/re/ledisdb/tools/leveldb.patch && \
|
||||||
mkdir -p out-shared/db && \
|
mkdir -p out-shared/db && \
|
||||||
make -j "$(nproc)" && \
|
make -j "$(nproc)" && \
|
||||||
mkdir /build/lib && \
|
mkdir /build/lib && \
|
||||||
|
@ -59,7 +59,7 @@ RUN export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/build/lib:/usr/lib && \
|
||||||
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/build/lib:/usr/lib && \
|
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/build/lib:/usr/lib && \
|
||||||
mkdir -p /build/bin && \
|
mkdir -p /build/bin && \
|
||||||
rm -rf /build/bin/* && \
|
rm -rf /build/bin/* && \
|
||||||
cd /go/src/github.com/ledisdb/ledisdb && \
|
cd /go/src/git.internal/re/ledisdb && \
|
||||||
GOGC=off go build -i -o /build/bin/ledis-server -tags "snappy leveldb rocksdb" cmd/ledis-server/* && \
|
GOGC=off go build -i -o /build/bin/ledis-server -tags "snappy leveldb rocksdb" cmd/ledis-server/* && \
|
||||||
GOGC=off go build -i -o /build/bin/ledis-cli -tags "snappy leveldb rocksdb" cmd/ledis-cli/* && \
|
GOGC=off go build -i -o /build/bin/ledis-cli -tags "snappy leveldb rocksdb" cmd/ledis-cli/* && \
|
||||||
GOGC=off go build -i -o /build/bin/ledis-benchmark -tags "snappy leveldb rocksdb" cmd/ledis-benchmark/* && \
|
GOGC=off go build -i -o /build/bin/ledis-benchmark -tags "snappy leveldb rocksdb" cmd/ledis-benchmark/* && \
|
||||||
|
@ -84,7 +84,7 @@ FROM debian:stretch-slim
|
||||||
|
|
||||||
COPY --from=builder /build/lib/* /usr/lib/
|
COPY --from=builder /build/lib/* /usr/lib/
|
||||||
COPY --from=builder /build/bin/ledis-* /bin/
|
COPY --from=builder /build/bin/ledis-* /bin/
|
||||||
COPY --from=builder /go/src/github.com/ledisdb/ledisdb/config/config-docker.toml /config.toml
|
COPY --from=builder /go/src/git.internal/re/ledisdb/config/config-docker.toml /config.toml
|
||||||
COPY --from=builder /usr/local/bin/gosu /bin/
|
COPY --from=builder /usr/local/bin/gosu /bin/
|
||||||
|
|
||||||
RUN groupadd -r ledis && \
|
RUN groupadd -r ledis && \
|
||||||
|
|
18
README.md
18
README.md
|
@ -1,6 +1,6 @@
|
||||||
# LedisDB
|
# LedisDB
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/ledisdb/ledisdb.svg?branch=develop)](https://travis-ci.org/ledisdb/ledisdb) [![codecov](https://codecov.io/gh/ledisdb/ledisdb/branch/master/graph/badge.svg)](https://codecov.io/gh/ledisdb/ledisdb) [![goreportcard](https://goreportcard.com/badge/github.com/ledisdb/ledisdb)](https://goreportcard.com/report/github.com/ledisdb/ledisdb)
|
[![Build Status](https://travis-ci.org/ledisdb/ledisdb.svg?branch=develop)](https://travis-ci.org/ledisdb/ledisdb) [![codecov](https://codecov.io/gh/ledisdb/ledisdb/branch/master/graph/badge.svg)](https://codecov.io/gh/ledisdb/ledisdb) [![goreportcard](https://goreportcard.com/badge/git.internal/re/ledisdb)](https://goreportcard.com/report/git.internal/re/ledisdb)
|
||||||
|
|
||||||
Ledisdb is a high-performance NoSQL database library and server written in [Go](http://golang.org). It's similar to Redis but store data in disk. It supports many data structures including kv, list, hash, zset, set.
|
Ledisdb is a high-performance NoSQL database library and server written in [Go](http://golang.org). It's similar to Redis but store data in disk. It supports many data structures including kv, list, hash, zset, set.
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ Then you will find all the binary build on `./bin` directory.
|
||||||
|
|
||||||
It will install leveldb at /usr/local/leveldb and snappy at /usr/local/snappy by default.
|
It will install leveldb at /usr/local/leveldb and snappy at /usr/local/snappy by default.
|
||||||
|
|
||||||
LedisDB uses the modified LevelDB for better performance. [Details.](https://github.com/ledisdb/ledisdb/wiki/leveldb-source-modification)
|
LedisDB uses the modified LevelDB for better performance. [Details.](https://git.internal/re/ledisdb/wiki/leveldb-source-modification)
|
||||||
|
|
||||||
You can easily use other LevelDB versions (like Hyper LevelDB or Basho LevelDB) instead, as long as the header files are in `include/leveldb`, not `include/hyperleveldb` or any other location.
|
You can easily use other LevelDB versions (like Hyper LevelDB or Basho LevelDB) instead, as long as the header files are in `include/leveldb`, not `include/hyperleveldb` or any other location.
|
||||||
|
|
||||||
|
@ -123,8 +123,8 @@ curl http://127.0.0.1:11181/0/GET/hello?type=json
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
lediscfg "github.com/ledisdb/ledisdb/config"
|
lediscfg "git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Use Ledis's default config
|
# Use Ledis's default config
|
||||||
|
@ -158,21 +158,21 @@ See [CONTRIBUTING.md] .
|
||||||
|
|
||||||
## Benchmark
|
## Benchmark
|
||||||
|
|
||||||
See [benchmark](https://github.com/ledisdb/ledisdb/wiki/Benchmark) for more.
|
See [benchmark](https://git.internal/re/ledisdb/wiki/Benchmark) for more.
|
||||||
|
|
||||||
## Todo
|
## Todo
|
||||||
|
|
||||||
See [Issues todo](https://github.com/ledisdb/ledisdb/issues?labels=todo&page=1&state=open)
|
See [Issues todo](https://git.internal/re/ledisdb/issues?labels=todo&page=1&state=open)
|
||||||
|
|
||||||
## Client
|
## Client
|
||||||
|
|
||||||
See [Clients](https://github.com/ledisdb/ledisdb/wiki/Clients) to find or contribute LedisDB client.
|
See [Clients](https://git.internal/re/ledisdb/wiki/Clients) to find or contribute LedisDB client.
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
+ [Official Website](https://ledisdb.io)
|
+ [Official Website](https://ledisdb.io)
|
||||||
+ [GoDoc](https://godoc.org/github.com/ledisdb/ledisdb)
|
+ [GoDoc](https://godoc.org/git.internal/re/ledisdb)
|
||||||
+ [Server Commands](https://github.com/ledisdb/ledisdb/wiki/Commands)
|
+ [Server Commands](https://git.internal/re/ledisdb/wiki/Commands)
|
||||||
|
|
||||||
## Caveat
|
## Caveat
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/cmd"
|
"git.internal/re/ledisdb/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,7 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/cmd"
|
"git.internal/re/ledisdb/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,7 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/cmd"
|
"git.internal/re/ledisdb/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,7 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/cmd"
|
"git.internal/re/ledisdb/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,7 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/cmd"
|
"git.internal/re/ledisdb/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
|
|
||||||
_ "net/http/pprof"
|
_ "net/http/pprof"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/cmd"
|
"git.internal/re/ledisdb/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
|
|
||||||
_ "net/http/pprof"
|
_ "net/http/pprof"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/cmd"
|
"git.internal/re/ledisdb/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,8 +3,8 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Load() {
|
func Load() {
|
||||||
|
|
|
@ -5,9 +5,9 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
func RepairTTL() {
|
func RepairTTL() {
|
||||||
|
|
|
@ -3,8 +3,8 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Repair() {
|
func Repair() {
|
||||||
|
|
|
@ -11,8 +11,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/server"
|
"git.internal/re/ledisdb/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
var addr = flag.String("addr", "", "ledisdb listen address")
|
var addr = flag.String("addr", "", "ledisdb listen address")
|
||||||
|
|
2
dev.sh
2
dev.sh
|
@ -4,7 +4,7 @@ export LEDISTOP=$(pwd)
|
||||||
export LEDISROOT="${LEDISROOT:-${LEDISTOP/\/src\/github.com\/ledisdb\/ledisdb/}}"
|
export LEDISROOT="${LEDISROOT:-${LEDISTOP/\/src\/github.com\/ledisdb\/ledisdb/}}"
|
||||||
# LEDISTOP sanity check
|
# LEDISTOP sanity check
|
||||||
if [[ "$LEDISTOP" == "${LEDISTOP/\/src\/github.com\/ledisdb\/ledisdb/}" ]]; then
|
if [[ "$LEDISTOP" == "${LEDISTOP/\/src\/github.com\/ledisdb\/ledisdb/}" ]]; then
|
||||||
echo "WARNING: LEDISTOP($LEDISTOP) does not contain src/github.com/ledisdb/ledisdb"
|
echo "WARNING: LEDISTOP($LEDISTOP) does not contain src/git.internal/re/ledisdb"
|
||||||
false
|
false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -48,4 +48,4 @@ XSCAN type cursor [MATCH match] [COUNT count]
|
||||||
|
|
||||||
LedisDB supports `dump` to serialize the value with key, the data format is the same as Redis, so you can use it in Redis and vice versa.
|
LedisDB supports `dump` to serialize the value with key, the data format is the same as Redis, so you can use it in Redis and vice versa.
|
||||||
|
|
||||||
Of course, LedisDB has not implemented all APIs in Redis, you can see full commands in commands.json, commands.doc or [wiki](https://github.com/ledisdb/ledisdb/wiki/Commands).
|
Of course, LedisDB has not implemented all APIs in Redis, you can see full commands in commands.json, commands.doc or [wiki](https://git.internal/re/ledisdb/wiki/Commands).
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
||||||
module github.com/ledisdb/ledisdb
|
module git.internal/re/ledisdb
|
||||||
|
|
||||||
go 1.12
|
go 1.12
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ package ledis
|
||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/rpl"
|
"git.internal/re/ledisdb/rpl"
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
"github.com/siddontang/go/log"
|
"github.com/siddontang/go/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
"github.com/siddontang/go/snappy"
|
"github.com/siddontang/go/snappy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDump(t *testing.T) {
|
func TestDump(t *testing.T) {
|
||||||
|
|
|
@ -8,9 +8,9 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/rpl"
|
"git.internal/re/ledisdb/rpl"
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
"github.com/siddontang/go/filelock"
|
"github.com/siddontang/go/filelock"
|
||||||
"github.com/siddontang/go/log"
|
"github.com/siddontang/go/log"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ibucket interface {
|
type ibucket interface {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
var testLedis *Ledis
|
var testLedis *Ledis
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMigrate(t *testing.T) {
|
func TestMigrate(t *testing.T) {
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/rpl"
|
"git.internal/re/ledisdb/rpl"
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
"github.com/siddontang/go/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/go/snappy"
|
"github.com/siddontang/go/snappy"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
func checkLedisEqual(master *Ledis, slave *Ledis) error {
|
func checkLedisEqual(master *Ledis, slave *Ledis) error {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errDataType = errors.New("error data type")
|
var errDataType = errors.New("error data type")
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Limit is for sort.
|
// Limit is for sort.
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
"github.com/siddontang/go/num"
|
"github.com/siddontang/go/num"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
"github.com/siddontang/go/num"
|
"github.com/siddontang/go/num"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
"github.com/siddontang/go/hack"
|
"github.com/siddontang/go/hack"
|
||||||
"github.com/siddontang/go/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/go/num"
|
"github.com/siddontang/go/num"
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
"github.com/siddontang/go/hack"
|
"github.com/siddontang/go/hack"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
"github.com/siddontang/go/hack"
|
"github.com/siddontang/go/hack"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/siddontang/go/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/go/num"
|
"github.com/siddontang/go/num"
|
||||||
)
|
)
|
||||||
|
@ -38,7 +38,7 @@ const (
|
||||||
meta: log1 offset | log2 offset
|
meta: log1 offset | log2 offset
|
||||||
log offset: bigendian uint32 | bigendian uint32
|
log offset: bigendian uint32 | bigendian uint32
|
||||||
|
|
||||||
//sha1 of github.com/ledisdb/ledisdb 20 bytes
|
//sha1 of git.internal/re/ledisdb 20 bytes
|
||||||
magic data = "\x1c\x1d\xb8\x88\xff\x9e\x45\x55\x40\xf0\x4c\xda\xe0\xce\x47\xde\x65\x48\x71\x17"
|
magic data = "\x1c\x1d\xb8\x88\xff\x9e\x45\x55\x40\xf0\x4c\xda\xe0\xce\x47\xde\x65\x48\x71\x17"
|
||||||
|
|
||||||
we must guarantee that the log id is monotonic increment strictly.
|
we must guarantee that the log id is monotonic increment strictly.
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
"github.com/siddontang/go/num"
|
"github.com/siddontang/go/num"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/siddontang/go/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/go/snappy"
|
"github.com/siddontang/go/snappy"
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestReplication(t *testing.T) {
|
func TestReplication(t *testing.T) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGoLevelDBStore(t *testing.T) {
|
func TestGoLevelDBStore(t *testing.T) {
|
||||||
|
|
|
@ -12,8 +12,8 @@ import (
|
||||||
|
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/siddontang/goredis"
|
"github.com/siddontang/goredis"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/siddontang/goredis"
|
"github.com/siddontang/goredis"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/siddontang/go/sync2"
|
"github.com/siddontang/go/sync2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/siddontang/go/bson"
|
"github.com/siddontang/go/bson"
|
||||||
"github.com/siddontang/go/hack"
|
"github.com/siddontang/go/hack"
|
||||||
"github.com/siddontang/go/log"
|
"github.com/siddontang/go/log"
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/siddontang/go/hack"
|
"github.com/siddontang/go/hack"
|
||||||
"github.com/siddontang/go/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/go/num"
|
"github.com/siddontang/go/num"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
)
|
)
|
||||||
|
|
||||||
func hsetCommand(c *client) error {
|
func hsetCommand(c *client) error {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package server
|
||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
)
|
)
|
||||||
|
|
||||||
// func getCommand(c *client) error {
|
// func getCommand(c *client) error {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
|
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/siddontang/go/hack"
|
"github.com/siddontang/go/hack"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/siddontang/go/hack"
|
"github.com/siddontang/go/hack"
|
||||||
"github.com/siddontang/go/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/goredis"
|
"github.com/siddontang/goredis"
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/siddontang/goredis"
|
"github.com/siddontang/goredis"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/siddontang/go/hack"
|
"github.com/siddontang/go/hack"
|
||||||
"github.com/siddontang/go/num"
|
"github.com/siddontang/go/num"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/siddontang/goredis"
|
"github.com/siddontang/goredis"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/siddontang/go/hack"
|
"github.com/siddontang/go/hack"
|
||||||
"github.com/siddontang/go/num"
|
"github.com/siddontang/go/num"
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/siddontang/goredis"
|
"github.com/siddontang/goredis"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func pingCommand(c *client) error {
|
func pingCommand(c *client) error {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
)
|
)
|
||||||
|
|
||||||
func saddCommand(c *client) error {
|
func saddCommand(c *client) error {
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/ledisdb/ledisdb/store"
|
"git.internal/re/ledisdb/store"
|
||||||
"github.com/siddontang/go/hack"
|
"github.com/siddontang/go/hack"
|
||||||
"github.com/siddontang/go/num"
|
"github.com/siddontang/go/num"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,7 @@ package server
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/siddontang/go/sync2"
|
"github.com/siddontang/go/sync2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/ledisdb/ledisdb/rpl"
|
"git.internal/re/ledisdb/rpl"
|
||||||
"github.com/siddontang/go/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/go/num"
|
"github.com/siddontang/go/num"
|
||||||
"github.com/siddontang/go/sync2"
|
"github.com/siddontang/go/sync2"
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/ledis"
|
"git.internal/re/ledisdb/ledis"
|
||||||
"github.com/siddontang/go/hack"
|
"github.com/siddontang/go/hack"
|
||||||
"github.com/siddontang/go/num"
|
"github.com/siddontang/go/num"
|
||||||
lua "github.com/yuin/gopher-lua"
|
lua "github.com/yuin/gopher-lua"
|
||||||
|
|
|
@ -3,7 +3,7 @@ package server
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
lua "github.com/yuin/gopher-lua"
|
lua "github.com/yuin/gopher-lua"
|
||||||
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/siddontang/go/log"
|
"github.com/siddontang/go/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type testSnapshotDumper struct {
|
type testSnapshotDumper struct {
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DB struct {
|
type DB struct {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package driver
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Store interface {
|
type Store interface {
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"github.com/syndtr/goleveldb/leveldb/storage"
|
"github.com/syndtr/goleveldb/leveldb/storage"
|
||||||
"github.com/syndtr/goleveldb/leveldb/util"
|
"github.com/syndtr/goleveldb/leveldb/util"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
|
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package goleveldb
|
package goleveldb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
"github.com/syndtr/goleveldb/leveldb"
|
"github.com/syndtr/goleveldb/leveldb"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package store
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -15,8 +15,8 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultFilterBits int = 10
|
const defaultFilterBits int = 10
|
||||||
|
|
|
@ -7,7 +7,7 @@ package leveldb
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Snapshot struct {
|
type Snapshot struct {
|
||||||
|
|
|
@ -16,8 +16,8 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultFilterBits int = 10
|
const defaultFilterBits int = 10
|
||||||
|
|
|
@ -7,7 +7,7 @@ package rocksdb
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Snapshot struct {
|
type Snapshot struct {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package store
|
package store
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Slice interface {
|
type Slice interface {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package store
|
package store
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Snapshot struct {
|
type Snapshot struct {
|
||||||
|
|
|
@ -5,12 +5,12 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
|
|
||||||
_ "github.com/ledisdb/ledisdb/store/goleveldb" // register goleveldb
|
_ "git.internal/re/ledisdb/store/goleveldb" // register goleveldb
|
||||||
_ "github.com/ledisdb/ledisdb/store/leveldb" // register leveldb
|
_ "git.internal/re/ledisdb/store/leveldb" // register leveldb
|
||||||
_ "github.com/ledisdb/ledisdb/store/rocksdb" // register rocksdb
|
_ "git.internal/re/ledisdb/store/rocksdb" // register rocksdb
|
||||||
)
|
)
|
||||||
|
|
||||||
func getStorePath(cfg *config.Config) string {
|
func getStorePath(cfg *config.Config) string {
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/config"
|
"git.internal/re/ledisdb/config"
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestStore(t *testing.T) {
|
func TestStore(t *testing.T) {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package store
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledisdb/ledisdb/store/driver"
|
"git.internal/re/ledisdb/store/driver"
|
||||||
"github.com/syndtr/goleveldb/leveldb"
|
"github.com/syndtr/goleveldb/leveldb"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue