veyron2/storage: Introduce directories.
The store now has separate directories from objects. For a thorough discussion, see:
https://docs.google.com/a/google.com/document/d/1dbUC-giF3JJ5c7GVwJEVll14LCd-1Pe3Hpo9nngbd0s/edit#
This change also removes the Store type from model.go. We found the
asymmetry between transactional and non-transactional operations to
be annoying. Specifically, transactional operations would work entirely
with relative paths, but non-transactional operations would need an
absolute paths. Now, everything revolves around a Dir. Typically,
the main() of the program will create a root Dir with vstore.BindDir().
This root Dir will be passed around and used to bind to descendant
Dirs and Objects and create transactions.
I disabled the examples and qsh tool that depend on the old API. I'll
rewrite them in subsequent changes.
Change-Id: I50bc0426f91cc0defca21a0bc624ce9eb9a50a96
diff --git a/examples/boxes/android/src/boxesp2p/main.go b/examples/boxes/android/src/boxesp2p/main.go
index 9e39a2e..24a82e6 100644
--- a/examples/boxes/android/src/boxesp2p/main.go
+++ b/examples/boxes/android/src/boxesp2p/main.go
@@ -1,3 +1,6 @@
+// TODO(kash): Rewrite this to use the new dir/object store api.
+// +build ignore
+
// +build !darwin
package main
diff --git a/examples/mdb/mdb_init/main.go b/examples/mdb/mdb_init/main.go
index f00118f..45e9b85 100644
--- a/examples/mdb/mdb_init/main.go
+++ b/examples/mdb/mdb_init/main.go
@@ -1,3 +1,6 @@
+// TODO(kash): Rewrite this to use the new dir/object store api.
+// +build ignore
+
// mdb_init is a tool to initialize the store with an initial database. This is
// really for demo purposes; in a real database, the contents would be
// persistent.
diff --git a/examples/stfortune/stfortune/main.go b/examples/stfortune/stfortune/main.go
index dc7c48d..12ba537 100644
--- a/examples/stfortune/stfortune/main.go
+++ b/examples/stfortune/stfortune/main.go
@@ -1,3 +1,6 @@
+// TODO(kash): Rewrite this to use the new dir/object store api.
+// +build ignore
+
// Binary stfortune is a simple client of Veyron Store. See
// http://go/veyron:codelab-store for a thorough explanation.
package main
diff --git a/examples/todos/todos_init/main.go b/examples/todos/todos_init/main.go
index 9b696b0..ea80441 100644
--- a/examples/todos/todos_init/main.go
+++ b/examples/todos/todos_init/main.go
@@ -1,3 +1,6 @@
+// TODO(kash): Rewrite this to use the new dir/object store api.
+// +build ignore
+
// todos_init reads data.json and populates the store with initial data.
package main
diff --git a/services/store/server/server.go b/services/store/server/server.go
index d55e64a..e979c5a 100644
--- a/services/store/server/server.go
+++ b/services/store/server/server.go
@@ -1,5 +1,4 @@
// Package server implements a storage service.
-
package server
// This file defines Server, which implements the server-side Store API from
diff --git a/services/store/stored/main.go b/services/store/stored/main.go
index 7d8b3a9..9c19912 100644
--- a/services/store/stored/main.go
+++ b/services/store/stored/main.go
@@ -14,17 +14,14 @@
import (
"flag"
- "fmt"
"log"
"os"
"os/user"
vflag "veyron/security/flag"
"veyron/services/store/server"
- "veyron/services/store/viewer"
"veyron2/rt"
- "veyron2/storage/vstore"
_ "veyron/services/store/typeregistryhack"
)
@@ -92,7 +89,8 @@
// Run viewer if requested.
if *viewerPort > 0 {
- go viewer.ListenAndServe(r, fmt.Sprintf(":%d", *viewerPort), mountName, vstore.New())
+ // TODO(kash): Port the viewer to the new dir/object store api.
+ //go viewer.ListenAndServe(r, fmt.Sprintf(":%d", *viewerPort), mountName, vstore.New())
}
// Wait forever.
diff --git a/services/store/viewer/entry.go b/services/store/viewer/entry.go
index 119c53f..a5e3991 100644
--- a/services/store/viewer/entry.go
+++ b/services/store/viewer/entry.go
@@ -1,3 +1,6 @@
+// TODO(kash): Rewrite this to use the new dir/object store api.
+// +build ignore
+
package viewer
import (
diff --git a/services/store/viewer/viewer.go b/services/store/viewer/viewer.go
index 0a15e9a..dd222c9 100644
--- a/services/store/viewer/viewer.go
+++ b/services/store/viewer/viewer.go
@@ -1,3 +1,6 @@
+// TODO(kash): Rewrite this to use the new dir/object store api.
+// +build ignore
+
// package viewer exports a store through an HTTP server, with the following
// features.
//
diff --git a/tools/qsh/impl/impl.go b/tools/qsh/impl/impl.go
index a813706..086f9a4 100644
--- a/tools/qsh/impl/impl.go
+++ b/tools/qsh/impl/impl.go
@@ -1,3 +1,6 @@
+// TODO(kash): Rewrite this to use the new dir/object store api.
+// +build ignore
+
package impl
import (
diff --git a/tools/qsh/impl/impl_test.go b/tools/qsh/impl/impl_test.go
index 8419b95..de9b274 100644
--- a/tools/qsh/impl/impl_test.go
+++ b/tools/qsh/impl/impl_test.go
@@ -1,3 +1,6 @@
+// TODO(kash): Rewrite this to use the new dir/object store api.
+// +build ignore
+
package impl
import (
diff --git a/tools/qsh/main.go b/tools/qsh/main.go
index 2a4a4c3..7f2a4a4 100644
--- a/tools/qsh/main.go
+++ b/tools/qsh/main.go
@@ -1,3 +1,6 @@
+// TODO(kash): Rewrite this to use the new dir/object store api.
+// +build ignore
+
package main
import (