Commit 30b5a0e7 authored by Kevin Atkinson's avatar Kevin Atkinson

Prefix shard function identifier with "/repo/flatfs/shard/".

parent 8dba91b3
...@@ -40,7 +40,7 @@ var _ datastore.Datastore = (*Datastore)(nil) ...@@ -40,7 +40,7 @@ var _ datastore.Datastore = (*Datastore)(nil)
type ShardFunc func(string) string type ShardFunc func(string) string
var IPFS_DEF_SHARD = "v1/next-to-last/2" const IPFS_DEF_SHARD = "/repo/flatfs/shard/v1/next-to-last/2"
func New(path string, fun0 string, sync bool) (*Datastore, error) { func New(path string, fun0 string, sync bool) (*Datastore, error) {
fun0 = NormalizeShardFunc(fun0) fun0 = NormalizeShardFunc(fun0)
......
...@@ -424,8 +424,8 @@ func TestSHARDINGFile(t *testing.T) { ...@@ -424,8 +424,8 @@ func TestSHARDINGFile(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("New fail: %v\n", err) t.Fatalf("New fail: %v\n", err)
} }
if fs.ShardFunc() != flatfs.NormalizeShardFunc(fun) { if fs.ShardFunc() != flatfs.IPFS_DEF_SHARD {
t.Fatalf("Shard function in repo not %s", fun) t.Fatalf("Expected '%s' for shard function got '%s'", flatfs.IPFS_DEF_SHARD, fs.ShardFunc())
} }
fs.Close() fs.Close()
......
...@@ -19,7 +19,7 @@ func (f shardId) str() string { ...@@ -19,7 +19,7 @@ func (f shardId) str() string {
if f.funName == "" || f.funName == "auto" { if f.funName == "" || f.funName == "auto" {
return "auto" return "auto"
} else { } else {
return fmt.Sprintf("v1/%s/%s", f.funName, f.param) return fmt.Sprintf("/repo/flatfs/shard/v1/%s/%s", f.funName, f.param)
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment