-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix_owner_block_http_api
- Loading branch information
Showing
57 changed files
with
3,546 additions
and
156 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2021 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 system | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/pingcap/ticdc/pkg/actor" | ||
) | ||
|
||
// System manages table pipeline global resource. | ||
type System struct { | ||
tableActorSystem *actor.System | ||
tableActorRouter *actor.Router | ||
} | ||
|
||
// NewSystem returns a system. | ||
func NewSystem() *System { | ||
return &System{} | ||
} | ||
|
||
// Start starts a system. | ||
func (s *System) Start(ctx context.Context) error { | ||
// todo: make the table actor system configurable | ||
s.tableActorSystem, s.tableActorRouter = actor.NewSystemBuilder("table").Build() | ||
s.tableActorSystem.Start(ctx) | ||
return nil | ||
} | ||
|
||
// Stop stops a system. | ||
func (s *System) Stop() error { | ||
return s.tableActorSystem.Stop() | ||
} |
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,29 @@ | ||
// Copyright 2021 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 system | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestStartAndStopSystem(t *testing.T) { | ||
t.Parallel() | ||
|
||
s := NewSystem() | ||
require.Nil(t, s.Start(context.TODO())) | ||
require.Nil(t, s.Stop()) | ||
} |
Oops, something went wrong.