Merge "syncbase/vsync: SyncGroup and DAG changes for SG syncing"
diff --git a/lib/xrpc/xserver.go b/lib/xrpc/xserver.go
deleted file mode 100644
index b06f7e5..0000000
--- a/lib/xrpc/xserver.go
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright 2015 The Vanadium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package xserver provides an alternate RPC server API with the goal of
-// being simpler to use and understand.
-package xrpc
-
-import (
- "v.io/v23"
- "v.io/v23/context"
- "v.io/v23/rpc"
- "v.io/v23/security"
-)
-
-type server struct {
- s rpc.DeprecatedServer
-}
-
-// NewServer creates a new Server instance to serve a service object.
-//
-// The server will listen for network connections as specified by the
-// ListenSpec attached to ctx. Depending on your RuntimeFactory, 'roaming'
-// support may be enabled. In this mode the server will listen for
-// changes in the network configuration using a Stream created on the
-// supplied Publisher and change the set of Endpoints it publishes to
-// the mount table accordingly.
-//
-// The server associates object with name by publishing the address of
-// this server in the namespace under the supplied name and using
-// authorizer to authorize access to it. RPCs invoked on the supplied
-// name will be delivered to methods implemented by the supplied
-// object. Reflection is used to match requests to the object's
-// method set. As a special-case, if the object implements the
-// Invoker interface, the Invoker is used to invoke methods directly,
-// without reflection. If name is an empty string, no attempt will
-// made to publish.
-func NewServer(ctx *context.T, name string, object interface{}, auth security.Authorizer, opts ...rpc.ServerOpt) (rpc.Server, error) {
- s, err := v23.NewServer(ctx, opts...)
- if err != nil {
- return nil, err
- }
- if _, err = s.Listen(v23.GetListenSpec(ctx)); err != nil {
- s.Stop()
- return nil, err
- }
- if err = s.Serve(name, object, auth); err != nil {
- s.Stop()
- return nil, err
- }
- return &server{s: s}, nil
-}
-
-// NewDispatchingServer creates a new Server instance to serve a given dispatcher.
-//
-// The server will listen for network connections as specified by the
-// ListenSpec attached to ctx. Depending on your RuntimeFactory, 'roaming'
-// support may be enabled. In this mode the server will listen for
-// changes in the network configuration using a Stream created on the
-// supplied Publisher and change the set of Endpoints it publishes to
-// the mount table accordingly.
-//
-// The server associates dispatcher with the portion of the namespace
-// for which name is a prefix by publishing the address of this server
-// to the namespace under the supplied name. If name is an empty
-// string, no attempt will made to publish. RPCs invoked on the
-// supplied name will be delivered to the supplied Dispatcher's Lookup
-// method which will in turn return the object and security.Authorizer
-// used to serve the actual RPC call. If name is an empty string, no
-// attempt will made to publish that name to a mount table.
-func NewDispatchingServer(ctx *context.T, name string, disp rpc.Dispatcher, opts ...rpc.ServerOpt) (rpc.Server, error) {
- s, err := v23.NewServer(ctx, opts...)
- if err != nil {
- return nil, err
- }
- if _, err = s.Listen(v23.GetListenSpec(ctx)); err != nil {
- return nil, err
- }
- if err = s.ServeDispatcher(name, disp); err != nil {
- return nil, err
- }
- return &server{s: s}, nil
-}
-
-// AddName adds the specified name to the mount table for this server.
-// AddName may be called multiple times.
-func (s *server) AddName(name string) error {
- return s.s.AddName(name)
-}
-
-// RemoveName removes the specified name from the mount table.
-// RemoveName may be called multiple times.
-func (s *server) RemoveName(name string) {
- s.s.RemoveName(name)
-}
-
-// Status returns the current status of the server, see ServerStatus
-// for details.
-func (s *server) Status() rpc.ServerStatus {
- return s.s.Status()
-}
-
-// WatchNetwork registers a channel over which NetworkChange's will
-// be sent. The Server will not block sending data over this channel
-// and hence change events may be lost if the caller doesn't ensure
-// there is sufficient buffering in the channel.
-func (s *server) WatchNetwork(ch chan<- rpc.NetworkChange) {
- s.s.WatchNetwork(ch)
-}
-
-// UnwatchNetwork unregisters a channel previously registered using
-// WatchNetwork.
-func (s *server) UnwatchNetwork(ch chan<- rpc.NetworkChange) {
- s.s.UnwatchNetwork(ch)
-}
-
-// Stop gracefully stops all services on this Server. New calls are
-// rejected, but any in-flight calls are allowed to complete. All
-// published mountpoints are unmounted. This call waits for this
-// process to complete, and returns once the server has been shut down.
-func (s *server) Stop() error {
- return s.s.Stop()
-}
diff --git a/lib/xrpc/xserver_test.go b/lib/xrpc/xserver_test.go
deleted file mode 100644
index b799fb4..0000000
--- a/lib/xrpc/xserver_test.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2015 The Vanadium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package xrpc_test
-
-import (
- "testing"
-
- "v.io/v23"
- "v.io/v23/context"
- "v.io/v23/rpc"
- "v.io/v23/security"
- _ "v.io/x/ref/runtime/factories/generic"
- "v.io/x/ref/test"
-)
-
-func init() {
- test.Init()
-}
-
-type service struct{}
-
-func (s *service) Yo(ctx *context.T, call rpc.ServerCall) (string, error) {
- return "yo", nil
-}
-
-func TestXServer(t *testing.T) {
- ctx, shutdown := test.V23Init()
- defer shutdown()
-
- ctx, server, err := v23.WithNewServer(ctx, "", &service{}, nil)
- if err != nil {
- t.Fatalf("Error creating server: %v", err)
- }
- ep := server.Status().Endpoints[0]
-
- var out string
- if err := v23.GetClient(ctx).Call(ctx, ep.Name(), "Yo", nil, []interface{}{&out}); err != nil {
- t.Fatalf("Call failed: %v", err)
- }
- if out != "yo" {
- t.Fatalf("Wanted yo, got %s", out)
- }
-}
-
-type dispatcher struct{}
-
-func (d *dispatcher) Lookup(_ *context.T, suffix string) (interface{}, security.Authorizer, error) {
- return &service{}, nil, nil
-}
-
-func TestXDispatchingServer(t *testing.T) {
- ctx, shutdown := test.V23Init()
- defer shutdown()
-
- ctx, server, err := v23.WithNewDispatchingServer(ctx, "", &dispatcher{})
- if err != nil {
- t.Fatalf("Error creating server: %v", err)
- }
- ep := server.Status().Endpoints[0]
-
- var out string
- if err := v23.GetClient(ctx).Call(ctx, ep.Name(), "Yo", nil, []interface{}{&out}); err != nil {
- t.Fatalf("Call failed: %v", err)
- }
- if out != "yo" {
- t.Fatalf("Wanted yo, got %s", out)
- }
-}
diff --git a/services/application/application/impl_test.go b/services/application/application/impl_test.go
index 007d507..1bdf115 100644
--- a/services/application/application/impl_test.go
+++ b/services/application/application/impl_test.go
@@ -97,12 +97,6 @@
return nil
}
-func (s *server) PutX(ctx *context.T, _ rpc.ServerCall, profile string, env application.Envelope, overwrite bool) error {
- ctx.VI(2).Infof("%v.PutX(%v, %v, %t) was called", s.suffix, profile, env, overwrite)
- fmt.Fprintf(&serverOut, "PutX(%s, ..., %t)\n", profile, overwrite)
- return nil
-}
-
func (s *server) Profiles(ctx *context.T, _ rpc.ServerCall) ([]string, error) {
ctx.VI(2).Infof("%v.Profiles() was called", s.suffix)
return strings.Split(profiles, ","), nil
diff --git a/services/application/applicationd/dispatcher.go b/services/application/applicationd/dispatcher.go
index 8f081ac..506d3ae 100644
--- a/services/application/applicationd/dispatcher.go
+++ b/services/application/applicationd/dispatcher.go
@@ -44,7 +44,7 @@
naming.Join("/acls", "data"),
naming.Join("/acls", name, "data"),
(*applicationPermsStore)(d.store),
- []string{"Put", "PutX", "__Glob"})
+ []string{"Put", "__Glob"})
if err != nil {
return nil, nil, err
}
diff --git a/services/application/applicationd/service.go b/services/application/applicationd/service.go
index 7d12040..fca06f8 100644
--- a/services/application/applicationd/service.go
+++ b/services/application/applicationd/service.go
@@ -135,10 +135,6 @@
return empty, verror.New(verror.ErrNoExist, ctx)
}
-func (i *appRepoService) PutX(ctx *context.T, call rpc.ServerCall, profile string, envelope application.Envelope, overwrite bool) error {
- return i.Put(ctx, call, profile, envelope, overwrite)
-}
-
func (i *appRepoService) Put(ctx *context.T, call rpc.ServerCall, profile string, envelope application.Envelope, overwrite bool) error {
ctx.VI(0).Infof("%v.Put(%v, %v, %t)", i.suffix, profile, envelope, overwrite)
name, version, err := parse(ctx, i.suffix)
diff --git a/services/repository/repository.vdl b/services/repository/repository.vdl
index 2d977c2..a9f6287 100644
--- a/services/repository/repository.vdl
+++ b/services/repository/repository.vdl
@@ -25,8 +25,6 @@
// An error is returned if an envelope already exists, unless the
// overwrite option is set.
Put(Profile string, Envelope application.Envelope, Overwrite bool) error {access.Write}
- // DEPRECATED. Please use Put for new code.
- PutX(Profile string, Envelope application.Envelope, Overwrite bool) error {access.Write}
// Remove removes the application envelope for the given profile
// name and application version (specified through the object name
// suffix).
diff --git a/services/repository/repository.vdl.go b/services/repository/repository.vdl.go
index 07c29d2..6d62aa4 100644
--- a/services/repository/repository.vdl.go
+++ b/services/repository/repository.vdl.go
@@ -50,8 +50,6 @@
// An error is returned if an envelope already exists, unless the
// overwrite option is set.
Put(ctx *context.T, Profile string, Envelope application.Envelope, Overwrite bool, opts ...rpc.CallOpt) error
- // DEPRECATED. Please use Put for new code.
- PutX(ctx *context.T, Profile string, Envelope application.Envelope, Overwrite bool, opts ...rpc.CallOpt) error
// Remove removes the application envelope for the given profile
// name and application version (specified through the object name
// suffix).
@@ -91,11 +89,6 @@
return
}
-func (c implApplicationClientStub) PutX(ctx *context.T, i0 string, i1 application.Envelope, i2 bool, opts ...rpc.CallOpt) (err error) {
- err = v23.GetClient(ctx).Call(ctx, c.name, "PutX", []interface{}{i0, i1, i2}, nil, opts...)
- return
-}
-
func (c implApplicationClientStub) Remove(ctx *context.T, i0 string, opts ...rpc.CallOpt) (err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "Remove", []interface{}{i0}, nil, opts...)
return
@@ -131,8 +124,6 @@
// An error is returned if an envelope already exists, unless the
// overwrite option is set.
Put(ctx *context.T, call rpc.ServerCall, Profile string, Envelope application.Envelope, Overwrite bool) error
- // DEPRECATED. Please use Put for new code.
- PutX(ctx *context.T, call rpc.ServerCall, Profile string, Envelope application.Envelope, Overwrite bool) error
// Remove removes the application envelope for the given profile
// name and application version (specified through the object name
// suffix).
@@ -191,10 +182,6 @@
return s.impl.Put(ctx, call, i0, i1, i2)
}
-func (s implApplicationServerStub) PutX(ctx *context.T, call rpc.ServerCall, i0 string, i1 application.Envelope, i2 bool) error {
- return s.impl.PutX(ctx, call, i0, i1, i2)
-}
-
func (s implApplicationServerStub) Remove(ctx *context.T, call rpc.ServerCall, i0 string) error {
return s.impl.Remove(ctx, call, i0)
}
@@ -234,16 +221,6 @@
Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Write"))},
},
{
- Name: "PutX",
- Doc: "// DEPRECATED. Please use Put for new code.",
- InArgs: []rpc.ArgDesc{
- {"Profile", ``}, // string
- {"Envelope", ``}, // application.Envelope
- {"Overwrite", ``}, // bool
- },
- Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Write"))},
- },
- {
Name: "Remove",
Doc: "// Remove removes the application envelope for the given profile\n// name and application version (specified through the object name\n// suffix).\n//\n// If no version is specified as part of the suffix, the method removes\n// all versions for the given profile.\n//\n// If the profile is the string \"*\", all profiles are removed for the\n// given version (or for all versions if the version is not specified).",
InArgs: []rpc.ArgDesc{