Skip to content

Commit

Permalink
Adds resource implmentation (cadence-workflow#5278)
Browse files Browse the repository at this point in the history
Background
This is part of the wider 'Zonal-isolation' feature:

Changes
Adds resource changes to use the partition and isolation-group libraries

Testing
Unit tests
  • Loading branch information
davidporter-id-au authored May 11, 2023
1 parent c3bf893 commit 529468e
Show file tree
Hide file tree
Showing 7 changed files with 460 additions and 5 deletions.
2 changes: 2 additions & 0 deletions common/dynamicconfig/configstore/config_store_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import (
"github.com/uber/cadence/common/types"
)

//go:generate mockgen -package $GOPACKAGE -source $GOFILE -destination configstore_mock.go -self_package github.com/uber/cadence/common/dynamicconfig/configstore

var _ dc.Client = (*configStoreClient)(nil)

// Client is a stateful config store
Expand Down
262 changes: 262 additions & 0 deletions common/dynamicconfig/configstore/configstore_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions common/resource/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ import (
"github.com/uber-go/tally"
"go.uber.org/cadence/.gen/go/cadence/workflowserviceclient"

"github.com/uber/cadence/common/dynamicconfig/configstore"

"github.com/uber/cadence/common/isolationgroup"
"github.com/uber/cadence/common/partition"

"github.com/uber/cadence/common"
"github.com/uber/cadence/common/archiver"
"github.com/uber/cadence/common/archiver/provider"
Expand Down Expand Up @@ -67,5 +72,8 @@ type (
ArchiverProvider provider.ArchiverProvider
Authorizer authorization.Authorizer // NOTE: this can be nil. If nil, AccessControlledHandlerImpl will initiate one with config.Authorization
AuthorizationConfig config.Authorization // NOTE: empty(default) struct will get a authorization.NoopAuthorizer
IsolationGroupStore configstore.Client // This can be nil, the default config store will be created if so
IsolationGroupState isolationgroup.State // This can be nil, the default state store will be chosen if so
Partitioner partition.Partitioner
}
)
10 changes: 10 additions & 0 deletions common/resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ package resource
import (
"go.uber.org/yarpc"

"github.com/uber/cadence/common/dynamicconfig/configstore"

"github.com/uber/cadence/common/isolationgroup"
"github.com/uber/cadence/common/partition"

"go.uber.org/cadence/.gen/go/cadence/workflowserviceclient"

"github.com/uber/cadence/client"
Expand Down Expand Up @@ -106,5 +111,10 @@ type (

// for registering handlers
GetDispatcher() *yarpc.Dispatcher

// GetIsolationGroupState returns the isolationGroupState
GetIsolationGroupState() isolationgroup.State
GetPartitioner() partition.Partitioner
GetIsolationGroupStore() configstore.Client
}
)
Loading

0 comments on commit 529468e

Please sign in to comment.