mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3: move syncer to mirror package
to be in line with sync meaning process synchronization, not data synchronization
This commit is contained in:
parent
bbdff697db
commit
9f569842f0
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package sync
|
package mirror
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
|
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
|
@ -23,7 +23,7 @@ import (
|
|||||||
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra"
|
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra"
|
||||||
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
|
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
|
||||||
"github.com/coreos/etcd/clientv3"
|
"github.com/coreos/etcd/clientv3"
|
||||||
"github.com/coreos/etcd/clientv3/sync"
|
"github.com/coreos/etcd/clientv3/mirror"
|
||||||
"github.com/coreos/etcd/etcdserver/api/v3rpc"
|
"github.com/coreos/etcd/etcdserver/api/v3rpc"
|
||||||
"github.com/coreos/etcd/storage/storagepb"
|
"github.com/coreos/etcd/storage/storagepb"
|
||||||
)
|
)
|
||||||
@ -77,7 +77,7 @@ func makeMirror(ctx context.Context, c *clientv3.Client, dc *clientv3.Client) er
|
|||||||
// TODO: remove the prefix of the destination cluster?
|
// TODO: remove the prefix of the destination cluster?
|
||||||
dkv := clientv3.NewKV(dc)
|
dkv := clientv3.NewKV(dc)
|
||||||
|
|
||||||
s := sync.NewSyncer(c, mmprefix, 0)
|
s := mirror.NewSyncer(c, mmprefix, 0)
|
||||||
|
|
||||||
rc, errc := s.SyncBase(ctx)
|
rc, errc := s.SyncBase(ctx)
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra"
|
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra"
|
||||||
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
|
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
|
||||||
"github.com/coreos/etcd/clientv3"
|
"github.com/coreos/etcd/clientv3"
|
||||||
"github.com/coreos/etcd/clientv3/sync"
|
"github.com/coreos/etcd/clientv3/mirror"
|
||||||
"github.com/coreos/etcd/etcdserver/api/v3rpc"
|
"github.com/coreos/etcd/etcdserver/api/v3rpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ func snapshotToFile(c *clientv3.Client, path string) {
|
|||||||
// snapshot reads all of a watcher; returns compaction revision if incomplete
|
// snapshot reads all of a watcher; returns compaction revision if incomplete
|
||||||
// TODO: stabilize snapshot format
|
// TODO: stabilize snapshot format
|
||||||
func snapshot(w io.Writer, c *clientv3.Client, rev int64) int64 {
|
func snapshot(w io.Writer, c *clientv3.Client, rev int64) int64 {
|
||||||
s := sync.NewSyncer(c, "", rev)
|
s := mirror.NewSyncer(c, "", rev)
|
||||||
|
|
||||||
rc, errc := s.SyncBase(context.TODO())
|
rc, errc := s.SyncBase(context.TODO())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user