service_grpc.pb.mock.go ×9

Frontier kind: Joint frontier

unlabeled · c_246755c48310

2 tests · 3919 LOC · 196 files · introduces 1 test · 110 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
22 ranges110 lines · 3 files
Tests
1 test

Contains — complete concept membership

All code (extent)
647 ranges3919 lines · 196 files · Browse complete extent
All tests (intent)
2 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

3 files ranked by introduced lines: 110 introduced LOC across 22 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/api/historyservicemock/v1/service_grpc.pb.mock.go 42 introduced LOC · 9 ranges

Open complete file

1345
1346 // StreamWorkflowReplicationMessages mocks base method.
1347 > func (m *MockHistoryServiceClient) StreamWorkflowReplicationMessages(ctx context.Context, opts ...grpc.CallOption) (historyservice.HistoryService_StreamWorkflowReplicationMessagesClient, error) { service_grpc.pb.mock.go
1348 > m.ctrl.T.Helper()
1349 > varargs := []any{ctx}
1350 > for _, a := range opts {
1351 varargs = append(varargs, a)
1352 }
1353 > ret := m.ctrl.Call(m, "StreamWorkflowReplicationMessages", varargs...) service_grpc.pb.mock.go
1354 > ret0, _ := ret[0].(historyservice.HistoryService_StreamWorkflowReplicationMessagesClient)
1355 > ret1, _ := ret[1].(error)
1356 > return ret0, ret1
1357 }
1358
1359 // StreamWorkflowReplicationMessages indicates an expected call of StreamWorkflowReplicationMessages.
1360 > func (mr *MockHistoryServiceClientMockRecorder) StreamWorkflowReplicationMessages(ctx any, opts ...any) *gomock.Call { service_grpc.pb.mock.go
1361 > mr.mock.ctrl.T.Helper()
1362 > varargs := append([]any{ctx}, opts...)
1363 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamWorkflowReplicationMessages", reflect.TypeOf((*MockHistoryServiceClient)(nil).StreamWorkflowReplicationMessages), varargs...)
1364 > }
1365
1366 // SyncActivity mocks base method.
1597
1598 // NewMockHistoryService_StreamWorkflowReplicationMessagesClient creates a new mock instance.
1599 > func NewMockHistoryService_StreamWorkflowReplicationMessagesClient(ctrl *gomock.Controller) *MockHistoryService_StreamWorkflowReplicationMessagesClient { service_grpc.pb.mock.go
1600 > mock := &MockHistoryService_StreamWorkflowReplicationMessagesClient{ctrl: ctrl}
1601 > mock.recorder = &MockHistoryService_StreamWorkflowReplicationMessagesClientMockRecorder{mock}
1602 > return mock
1603 > }
1604
1605 // EXPECT returns an object that allows the caller to indicate expected use.
1606 > func (m *MockHistoryService_StreamWorkflowReplicationMessagesClient) EXPECT() *MockHistoryService_StreamWorkflowReplicationMessagesClientMockRecorder { service_grpc.pb.mock.go
1607 > return m.recorder
1608 > }
1609
1610 // CloseSend mocks base method.
1611 > func (m *MockHistoryService_StreamWorkflowReplicationMessagesClient) CloseSend() error { service_grpc.pb.mock.go
1612 > m.ctrl.T.Helper()
1613 > ret := m.ctrl.Call(m, "CloseSend")
1614 > ret0, _ := ret[0].(error)
1615 > return ret0
1616 > }
1617
1618 // CloseSend indicates an expected call of CloseSend.
1619 > func (mr *MockHistoryService_StreamWorkflowReplicationMessagesClientMockRecorder) CloseSend() *gomock.Call { service_grpc.pb.mock.go
1620 > mr.mock.ctrl.T.Helper()
1621 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockHistoryService_StreamWorkflowReplicationMessagesClient)(nil).CloseSend))
1622 > }
1623
1624 // Context mocks base method.
1652
1653 // Recv mocks base method.
1654 > func (m *MockHistoryService_StreamWorkflowReplicationMessagesClient) Recv() (*historyservice.StreamWorkflowReplicationMessagesResponse, error) { service_grpc.pb.mock.go
1655 > m.ctrl.T.Helper()
1656 > ret := m.ctrl.Call(m, "Recv")
1657 > ret0, _ := ret[0].(*historyservice.StreamWorkflowReplicationMessagesResponse)
1658 > ret1, _ := ret[1].(error)
1659 > return ret0, ret1
1660 > }
1661
1662 // Recv indicates an expected call of Recv.
1663 > func (mr *MockHistoryService_StreamWorkflowReplicationMessagesClientMockRecorder) Recv() *gomock.Call { service_grpc.pb.mock.go
1664 > mr.mock.ctrl.T.Helper()
1665 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockHistoryService_StreamWorkflowReplicationMessagesClient)(nil).Recv))
1666 > }
1667
1668 // RecvMsg mocks base method.
go.temporal.io/server/service/frontend/admin_handler.go 39 introduced LOC · 7 ranges

Open complete file

1994 func (adh *AdminHandler) StreamWorkflowReplicationMessages(
1995 clientCluster adminservice.AdminService_StreamWorkflowReplicationMessagesServer,
1996 > ) (retError error) { admin_handler.go
1997 > defer log.CapturePanic(adh.logger, &retError)
1998 >
1999 > _, serverClusterShardID, err := history.DecodeClusterShardMD(headers.NewGRPCHeaderGetter(clientCluster.Context()))
2000 > if err != nil {
2001 return err
2002 }
2003
2004 > logger := log.With(adh.logger, tag.ShardID(serverClusterShardID.ShardID)) admin_handler.go
2005 > logger.Info("AdminStreamReplicationMessages started.")
2006 > defer logger.Info("AdminStreamReplicationMessages stopped.")
2007 >
2008 > historyStreamCtx, cancel := context.WithCancel(clientCluster.Context())
2009 > defer cancel()
2010 >
2011 > serverCluster, err := adh.historyClient.StreamWorkflowReplicationMessages(historyStreamCtx)
2012 > if err != nil {
2013 return err
2014 }
2015
2016 > shutdownChan := channel.NewShutdownOnce() admin_handler.go
2017 > go func() {
2018 > defer func() {
2019 > shutdownChan.Shutdown()
2020 > err = serverCluster.CloseSend()
2021 > if err != nil {
2022 logger.Error("Failed to close AdminStreamReplicationMessages server", tag.Error(err))
2023 }
2025 }()
2026
2027 > for !shutdownChan.IsShutdown() { admin_handler.go
2028 > req, err := clientCluster.Recv()
2029 > if err != nil {
2030 > logger.Info("AdminStreamReplicationMessages client -> server encountered error", tag.Error(err))
2031 > return
2032 > }
2033 switch attr := req.GetAttributes().(type) {
2034 case *adminservice.StreamWorkflowReplicationMessagesRequest_SyncReplicationState:
2049 }
2050 }()
2051 > go func() { admin_handler.go
2052 > defer shutdownChan.Shutdown()
2053 >
2054 > for !shutdownChan.IsShutdown() {
2055 > resp, err := serverCluster.Recv()
2056 > if err != nil {
2057 > logger.Info("AdminStreamReplicationMessages server -> client encountered error", tag.Error(err))
2058 > var solErr *serviceerrors.ShardOwnershipLost
2059 > var suErr *serviceerror.Unavailable
2060 > if errors.As(err, &solErr) || errors.As(err, &suErr) {
2061 ctx, cl := context.WithTimeout(context.Background(), 2*time.Second)
2062 // getShard here to make sure we will talk to correct host when stream is retrying
2067 cl()
2068 }
2069 > return admin_handler.go
2070 }
2071 switch attr := resp.GetAttributes().(type) {
2090 }
2091 }()
2092 > <-shutdownChan.Channel() admin_handler.go
2093 > return nil
2094 }
2095
go.temporal.io/server/api/adminservicemock/v1/service_grpc.pb.mock.go 29 introduced LOC · 6 ranges

Open complete file

1876
1877 // NewMockAdminService_StreamWorkflowReplicationMessagesServer creates a new mock instance.
1878 > func NewMockAdminService_StreamWorkflowReplicationMessagesServer(ctrl *gomock.Controller) *MockAdminService_StreamWorkflowReplicationMessagesServer { service_grpc.pb.mock.go
1879 > mock := &MockAdminService_StreamWorkflowReplicationMessagesServer{ctrl: ctrl}
1880 > mock.recorder = &MockAdminService_StreamWorkflowReplicationMessagesServerMockRecorder{mock}
1881 > return mock
1882 > }
1883
1884 // EXPECT returns an object that allows the caller to indicate expected use.
1885 > func (m *MockAdminService_StreamWorkflowReplicationMessagesServer) EXPECT() *MockAdminService_StreamWorkflowReplicationMessagesServerMockRecorder { service_grpc.pb.mock.go
1886 > return m.recorder
1887 > }
1888
1889 // Context mocks base method.
1890 > func (m *MockAdminService_StreamWorkflowReplicationMessagesServer) Context() context.Context { service_grpc.pb.mock.go
1891 > m.ctrl.T.Helper()
1892 > ret := m.ctrl.Call(m, "Context")
1893 > ret0, _ := ret[0].(context.Context)
1894 > return ret0
1895 > }
1896
1897 // Context indicates an expected call of Context.
1898 > func (mr *MockAdminService_StreamWorkflowReplicationMessagesServerMockRecorder) Context() *gomock.Call { service_grpc.pb.mock.go
1899 > mr.mock.ctrl.T.Helper()
1900 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockAdminService_StreamWorkflowReplicationMessagesServer)(nil).Context))
1901 > }
1902
1903 // Recv mocks base method.
1904 > func (m *MockAdminService_StreamWorkflowReplicationMessagesServer) Recv() (*adminservice.StreamWorkflowReplicationMessagesRequest, error) { service_grpc.pb.mock.go
1905 > m.ctrl.T.Helper()
1906 > ret := m.ctrl.Call(m, "Recv")
1907 > ret0, _ := ret[0].(*adminservice.StreamWorkflowReplicationMessagesRequest)
1908 > ret1, _ := ret[1].(error)
1909 > return ret0, ret1
1910 > }
1911
1912 // Recv indicates an expected call of Recv.
1913 > func (mr *MockAdminService_StreamWorkflowReplicationMessagesServerMockRecorder) Recv() *gomock.Call { service_grpc.pb.mock.go
1914 > mr.mock.ctrl.T.Helper()
1915 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockAdminService_StreamWorkflowReplicationMessagesServer)(nil).Recv))
1916 > }
1917
1918 // RecvMsg mocks base method.