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)
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) {
fun0 = NormalizeShardFunc(fun0)
......
......@@ -424,8 +424,8 @@ func TestSHARDINGFile(t *testing.T) {
if err != nil {
t.Fatalf("New fail: %v\n", err)
}
if fs.ShardFunc() != flatfs.NormalizeShardFunc(fun) {
t.Fatalf("Shard function in repo not %s", fun)
if fs.ShardFunc() != flatfs.IPFS_DEF_SHARD {
t.Fatalf("Expected '%s' for shard function got '%s'", flatfs.IPFS_DEF_SHARD, fs.ShardFunc())
}
fs.Close()
......
......@@ -19,7 +19,7 @@ func (f shardId) str() string {
if f.funName == "" || f.funName == "auto" {
return "auto"
} 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