首页  

temporal 获取 namespace信息 关键代码和堆栈信息     所属分类 temporal 浏览量 609
DescribeNamespaceRequest describeNamespaceRequest = DescribeNamespaceRequest.newBuilder()
				.setNamespace(namespace).build();

DescribeNamespaceResponse describeNamespaceResponse = workflowServiceBlockingStub
				.describeNamespace(describeNamespaceRequest);
							

SELECT id, name, is_global, data, data_encoding, notification_version FROM namespaces
where WHERE partition_id=$1 AND name = $2

partition_id 是全局常量
const (
	partitionID = 54321
)


temporal/common/persistence/sql/sqlplugin/postgresql/namespace.go
func (pdb *db) selectFromNamespace(
	ctx context.Context,
	filter sqlplugin.NamespaceFilter,
) ([]sqlplugin.NamespaceRow, error) {
	var err error
	var row sqlplugin.NamespaceRow
	switch {
	case filter.ID != nil:
		err = pdb.conn.GetContext(ctx,
			&row,
			getNamespaceByIDQuery,
			partitionID,
			*filter.ID,
		)
	case filter.Name != nil:
		err = pdb.conn.GetContext(ctx,
			&row,
			getNamespaceByNameQuery,
			partitionID,
			*filter.Name,
		)
	}
	if err != nil {
		return nil, err
	}
	return []sqlplugin.NamespaceRow{row}, nil
}


github.com/jmoiron/sqlx.(*DB).GetContext (/Users/dugang/go/pkg/mod/github.com/jmoiron/sqlx@v1.3.4/sqlx_context.go:146) go.temporal.io/server/common/persistence/sql/sqlplugin/postgresql.(*db).selectFromNamespace (/Users/dugang/dugang/work/temporal/temporal/common/persistence/sql/sqlplugin/postgresql/namespace.go:117) go.temporal.io/server/common/persistence/sql/sqlplugin/postgresql.(*db).SelectFromNamespace (/Users/dugang/dugang/work/temporal/temporal/common/persistence/sql/sqlplugin/postgresql/namespace.go:94) go.temporal.io/server/common/persistence/sql.(*DbConn).SelectFromNamespace (Unknown Source:1) go.temporal.io/server/common/persistence/sql.(*sqlMetadataManagerV2).GetNamespace (/Users/dugang/dugang/work/temporal/temporal/common/persistence/sql/metadata.go:119) go.temporal.io/server/common/persistence.(*metadataManagerImpl).GetNamespace (/Users/dugang/dugang/work/temporal/temporal/common/persistence/metadata_manager.go:86) go.temporal.io/server/common/persistence.(*metadataRateLimitedPersistenceClient).GetNamespace (/Users/dugang/dugang/work/temporal/temporal/common/persistence/persistenceRateLimitedClients.go:543) go.temporal.io/server/common/persistence.(*metadataPersistenceClient).GetNamespace (/Users/dugang/dugang/work/temporal/temporal/common/persistence/persistenceMetricClients.go:765) go.temporal.io/server/common/namespace.(*HandlerImpl).DescribeNamespace (/Users/dugang/dugang/work/temporal/temporal/common/namespace/handler.go:344) go.temporal.io/server/service/frontend.(*WorkflowHandler).DescribeNamespace (/Users/dugang/dugang/work/temporal/temporal/service/frontend/workflowHandler.go:298) go.temporal.io/server/service/frontend.(*DCRedirectionHandlerImpl).DescribeNamespace (/Users/dugang/dugang/work/temporal/temporal/service/frontend/dcRedirectionHandler.go:153) go.temporal.io/api/workflowservice/v1._WorkflowService_DescribeNamespace_Handler.func1 (/Users/dugang/go/pkg/mod/go.temporal.io/api@v1.7.1-0.20220211205804-a4f685c2448b/workflowservice/v1/service.pb.go:1071) go.temporal.io/server/common/rpc/interceptor.(*SDKVersionInterceptor).Intercept (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/sdk_version.go:63) go.temporal.io/server/common/rpc/interceptor.(*SDKVersionInterceptor).Intercept-fm (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/sdk_version.go:53) google.golang.org/grpc.chainUnaryInterceptors.func1.1 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1116) go.temporal.io/server/common/authorization.(*interceptor).Interceptor (/Users/dugang/dugang/work/temporal/temporal/common/authorization/interceptor.go:152) go.temporal.io/server/common/authorization.(*interceptor).Interceptor-fm (/Users/dugang/dugang/work/temporal/temporal/common/authorization/interceptor.go:66) google.golang.org/grpc.chainUnaryInterceptors.func1.1 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1119) go.temporal.io/server/common/rpc/interceptor.(*NamespaceCountLimitInterceptor).Intercept (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/namespace_count_limit.go:99) go.temporal.io/server/common/rpc/interceptor.(*NamespaceCountLimitInterceptor).Intercept-fm (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/namespace_count_limit.go:76) google.golang.org/grpc.chainUnaryInterceptors.func1.1 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1119) go.temporal.io/server/common/rpc/interceptor.(*NamespaceRateLimitInterceptor).Intercept (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/namespace_rate_limit.go:89) go.temporal.io/server/common/rpc/interceptor.(*NamespaceRateLimitInterceptor).Intercept-fm (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/namespace_rate_limit.go:69) google.golang.org/grpc.chainUnaryInterceptors.func1.1 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1119) go.temporal.io/server/common/rpc/interceptor.(*RateLimitInterceptor).Intercept (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/rate_limit.go:84) go.temporal.io/server/common/rpc/interceptor.(*RateLimitInterceptor).Intercept-fm (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/rate_limit.go:65) google.golang.org/grpc.chainUnaryInterceptors.func1.1 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1119) go.temporal.io/server/common/rpc/interceptor.(*NamespaceValidatorInterceptor).Intercept (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/namespace_validator.go:113) go.temporal.io/server/common/rpc/interceptor.(*NamespaceValidatorInterceptor).Intercept-fm (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/namespace_validator.go:93) google.golang.org/grpc.chainUnaryInterceptors.func1.1 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1119) go.temporal.io/server/common/rpc/interceptor.(*TelemetryInterceptor).Intercept (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/telemetry.go:108) go.temporal.io/server/common/rpc/interceptor.(*TelemetryInterceptor).Intercept-fm (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/telemetry.go:91) google.golang.org/grpc.chainUnaryInterceptors.func1.1 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1119) go.temporal.io/server/common/metrics.NewServerMetricsContextInjectorInterceptor.func1 (/Users/dugang/dugang/work/temporal/temporal/common/metrics/grpc.go:66) google.golang.org/grpc.chainUnaryInterceptors.func1.1 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1119) go.temporal.io/server/common/rpc.ServiceErrorInterceptor (/Users/dugang/dugang/work/temporal/temporal/common/rpc/grpc.go:131) google.golang.org/grpc.chainUnaryInterceptors.func1.1 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1119) go.temporal.io/server/common/rpc/interceptor.(*NamespaceLogInterceptor).Intercept (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/namespace_logger.go:84) go.temporal.io/server/common/rpc/interceptor.(*NamespaceLogInterceptor).Intercept-fm (/Users/dugang/dugang/work/temporal/temporal/common/rpc/interceptor/namespace_logger.go:57) google.golang.org/grpc.chainUnaryInterceptors.func1.1 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1119) google.golang.org/grpc.chainUnaryInterceptors.func1 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1121) go.temporal.io/api/workflowservice/v1._WorkflowService_DescribeNamespace_Handler (/Users/dugang/go/pkg/mod/go.temporal.io/api@v1.7.1-0.20220211205804-a4f685c2448b/workflowservice/v1/service.pb.go:1073) google.golang.org/grpc.(*Server).processUnaryRPC (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1282) google.golang.org/grpc.(*Server).handleStream (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1616) google.golang.org/grpc.(*Server).serveStreams.func1.2 (/Users/dugang/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:921) runtime.goexit (/usr/local/go/src/runtime/asm_amd64.s:1581)

上一篇     下一篇
UUID简介

temporal 获取集群信息 关键代码

postgresql jdbc 驱动 ResultSet 取值

temporal 重要表说明

Temporal Clusters

Go检查结构体是否实现了指定接口