Method to identify injured segments to repair (#398)

* creates checker

* tests offline nodes

* test id injured segs:

* Adds healthy pieces to injured segment struct

* changes inequality

* creates common files

* adds checker benchmarking

* creates more common files

* Replaces pointedb direct db with api call to a new iterate method on pointerdb

* move monkit

* removes identifyrequest proto

* remove healthypieces

* adds benchmarking

creates common file for datarepair

* recreates proto file

* api key on ctx
This commit is contained in:
Jennifer Li Johnson 2018-10-09 12:09:33 -04:00 committed by GitHub
parent ad327bedb1
commit 6fb13896fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 555 additions and 130 deletions

BIN
big-upload-testfile Normal file

Binary file not shown.

View File

@ -7,17 +7,16 @@ import (
"context"
"time"
"github.com/zeebo/errs"
"github.com/golang/protobuf/proto"
"go.uber.org/zap"
monkit "gopkg.in/spacemonkeygo/monkit.v2"
"storj.io/storj/pkg/datarepair/queue"
"storj.io/storj/pkg/dht"
"storj.io/storj/pkg/node"
"storj.io/storj/pkg/pb"
"storj.io/storj/pkg/pointerdb"
"storj.io/storj/pkg/provider"
)
var (
mon = monkit.Package()
// Error is a standard error class for this package.
Error = errs.Class("checker error")
"storj.io/storj/storage"
)
// Config contains configurable values for checker
@ -51,3 +50,99 @@ func (c Config) Run(ctx context.Context, server *provider.Provider) (err error)
return server.Run(ctx)
}
// Checker contains the information needed to do checks for missing pieces
type Checker struct {
pointerdb *pointerdb.Server
repairQueue *queue.Queue
overlay pb.OverlayServer
limit int
logger *zap.Logger
}
// NewChecker creates a new instance of checker
func NewChecker(pointerdb *pointerdb.Server, repairQueue *queue.Queue, overlay pb.OverlayServer, limit int, logger *zap.Logger) *Checker {
return &Checker{
pointerdb: pointerdb,
repairQueue: repairQueue,
overlay: overlay,
limit: limit,
logger: logger,
}
}
// IdentifyInjuredSegments checks for missing pieces off of the pointerdb and overlay cache
func (c *Checker) IdentifyInjuredSegments(ctx context.Context) (err error) {
defer mon.Task()(&ctx)(&err)
c.logger.Debug("entering pointerdb iterate")
err = c.pointerdb.Iterate(ctx, &pb.IterateRequest{Recurse: true},
func(it storage.Iterator) error {
var item storage.ListItem
if c.limit <= 0 || c.limit > storage.LookupLimit {
c.limit = storage.LookupLimit
}
for ; c.limit > 0 && it.Next(&item); c.limit-- {
pointer := &pb.Pointer{}
err = proto.Unmarshal(item.Value, pointer)
if err != nil {
return Error.New("error unmarshalling pointer %s", err)
}
pieces := pointer.Remote.RemotePieces
var nodeIDs []dht.NodeID
for _, p := range pieces {
nodeIDs = append(nodeIDs, node.IDFromString(p.NodeId))
}
missingPieces, err := c.offlineNodes(ctx, nodeIDs)
if err != nil {
return Error.New("error getting missing offline nodes %s", err)
}
numHealthy := len(nodeIDs) - len(missingPieces)
if int32(numHealthy) < pointer.Remote.Redundancy.RepairThreshold {
err = c.repairQueue.Enqueue(&pb.InjuredSegment{
Path: string(item.Key),
LostPieces: missingPieces,
})
if err != nil {
return Error.New("error adding injured segment to queue %s", err)
}
}
}
return nil
},
)
return err
}
// returns the indices of offline and online nodes
func (c *Checker) offlineNodes(ctx context.Context, nodeIDs []dht.NodeID) (offline []int32, err error) {
responses, err := c.overlay.BulkLookup(ctx, nodeIDsToLookupRequests(nodeIDs))
if err != nil {
return []int32{}, err
}
nodes := lookupResponsesToNodes(responses)
for i, n := range nodes {
if n == nil {
offline = append(offline, int32(i))
}
}
return offline, nil
}
func nodeIDsToLookupRequests(nodeIDs []dht.NodeID) *pb.LookupRequests {
var rq []*pb.LookupRequest
for _, v := range nodeIDs {
r := &pb.LookupRequest{NodeID: v.String()}
rq = append(rq, r)
}
return &pb.LookupRequests{Lookuprequest: rq}
}
func lookupResponsesToNodes(responses *pb.LookupResponses) []*pb.Node {
var nodes []*pb.Node
for _, v := range responses.Lookupresponse {
n := v.Node
nodes = append(nodes, n)
}
return nodes
}

View File

@ -2,3 +2,217 @@
// See LICENSE for copying information.
package checker
import (
"context"
"math/rand"
"sort"
"strconv"
"testing"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"storj.io/storj/pkg/datarepair/queue"
"storj.io/storj/pkg/dht"
"storj.io/storj/pkg/node"
"storj.io/storj/pkg/overlay"
"storj.io/storj/pkg/overlay/mocks"
"storj.io/storj/pkg/pb"
"storj.io/storj/pkg/auth"
"storj.io/storj/pkg/pointerdb"
"storj.io/storj/storage/redis"
"storj.io/storj/storage/redis/redisserver"
"storj.io/storj/storage/teststore"
)
var ctx = context.Background()
func TestIdentifyInjuredSegments(t *testing.T) {
logger := zap.NewNop()
pointerdb := pointerdb.NewServer(teststore.New(), &overlay.Cache{}, logger, pointerdb.Config{})
repairQueue := queue.NewQueue(teststore.New())
const N = 25
nodes := []*pb.Node{}
segs := []*pb.InjuredSegment{}
//fill a pointerdb
for i := 0; i < N; i++ {
s := strconv.Itoa(i)
ids := []string{s + "a", s + "b", s + "c", s + "d"}
p := &pb.Pointer{
Remote: &pb.RemoteSegment{
Redundancy: &pb.RedundancyScheme{
RepairThreshold: int32(2),
},
PieceId: strconv.Itoa(i),
RemotePieces: []*pb.RemotePiece{
{PieceNum: 0, NodeId: ids[0]},
{PieceNum: 1, NodeId: ids[1]},
{PieceNum: 2, NodeId: ids[2]},
{PieceNum: 3, NodeId: ids[3]},
},
},
}
req := &pb.PutRequest{
Path: p.Remote.PieceId,
Pointer: p,
}
ctx = auth.WithAPIKey(ctx, nil)
resp, err := pointerdb.Put(ctx, req)
assert.NotNil(t, resp)
assert.NoError(t, err)
//nodes for cache
selection := rand.Intn(4)
for _, v := range ids[:selection] {
n := &pb.Node{Id: v, Address: &pb.NodeAddress{Address: v}}
nodes = append(nodes, n)
}
pieces := []int32{0, 1, 2, 3}
//expected injured segments
if len(ids[:selection]) < int(p.Remote.Redundancy.RepairThreshold) {
seg := &pb.InjuredSegment{
Path: p.Remote.PieceId,
LostPieces: pieces[selection:],
}
segs = append(segs, seg)
}
}
//fill a overlay cache
overlayServer := mocks.NewOverlay(nodes)
limit := 0
checker := NewChecker(pointerdb, repairQueue, overlayServer, limit, logger)
err := checker.IdentifyInjuredSegments(ctx)
assert.NoError(t, err)
//check if the expected segments were added to the queue
dequeued := []*pb.InjuredSegment{}
for i := 0; i < len(segs); i++ {
injSeg, err := repairQueue.Dequeue()
assert.NoError(t, err)
dequeued = append(dequeued, &injSeg)
}
sort.Slice(segs, func(i, k int) bool { return segs[i].Path < segs[k].Path })
sort.Slice(dequeued, func(i, k int) bool { return dequeued[i].Path < dequeued[k].Path })
for i := 0; i < len(segs); i++ {
assert.True(t, proto.Equal(segs[i], dequeued[i]))
}
}
func TestOfflineAndOnlineNodes(t *testing.T) {
logger := zap.NewNop()
pointerdb := pointerdb.NewServer(teststore.New(), &overlay.Cache{}, logger, pointerdb.Config{})
repairQueue := queue.NewQueue(teststore.New())
const N = 50
nodes := []*pb.Node{}
nodeIDs := []dht.NodeID{}
expectedOffline := []int32{}
for i := 0; i < N; i++ {
str := strconv.Itoa(i)
n := &pb.Node{Id: str, Address: &pb.NodeAddress{Address: str}}
nodes = append(nodes, n)
if i%(rand.Intn(5)+2) == 0 {
id := node.IDFromString("id" + str)
nodeIDs = append(nodeIDs, id)
expectedOffline = append(expectedOffline, int32(i))
} else {
id := node.IDFromString(str)
nodeIDs = append(nodeIDs, id)
}
}
overlayServer := mocks.NewOverlay(nodes)
limit := 0
checker := NewChecker(pointerdb, repairQueue, overlayServer, limit, logger)
offline, err := checker.offlineNodes(ctx, nodeIDs)
assert.NoError(t, err)
assert.Equal(t, expectedOffline, offline)
}
func BenchmarkIdentifyInjuredSegments(b *testing.B) {
logger := zap.NewNop()
pointerdb := pointerdb.NewServer(teststore.New(), &overlay.Cache{}, logger, pointerdb.Config{})
addr, cleanup, err := redisserver.Start()
defer cleanup()
assert.NoError(b, err)
client, err := redis.NewClient(addr, "", 1)
assert.NoError(b, err)
repairQueue := queue.NewQueue(client)
const N = 25
nodes := []*pb.Node{}
segs := []*pb.InjuredSegment{}
//fill a pointerdb
for i := 0; i < N; i++ {
s := strconv.Itoa(i)
ids := []string{s + "a", s + "b", s + "c", s + "d"}
p := &pb.Pointer{
Remote: &pb.RemoteSegment{
Redundancy: &pb.RedundancyScheme{
RepairThreshold: int32(2),
},
PieceId: strconv.Itoa(i),
RemotePieces: []*pb.RemotePiece{
{PieceNum: 0, NodeId: ids[0]},
{PieceNum: 1, NodeId: ids[1]},
{PieceNum: 2, NodeId: ids[2]},
{PieceNum: 3, NodeId: ids[3]},
},
},
}
req := &pb.PutRequest{
Path: p.Remote.PieceId,
Pointer: p,
}
ctx = auth.WithAPIKey(ctx, nil)
resp, err := pointerdb.Put(ctx, req)
assert.NotNil(b, resp)
assert.NoError(b, err)
//nodes for cache
selection := rand.Intn(4)
for _, v := range ids[:selection] {
n := &pb.Node{Id: v, Address: &pb.NodeAddress{Address: v}}
nodes = append(nodes, n)
}
pieces := []int32{0, 1, 2, 3}
//expected injured segments
if len(ids[:selection]) < int(p.Remote.Redundancy.RepairThreshold) {
seg := &pb.InjuredSegment{
Path: p.Remote.PieceId,
LostPieces: pieces[selection:],
}
segs = append(segs, seg)
}
}
//fill a overlay cache
overlayServer := mocks.NewOverlay(nodes)
limit := 0
b.ResetTimer()
for i := 0; i < b.N; i++ {
checker := NewChecker(pointerdb, repairQueue, overlayServer, limit, logger)
err = checker.IdentifyInjuredSegments(ctx)
assert.NoError(b, err)
//check if the expected segments were added to the queue
dequeued := []*pb.InjuredSegment{}
for i := 0; i < len(segs); i++ {
injSeg, err := repairQueue.Dequeue()
assert.NoError(b, err)
dequeued = append(dequeued, &injSeg)
}
sort.Slice(segs, func(i, k int) bool { return segs[i].Path < segs[k].Path })
sort.Slice(dequeued, func(i, k int) bool { return dequeued[i].Path < dequeued[k].Path })
for i := 0; i < len(segs); i++ {
assert.True(b, proto.Equal(segs[i], dequeued[i]))
}
}
}

View File

@ -0,0 +1,15 @@
// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package checker
import (
"github.com/zeebo/errs"
monkit "gopkg.in/spacemonkeygo/monkit.v2"
)
// Error is a standard error class for this package.
var (
Error = errs.Class("checker error")
mon = monkit.Package()
)

View File

@ -0,0 +1,11 @@
// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package queue
import (
"github.com/zeebo/errs"
)
// Error is a standard error class for this package.
var Error = errs.Class("queue error")

View File

@ -10,7 +10,6 @@ import (
"time"
"github.com/golang/protobuf/proto"
"github.com/zeebo/errs"
"storj.io/storj/pkg/pb"
"storj.io/storj/storage"
@ -28,10 +27,6 @@ type Queue struct {
db storage.KeyValueStore
}
var (
queueError = errs.Class("data repair queue error")
)
// NewQueue returns a pointer to a new Queue instance with an initialized connection to Redis
func NewQueue(client storage.KeyValueStore) *Queue {
return &Queue{
@ -44,21 +39,25 @@ func NewQueue(client storage.KeyValueStore) *Queue {
func (q *Queue) Enqueue(qi *pb.InjuredSegment) error {
q.mu.Lock()
defer q.mu.Unlock()
dateTime := make([]byte, binary.MaxVarintLen64)
const dateSize = 8
dateTime := make([]byte, dateSize)
// TODO: this can cause conflicts when time is unstable or running on multiple computers
// Append random 4 byte token to account for time conflicts
binary.BigEndian.PutUint64(dateTime, uint64(time.Now().UnixNano()))
const tokenSize = 4
token := make([]byte, tokenSize)
rand.Read(token)
_, err := rand.Read(token)
if err != nil {
return Error.New("error creating random token %s", err)
}
dateTime = append(dateTime, token...)
val, err := proto.Marshal(qi)
if err != nil {
return queueError.New("error marshalling injured seg %s", err)
return Error.New("error marshalling injured seg %s", err)
}
err = q.db.Put(dateTime, val)
if err != nil {
return queueError.New("error adding injured seg to queue %s", err)
return Error.New("error adding injured seg to queue %s", err)
}
return nil
}
@ -70,10 +69,10 @@ func (q *Queue) Dequeue() (pb.InjuredSegment, error) {
items, _, err := storage.ListV2(q.db, storage.ListOptions{IncludeValue: true, Limit: 1, Recursive: true})
if err != nil {
return pb.InjuredSegment{}, queueError.New("error getting first key %s", err)
return pb.InjuredSegment{}, Error.New("error getting first key %s", err)
}
if len(items) == 0 {
return pb.InjuredSegment{}, queueError.New("empty database")
return pb.InjuredSegment{}, Error.New("empty database")
}
key := items[0].Key
val := items[0].Value
@ -81,11 +80,11 @@ func (q *Queue) Dequeue() (pb.InjuredSegment, error) {
seg := &pb.InjuredSegment{}
err = proto.Unmarshal(val, seg)
if err != nil {
return pb.InjuredSegment{}, queueError.New("error unmarshalling segment %s", err)
return pb.InjuredSegment{}, Error.New("error unmarshalling segment %s", err)
}
err = q.db.Delete(key)
if err != nil {
return *seg, queueError.New("error removing injured seg %s", err)
return *seg, Error.New("error removing injured seg %s", err)
}
return *seg, nil
}

View File

@ -23,7 +23,7 @@ func TestEnqueueDequeue(t *testing.T) {
q := NewQueue(db)
seg := &pb.InjuredSegment{
Path: "abc",
LostPieces: []int32{},
LostPieces: []int32{int32(1), int32(3)},
}
err := q.Enqueue(seg)
assert.NoError(t, err)
@ -44,7 +44,7 @@ func TestDequeueEmptyQueue(t *testing.T) {
func TestForceError(t *testing.T) {
db := teststore.New()
q := NewQueue(db)
err := q.Enqueue(&pb.InjuredSegment{Path: "abc", LostPieces: []int32{}})
err := q.Enqueue(&pb.InjuredSegment{Path: "abc", LostPieces: []int32{int32(0)}})
assert.NoError(t, err)
db.ForceError++
item, err := q.Dequeue()

View File

@ -0,0 +1,15 @@
// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package repairer
import (
"github.com/zeebo/errs"
monkit "gopkg.in/spacemonkeygo/monkit.v2"
)
// Error is a standard error class for this package.
var (
Error = errs.Class("repairer error")
mon = monkit.Package()
)

View File

@ -9,22 +9,12 @@ import (
"sync"
"time"
"github.com/zeebo/errs"
"gopkg.in/spacemonkeygo/monkit.v2"
q "storj.io/storj/pkg/datarepair/queue"
"storj.io/storj/pkg/pb"
"storj.io/storj/pkg/provider"
"storj.io/storj/storage/redis"
)
var (
mon = monkit.Package()
// Error is a redis error
repairerError = errs.Class("repairer error")
)
// Repairer is the interface for the data repair queue
type Repairer interface {
Repair(seg *pb.InjuredSegment) error
@ -46,7 +36,7 @@ func (c Config) initialize(ctx context.Context) (Repairer, error) {
client, err := redis.NewClientFrom(c.QueueAddress)
if err != nil {
return nil, repairerError.Wrap(err)
return nil, Error.Wrap(err)
}
r.queue = q.NewQueue(client)

View File

@ -154,7 +154,7 @@ func (o *Server) populate(ctx context.Context, starting storage.Key, maxNodes, r
return result, nextStart, nil
}
//lookupRequestsToNodeIDs returns the nodeIDs from the LookupRequests
// lookupRequestsToNodeIDs returns the nodeIDs from the LookupRequests
func lookupRequestsToNodeIDs(reqs *pb.LookupRequests) []string {
var ids []string
for _, v := range reqs.Lookuprequest {
@ -163,7 +163,7 @@ func lookupRequestsToNodeIDs(reqs *pb.LookupRequests) []string {
return ids
}
//nodesToLookupResponses returns LookupResponses from the nodes
// nodesToLookupResponses returns LookupResponses from the nodes
func nodesToLookupResponses(nodes []*pb.Node) *pb.LookupResponses {
var rs []*pb.LookupResponse
for _, v := range nodes {

View File

@ -31,7 +31,7 @@ func (m *InjuredSegment) Reset() { *m = InjuredSegment{} }
func (m *InjuredSegment) String() string { return proto.CompactTextString(m) }
func (*InjuredSegment) ProtoMessage() {}
func (*InjuredSegment) Descriptor() ([]byte, []int) {
return fileDescriptor_datarepair_10779d2b80cbd5b3, []int{0}
return fileDescriptor_datarepair_13e4beab54f194bd, []int{0}
}
func (m *InjuredSegment) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_InjuredSegment.Unmarshal(m, b)
@ -66,19 +66,19 @@ func (m *InjuredSegment) GetLostPieces() []int32 {
}
func init() {
proto.RegisterType((*InjuredSegment)(nil), "pb.InjuredSegment")
proto.RegisterType((*InjuredSegment)(nil), "repair.InjuredSegment")
}
func init() { proto.RegisterFile("datarepair.proto", fileDescriptor_datarepair_10779d2b80cbd5b3) }
func init() { proto.RegisterFile("datarepair.proto", fileDescriptor_datarepair_13e4beab54f194bd) }
var fileDescriptor_datarepair_10779d2b80cbd5b3 = []byte{
// 114 bytes of a gzipped FileDescriptorProto
var fileDescriptor_datarepair_13e4beab54f194bd = []byte{
// 119 bytes of a gzipped FileDescriptorProto
0x1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0x90, 0x50, 0x00, 0x58, 0xc4, 0x89,
0x25, 0x8a, 0xa9, 0x20, 0x29, 0x89, 0x0d, 0x6c, 0xb6, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x13,
0xff, 0xff, 0x1e, 0x6f, 0x00, 0x00, 0x00,
}

View File

@ -41,7 +41,7 @@ func (x RedundancyScheme_SchemeType) String() string {
return proto.EnumName(RedundancyScheme_SchemeType_name, int32(x))
}
func (RedundancyScheme_SchemeType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{0, 0}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{0, 0}
}
type EncryptionScheme_EncryptionType int32
@ -64,7 +64,7 @@ func (x EncryptionScheme_EncryptionType) String() string {
return proto.EnumName(EncryptionScheme_EncryptionType_name, int32(x))
}
func (EncryptionScheme_EncryptionType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{1, 0}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{1, 0}
}
type Pointer_DataType int32
@ -87,7 +87,7 @@ func (x Pointer_DataType) String() string {
return proto.EnumName(Pointer_DataType_name, int32(x))
}
func (Pointer_DataType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{4, 0}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{4, 0}
}
type RedundancyScheme struct {
@ -107,7 +107,7 @@ func (m *RedundancyScheme) Reset() { *m = RedundancyScheme{} }
func (m *RedundancyScheme) String() string { return proto.CompactTextString(m) }
func (*RedundancyScheme) ProtoMessage() {}
func (*RedundancyScheme) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{0}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{0}
}
func (m *RedundancyScheme) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RedundancyScheme.Unmarshal(m, b)
@ -182,7 +182,7 @@ func (m *EncryptionScheme) Reset() { *m = EncryptionScheme{} }
func (m *EncryptionScheme) String() string { return proto.CompactTextString(m) }
func (*EncryptionScheme) ProtoMessage() {}
func (*EncryptionScheme) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{1}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{1}
}
func (m *EncryptionScheme) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EncryptionScheme.Unmarshal(m, b)
@ -235,7 +235,7 @@ func (m *RemotePiece) Reset() { *m = RemotePiece{} }
func (m *RemotePiece) String() string { return proto.CompactTextString(m) }
func (*RemotePiece) ProtoMessage() {}
func (*RemotePiece) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{2}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{2}
}
func (m *RemotePiece) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RemotePiece.Unmarshal(m, b)
@ -283,7 +283,7 @@ func (m *RemoteSegment) Reset() { *m = RemoteSegment{} }
func (m *RemoteSegment) String() string { return proto.CompactTextString(m) }
func (*RemoteSegment) ProtoMessage() {}
func (*RemoteSegment) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{3}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{3}
}
func (m *RemoteSegment) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RemoteSegment.Unmarshal(m, b)
@ -348,7 +348,7 @@ func (m *Pointer) Reset() { *m = Pointer{} }
func (m *Pointer) String() string { return proto.CompactTextString(m) }
func (*Pointer) ProtoMessage() {}
func (*Pointer) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{4}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{4}
}
func (m *Pointer) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Pointer.Unmarshal(m, b)
@ -430,7 +430,7 @@ func (m *PutRequest) Reset() { *m = PutRequest{} }
func (m *PutRequest) String() string { return proto.CompactTextString(m) }
func (*PutRequest) ProtoMessage() {}
func (*PutRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{5}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{5}
}
func (m *PutRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PutRequest.Unmarshal(m, b)
@ -476,7 +476,7 @@ func (m *GetRequest) Reset() { *m = GetRequest{} }
func (m *GetRequest) String() string { return proto.CompactTextString(m) }
func (*GetRequest) ProtoMessage() {}
func (*GetRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{6}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{6}
}
func (m *GetRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetRequest.Unmarshal(m, b)
@ -520,7 +520,7 @@ func (m *ListRequest) Reset() { *m = ListRequest{} }
func (m *ListRequest) String() string { return proto.CompactTextString(m) }
func (*ListRequest) ProtoMessage() {}
func (*ListRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{7}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{7}
}
func (m *ListRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListRequest.Unmarshal(m, b)
@ -593,7 +593,7 @@ func (m *PutResponse) Reset() { *m = PutResponse{} }
func (m *PutResponse) String() string { return proto.CompactTextString(m) }
func (*PutResponse) ProtoMessage() {}
func (*PutResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{8}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{8}
}
func (m *PutResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PutResponse.Unmarshal(m, b)
@ -626,7 +626,7 @@ func (m *GetResponse) Reset() { *m = GetResponse{} }
func (m *GetResponse) String() string { return proto.CompactTextString(m) }
func (*GetResponse) ProtoMessage() {}
func (*GetResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{9}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{9}
}
func (m *GetResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetResponse.Unmarshal(m, b)
@ -673,7 +673,7 @@ func (m *ListResponse) Reset() { *m = ListResponse{} }
func (m *ListResponse) String() string { return proto.CompactTextString(m) }
func (*ListResponse) ProtoMessage() {}
func (*ListResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{10}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{10}
}
func (m *ListResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListResponse.Unmarshal(m, b)
@ -720,7 +720,7 @@ func (m *ListResponse_Item) Reset() { *m = ListResponse_Item{} }
func (m *ListResponse_Item) String() string { return proto.CompactTextString(m) }
func (*ListResponse_Item) ProtoMessage() {}
func (*ListResponse_Item) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{10, 0}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{10, 0}
}
func (m *ListResponse_Item) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListResponse_Item.Unmarshal(m, b)
@ -772,7 +772,7 @@ func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
func (m *DeleteRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteRequest) ProtoMessage() {}
func (*DeleteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{11}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{11}
}
func (m *DeleteRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteRequest.Unmarshal(m, b)
@ -810,7 +810,7 @@ func (m *DeleteResponse) Reset() { *m = DeleteResponse{} }
func (m *DeleteResponse) String() string { return proto.CompactTextString(m) }
func (*DeleteResponse) ProtoMessage() {}
func (*DeleteResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_7ab81da76529f96d, []int{12}
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{12}
}
func (m *DeleteResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteResponse.Unmarshal(m, b)
@ -830,6 +830,69 @@ func (m *DeleteResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_DeleteResponse proto.InternalMessageInfo
// IterateRequest is a request message for the Iterate rpc call
type IterateRequest struct {
Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
First string `protobuf:"bytes,2,opt,name=first,proto3" json:"first,omitempty"`
Recurse bool `protobuf:"varint,3,opt,name=recurse,proto3" json:"recurse,omitempty"`
Reverse bool `protobuf:"varint,4,opt,name=reverse,proto3" json:"reverse,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IterateRequest) Reset() { *m = IterateRequest{} }
func (m *IterateRequest) String() string { return proto.CompactTextString(m) }
func (*IterateRequest) ProtoMessage() {}
func (*IterateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_pointerdb_0ee81d4d56faba87, []int{13}
}
func (m *IterateRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IterateRequest.Unmarshal(m, b)
}
func (m *IterateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_IterateRequest.Marshal(b, m, deterministic)
}
func (dst *IterateRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_IterateRequest.Merge(dst, src)
}
func (m *IterateRequest) XXX_Size() int {
return xxx_messageInfo_IterateRequest.Size(m)
}
func (m *IterateRequest) XXX_DiscardUnknown() {
xxx_messageInfo_IterateRequest.DiscardUnknown(m)
}
var xxx_messageInfo_IterateRequest proto.InternalMessageInfo
func (m *IterateRequest) GetPrefix() string {
if m != nil {
return m.Prefix
}
return ""
}
func (m *IterateRequest) GetFirst() string {
if m != nil {
return m.First
}
return ""
}
func (m *IterateRequest) GetRecurse() bool {
if m != nil {
return m.Recurse
}
return false
}
func (m *IterateRequest) GetReverse() bool {
if m != nil {
return m.Reverse
}
return false
}
func init() {
proto.RegisterType((*RedundancyScheme)(nil), "pointerdb.RedundancyScheme")
proto.RegisterType((*EncryptionScheme)(nil), "pointerdb.EncryptionScheme")
@ -845,6 +908,7 @@ func init() {
proto.RegisterType((*ListResponse_Item)(nil), "pointerdb.ListResponse.Item")
proto.RegisterType((*DeleteRequest)(nil), "pointerdb.DeleteRequest")
proto.RegisterType((*DeleteResponse)(nil), "pointerdb.DeleteResponse")
proto.RegisterType((*IterateRequest)(nil), "pointerdb.IterateRequest")
proto.RegisterEnum("pointerdb.RedundancyScheme_SchemeType", RedundancyScheme_SchemeType_name, RedundancyScheme_SchemeType_value)
proto.RegisterEnum("pointerdb.EncryptionScheme_EncryptionType", EncryptionScheme_EncryptionType_name, EncryptionScheme_EncryptionType_value)
proto.RegisterEnum("pointerdb.Pointer_DataType", Pointer_DataType_name, Pointer_DataType_value)
@ -1029,70 +1093,73 @@ var _PointerDB_serviceDesc = grpc.ServiceDesc{
Metadata: "pointerdb.proto",
}
func init() { proto.RegisterFile("pointerdb.proto", fileDescriptor_pointerdb_7ab81da76529f96d) }
func init() { proto.RegisterFile("pointerdb.proto", fileDescriptor_pointerdb_0ee81d4d56faba87) }
var fileDescriptor_pointerdb_7ab81da76529f96d = []byte{
// 987 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xdb, 0x46,
0x10, 0x36, 0xf5, 0xcf, 0xa1, 0x65, 0xb3, 0x8b, 0xd4, 0x61, 0x94, 0x14, 0x31, 0x18, 0xb4, 0x70,
0x9b, 0x40, 0x2e, 0xd4, 0x00, 0x2d, 0x1a, 0xb4, 0x45, 0x6c, 0xab, 0x86, 0xd1, 0x44, 0x31, 0x56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57, 0xff, 0x06, 0x00,
0x00, 0xff, 0xff, 0x73, 0xbc, 0xd6, 0xdd, 0x70, 0x08, 0x00, 0x00,
var fileDescriptor_pointerdb_0ee81d4d56faba87 = []byte{
// 1025 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x5f, 0x6f, 0x1b, 0x45,
0x10, 0xcf, 0xf9, 0xff, 0x8d, 0x63, 0xc7, 0xac, 0x42, 0x7a, 0x75, 0x8b, 0x1a, 0x5d, 0x05, 0x0a,
0xb4, 0x72, 0x90, 0xa9, 0x04, 0xa2, 0x02, 0xd4, 0x24, 0x26, 0xb2, 0x68, 0xdd, 0x68, 0x9d, 0x07,
0xc4, 0xcb, 0xb1, 0xf1, 0x8d, 0xe3, 0x55, 0x7d, 0x7f, 0xb2, 0xbb, 0x8e, 0xea, 0x7e, 0x13, 0xbe,
0x09, 0x2f, 0x3c, 0xf2, 0x71, 0x10, 0x0f, 0x7c, 0x01, 0xb4, 0xbb, 0x77, 0xf6, 0x39, 0xa1, 0xe9,
0x03, 0x2f, 0xc9, 0xcd, 0x6f, 0x7e, 0x33, 0xb3, 0xfb, 0x9b, 0xd9, 0x31, 0xec, 0xa4, 0x09, 0x8f,
0x15, 0x8a, 0xf0, 0xa2, 0x97, 0x8a, 0x44, 0x25, 0xc4, 0x5d, 0x01, 0xdd, 0x47, 0x97, 0x49, 0x72,
0x39, 0xc7, 0x43, 0xe3, 0xb8, 0x58, 0x4c, 0x0f, 0x15, 0x8f, 0x50, 0x2a, 0x16, 0xa5, 0x96, 0xdb,
0x6d, 0x25, 0xd7, 0x28, 0xe6, 0x6c, 0x69, 0x4d, 0xff, 0xb7, 0x12, 0x74, 0x28, 0x86, 0x8b, 0x38,
0x64, 0xf1, 0x64, 0x39, 0x9e, 0xcc, 0x30, 0x42, 0xf2, 0x2d, 0x54, 0xd4, 0x32, 0x45, 0xcf, 0xd9,
0x77,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xef, 0x1b, 0x92, 0x5d, 0xa8, 0x4e, 0xb9, 0x90, 0x2a, 0x1b, 0x0f, 0x6b,
0x10, 0x0f, 0xea, 0xb6, 0xd3, 0x98, 0x9d, 0x28, 0x37, 0xad, 0xe7, 0x1a, 0xb5, 0xa7, 0x92, 0x7b,
0x8c, 0xd9, 0xff, 0xdb, 0x01, 0x37, 0xbb, 0xdc, 0xc9, 0x11, 0x79, 0x06, 0xe5, 0xb3, 0x85, 0x22,
0x1f, 0x17, 0x6f, 0xbe, 0x7a, 0x26, 0xdd, 0xbd, 0x9b, 0x70, 0xd6, 0x9d, 0x67, 0x50, 0x3e, 0xc5,
0xcd, 0xa8, 0xf5, 0x63, 0xd8, 0x88, 0x2a, 0xce, 0xcd, 0xd7, 0x50, 0xd1, 0xbd, 0x23, 0x7b, 0xb7,
0x9a, 0x69, 0xe3, 0xee, 0xbd, 0xa7, 0xc9, 0xe4, 0x3b, 0xa8, 0x59, 0xe1, 0x48, 0x71, 0x83, 0x6d,
0x08, 0xde, 0xbd, 0xff, 0x1f, 0x1e, 0x1b, 0x7e, 0x54, 0xf9, 0xa5, 0x94, 0x5e, 0x5c, 0xd4, 0xcc,
0x92, 0xf9, 0xea, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x08, 0x14, 0xec, 0xe4, 0x08, 0x00,
0x00,
}

View File

@ -128,3 +128,11 @@ message DeleteRequest {
// DeleteResponse is a response message for the Delete rpc call
message DeleteResponse {
}
// IterateRequest is a request message for the Iterate rpc call
message IterateRequest {
string prefix = 1;
string first = 2;
bool recurse = 3;
bool reverse = 4;
}

View File

@ -261,3 +261,14 @@ func (s *Server) Delete(ctx context.Context, req *pb.DeleteRequest) (resp *pb.De
s.logger.Debug("deleted pointer at path: " + req.GetPath())
return &pb.DeleteResponse{}, nil
}
// Iterate iterates over items based on IterateRequest
func (s *Server) Iterate(ctx context.Context, req *pb.IterateRequest, f func(it storage.Iterator) error) error {
opts := storage.IterateOptions{
Prefix: storage.Key(req.Prefix),
First: storage.Key(req.First),
Recurse: req.Recurse,
Reverse: req.Reverse,
}
return s.DB.Iterate(opts, f)
}

BIN
small-upload-testfile Normal file

Binary file not shown.