-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd: support pause/resume/remove changefeed (#546)
* cdc, cmd: add status address to capture info Signed-off-by: Neil Shen <overvenus@gmail.com> * tests: adjust start_cdc_server Signed-off-by: Neil Shen <overvenus@gmail.com> * cmd: support pause/resume/remove changefeed Signed-off-by: Neil Shen <overvenus@gmail.com> * fix test Signed-off-by: Neil Shen <overvenus@gmail.com> * address comments Signed-off-by: Neil Shen <overvenus@gmail.com> * cdc, cmd: replace status address with address and advertise address Signed-off-by: Neil Shen <overvenus@gmail.com> * correct parameter Signed-off-by: Neil Shen <overvenus@gmail.com> * use address in PD Signed-off-by: Neil Shen <overvenus@gmail.com>
- Loading branch information
Showing
33 changed files
with
419 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2019 PingCAP, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package cdc | ||
|
||
import ( | ||
"github.com/pingcap/check" | ||
) | ||
|
||
type serverOptionSuite struct{} | ||
|
||
var _ = check.Suite(&serverOptionSuite{}) | ||
|
||
func (s *serverOptionSuite) TestNewServer(c *check.C) { | ||
svr, err := NewServer() | ||
c.Assert(svr, check.IsNil) | ||
c.Assert(err, check.ErrorMatches, "empty PD address") | ||
|
||
svr, err = NewServer(PDEndpoints("pd")) | ||
c.Assert(svr, check.IsNil) | ||
c.Assert(err, check.ErrorMatches, "empty address") | ||
|
||
svr, err = NewServer(PDEndpoints("pd"), Address("cdc")) | ||
c.Assert(svr, check.IsNil) | ||
c.Assert(err, check.ErrorMatches, "empty GC TTL is not allowed") | ||
|
||
svr, err = NewServer(PDEndpoints("pd"), Address("cdc"), GCTTL(DefaultCDCGCSafePointTTL)) | ||
c.Assert(svr, check.NotNil) | ||
c.Assert(err, check.IsNil) | ||
c.Assert(svr.opts.advertiseAddr, check.Equals, "cdc") | ||
|
||
svr, err = NewServer(PDEndpoints("pd"), Address("cdc"), GCTTL(DefaultCDCGCSafePointTTL), | ||
AdvertiseAddress("advertise")) | ||
c.Assert(svr, check.NotNil) | ||
c.Assert(err, check.IsNil) | ||
c.Assert(svr.opts.addr, check.Equals, "cdc") | ||
c.Assert(svr.opts.advertiseAddr, check.Equals, "advertise") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.