mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
restore field translate keys
This commit is contained in:
parent
69245ee209
commit
329f86033d
2 changed files with 15 additions and 0 deletions
10
client.go
10
client.go
|
|
@ -91,6 +91,9 @@ type InternalClient interface {
|
|||
|
||||
GetNodeUsage(ctx context.Context, uri *pnet.URI) (map[string]NodeUsage, error)
|
||||
GetPastQueries(ctx context.Context, uri *pnet.URI) ([]PastQueryStatus, error)
|
||||
|
||||
ImportFieldKeys(ctx context.Context, uri *pnet.URI, index, field string, remote bool, rddbdata io.Reader) error
|
||||
ImportIndexKeys(ctx context.Context, uri *pnet.URI, index string, partitionID int, remote bool, rddbdata io.Reader) error
|
||||
}
|
||||
|
||||
//===============
|
||||
|
|
@ -274,3 +277,10 @@ func (n nopInternalClient) GetNodeUsage(ctx context.Context, uri *pnet.URI) (map
|
|||
func (n nopInternalClient) GetPastQueries(ctx context.Context, uri *pnet.URI) ([]PastQueryStatus, error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (c nopInternalClient) ImportFieldKeys(ctx context.Context, uri *pnet.URI, index, field string, remote bool, rddbdata io.Reader) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c nopInternalClient) ImportIndexKeys(ctx context.Context, uri *pnet.URI, index string, partitionID int, remote bool, rddbdata io.Reader) error {
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ func (cmd *RestoreCommand) Run(ctx context.Context) error {
|
|||
vprint.VV("shard %v %v", shard, indexName)
|
||||
url := primary.URI.Path(fmt.Sprintf("/internal/restore/%v/%v", indexName, shard))
|
||||
vprint.VV("%v", url)
|
||||
//TODO (twg) cluster aware client
|
||||
_, err = c.Post(url, "application/octet-stream", tarReader)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -193,6 +194,10 @@ func (cmd *RestoreCommand) Run(ctx context.Context) error {
|
|||
switch action := record[4]; action {
|
||||
case "translate":
|
||||
vprint.VV("field keys %v %v", indexName, fieldName)
|
||||
err := cmd.client.ImportFieldKeys(ctx, &primary.URI, indexName, fieldName, false, tarReader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
case "attributes":
|
||||
vprint.VV("field attributes %v %v", indexName, fieldName)
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue