Skip to content

Commit 3db2adb

Browse files
authored
Rename domain to namespace. (#81)
Due to circular runtime dependency with the service integration tests cannot pass with backward incompatible change like this one.
1 parent e8af96e commit 3db2adb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+485
-486
lines changed

client/client.go

+26-26
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ const (
3939
// DefaultHostPort is the host:port which is used if not passed with options.
4040
DefaultHostPort = internal.LocalHostPort
4141

42-
// DefaultDomainName is the domain name which is used if not passed with options.
43-
DefaultDomainName = internal.DefaultDomainName
42+
// DefaultNamespace is the namespace name which is used if not passed with options.
43+
DefaultNamespace = internal.DefaultNamespace
4444

4545
// QueryTypeStackTrace is the build in query type for Client.QueryWorkflow() call. Use this query type to get the call
4646
// stack of the workflow. The result will be a string encoded in the encoded.Value.
@@ -92,7 +92,7 @@ type (
9292
// or
9393
// ExecuteWorkflow(ctx, options, workflowExecuteFn, arg1, arg2, arg3)
9494
// The errors it can return:
95-
// - EntityNotExistsError, if domain does not exists
95+
// - EntityNotExistsError, if namespace does not exists
9696
// - BadRequestError
9797
// - InternalServiceError
9898
//
@@ -144,7 +144,7 @@ type (
144144
// Note: options.WorkflowIDReusePolicy is default to WorkflowIDReusePolicyAllowDuplicate in this API;
145145
// while in StartWorkflow/ExecuteWorkflow APIs it is default to WorkflowIdReusePolicyAllowDuplicateFailedOnly.
146146
// The errors it can return:
147-
// - EntityNotExistsError, if domain does not exist
147+
// - EntityNotExistsError, if namespace does not exist
148148
// - BadRequestError
149149
// - InternalServiceError
150150
SignalWithStartWorkflow(ctx context.Context, workflowID string, signalName string, signalArg interface{},
@@ -214,12 +214,12 @@ type (
214214
// completed event will be reported; if err is CanceledError, activity task cancelled event will be reported; otherwise,
215215
// activity task failed event will be reported.
216216
// An activity implementation should use activityID provided in ActivityOption to use for completion.
217-
// domain name, workflowID, activityID are required, runID is optional.
217+
// namespace name, workflowID, activityID are required, runID is optional.
218218
// The errors it can return:
219219
// - ErrorWithDetails
220220
// - TimeoutError
221221
// - CanceledError
222-
CompleteActivityByID(ctx context.Context, domain, workflowID, runID, activityID string, result interface{}, err error) error
222+
CompleteActivityByID(ctx context.Context, namespace, workflowID, runID, activityID string, result interface{}, err error) error
223223

224224
// RecordActivityHeartbeat records heartbeat for an activity.
225225
// taskToken - is the value of the binary "TaskToken" field of the "ActivityInfo" struct retrieved inside the activity.
@@ -234,7 +234,7 @@ type (
234234
// The errors it can return:
235235
// - EntityNotExistsError
236236
// - InternalServiceError
237-
RecordActivityHeartbeatByID(ctx context.Context, domain, workflowID, runID, activityID string, details ...interface{}) error
237+
RecordActivityHeartbeatByID(ctx context.Context, namespace, workflowID, runID, activityID string, details ...interface{}) error
238238

239239
// ListClosedWorkflow gets closed workflow executions based on request filters.
240240
// Retrieved workflow executions are sorted by start time in descending order.
@@ -270,9 +270,9 @@ type (
270270
ListWorkflow(ctx context.Context, request *workflowservice.ListWorkflowExecutionsRequest) (*workflowservice.ListWorkflowExecutionsResponse, error)
271271

272272
// ListArchivedWorkflow gets archived workflow executions based on query. This API will return BadRequest if Temporal
273-
// cluster or target domain is not configured for visibility archival or read is not enabled. The query is basically the SQL WHERE clause.
273+
// cluster or target namespace is not configured for visibility archival or read is not enabled. The query is basically the SQL WHERE clause.
274274
// However, different visibility archivers have different limitations on the query. Please check the documentation of the visibility archiver used
275-
// by your domain to see what kind of queries are accept and whether retrieved workflow executions are ordered or not.
275+
// by your namespace to see what kind of queries are accept and whether retrieved workflow executions are ordered or not.
276276
// The errors it can return:
277277
// - BadRequestError
278278
// - InternalServiceError
@@ -352,32 +352,32 @@ type (
352352
CloseConnection() error
353353
}
354354

355-
// DomainClient is the client for managing operations on the domain.
356-
// CLI, tools, ... can use this layer to manager operations on domain.
357-
DomainClient interface {
358-
// Register a domain with temporal server
355+
// NamespaceClient is the client for managing operations on the namespace.
356+
// CLI, tools, ... can use this layer to manager operations on namespace.
357+
NamespaceClient interface {
358+
// Register a namespace with temporal server
359359
// The errors it can throw:
360-
// - DomainAlreadyExistsError
360+
// - NamespaceAlreadyExistsError
361361
// - BadRequestError
362362
// - InternalServiceError
363-
Register(ctx context.Context, request *workflowservice.RegisterDomainRequest) error
363+
Register(ctx context.Context, request *workflowservice.RegisterNamespaceRequest) error
364364

365-
// Describe a domain. The domain has 3 part of information
366-
// DomainInfo - Which has Name, Status, Description, Owner Email
367-
// DomainConfiguration - Configuration like Workflow Execution Retention Period In Days, Whether to emit metrics.
365+
// Describe a namespace. The namespace has 3 part of information
366+
// NamespaceInfo - Which has Name, Status, Description, Owner Email
367+
// NamespaceConfiguration - Configuration like Workflow Execution Retention Period In Days, Whether to emit metrics.
368368
// ReplicationConfiguration - replication config like clusters and active cluster name
369369
// The errors it can throw:
370370
// - EntityNotExistsError
371371
// - BadRequestError
372372
// - InternalServiceError
373-
Describe(ctx context.Context, name string) (*workflowservice.DescribeDomainResponse, error)
373+
Describe(ctx context.Context, name string) (*workflowservice.DescribeNamespaceResponse, error)
374374

375-
// Update a domain.
375+
// Update a namespace.
376376
// The errors it can throw:
377377
// - EntityNotExistsError
378378
// - BadRequestError
379379
// - InternalServiceError
380-
Update(ctx context.Context, request *workflowservice.UpdateDomainRequest) error
380+
Update(ctx context.Context, request *workflowservice.UpdateNamespaceRequest) error
381381

382382
// CloseConnection closes underlying gRPC connection.
383383
CloseConnection() error
@@ -412,16 +412,16 @@ func NewClient(options Options) (Client, error) {
412412
return internal.NewClient(options)
413413
}
414414

415-
// NewDomainClient creates an instance of a domain client, to manage lifecycle of domains.
416-
func NewDomainClient(options Options) (DomainClient, error) {
417-
return internal.NewDomainClient(options)
415+
// NewNamespaceClient creates an instance of a namespace client, to manage lifecycle of namespaces.
416+
func NewNamespaceClient(options Options) (NamespaceClient, error) {
417+
return internal.NewNamespaceClient(options)
418418
}
419419

420420
// make sure if new methods are added to internal.Client they are also added to public Client.
421421
var _ Client = internal.Client(nil)
422422
var _ internal.Client = Client(nil)
423-
var _ DomainClient = internal.DomainClient(nil)
424-
var _ internal.DomainClient = DomainClient(nil)
423+
var _ NamespaceClient = internal.NamespaceClient(nil)
424+
var _ internal.NamespaceClient = NamespaceClient(nil)
425425

426426
// NewValue creates a new encoded.Value which can be used to decode binary data returned by Temporal. For example:
427427
// User had Activity.RecordHeartbeat(ctx, "my-heartbeat") and then got response from calling Client.DescribeWorkflowExecution.

evictiontest/workflow_cache_eviction_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (s *CacheEvictionSuite) TestResetStickyOnEviction() {
139139
cacheSize := 5
140140
internal.SetStickyWorkflowCacheSize(cacheSize)
141141
// once for workflow worker because we disable activity worker
142-
s.service.EXPECT().DescribeDomain(gomock.Any(), gomock.Any()).Return(nil, nil).Times(1)
142+
s.service.EXPECT().DescribeNamespace(gomock.Any(), gomock.Any()).Return(nil, nil).Times(1)
143143
// feed our worker exactly *cacheSize* "legit" decision tasks
144144
// these are handcrafted decision tasks that are not blatantly obviously mocks
145145
// the goal is to trick our worker into thinking they are real so it

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
github.com/uber-go/tally v3.3.15+incompatible
2323
github.com/uber/jaeger-client-go v2.22.1+incompatible
2424
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
25-
go.temporal.io/temporal-proto v0.20.1
25+
go.temporal.io/temporal-proto v0.20.2
2626
go.uber.org/atomic v1.6.0
2727
go.uber.org/goleak v1.0.0
2828
go.uber.org/zap v1.14.1

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMW
9191
github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=
9292
github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
9393
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
94-
go.temporal.io/temporal-proto v0.20.1 h1:hiu9DbQVYOZDp3IVkn0wCahIN6iQR429ctVXcUCARBw=
95-
go.temporal.io/temporal-proto v0.20.1/go.mod h1:Lv8L8YBpbp0Z7V5nbvw5UD0j7x0isebhCOIDLkBqn6s=
94+
go.temporal.io/temporal-proto v0.20.2 h1:ll+VJaxyR4xzZWClT+CIcm4fQdzEdcBGf4Yksq4EVxI=
95+
go.temporal.io/temporal-proto v0.20.2/go.mod h1:Lv8L8YBpbp0Z7V5nbvw5UD0j7x0isebhCOIDLkBqn6s=
9696
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
9797
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
9898
go.uber.org/goleak v1.0.0 h1:qsup4IcBdlmsnGfqyLl4Ntn3C2XCCuKAE7DwHpScyUo=

internal/activity.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type (
4242
ActivityInfo struct {
4343
TaskToken []byte
4444
WorkflowType *WorkflowType
45-
WorkflowDomain string
45+
WorkflowNamespace string
4646
WorkflowExecution WorkflowExecution
4747
ActivityID string
4848
ActivityType ActivityType
@@ -134,7 +134,7 @@ func GetActivityInfo(ctx context.Context) ActivityInfo {
134134
TaskList: env.taskList,
135135
Attempt: env.attempt,
136136
WorkflowType: env.workflowType,
137-
WorkflowDomain: env.workflowDomain,
137+
WorkflowNamespace: env.workflowNamespace,
138138
}
139139
}
140140

@@ -215,7 +215,7 @@ type ServiceInvoker interface {
215215
// Returns ActivityTaskCanceledError if activity is cancelled
216216
Heartbeat(details []byte) error
217217
Close(flushBufferedHeartbeat bool)
218-
GetClient(domain string, options ClientOptions) Client
218+
GetClient(namespace string, options ClientOptions) Client
219219
}
220220

221221
// WithActivityTask adds activity specific information into context.
@@ -276,7 +276,7 @@ func WithActivityTask(
276276
workflowType: &WorkflowType{
277277
Name: task.WorkflowType.Name,
278278
},
279-
workflowDomain: task.WorkflowDomain,
279+
workflowNamespace: task.WorkflowNamespace,
280280
workerStopChannel: workerStopChannel,
281281
contextPropagators: contextPropagators,
282282
tracer: tracer,

0 commit comments

Comments
 (0)