Skip to content

Commit

Permalink
Add placeholder for dynamo visibilityCRUD methods (uber#4244)
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt authored Jun 2, 2021
1 parent 8d3e54e commit 532dfb1
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 3 deletions.
4 changes: 2 additions & 2 deletions common/persistence/nosql/nosqlplugin/cassandra/visibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func (db *cdb) DeleteVisibility(ctx context.Context, domainID, workflowID, runID
func (db *cdb) SelectVisibility(ctx context.Context, filter *nosqlplugin.VisibilityFilter) (*nosqlplugin.SelectVisibilityResponse, error) {
switch filter.FilterType {
case nosqlplugin.AllOpen:
return db.openSortedyByStartTime(ctx, &filter.ListRequest)
return db.openSortedByStartTime(ctx, &filter.ListRequest)
case nosqlplugin.AllClosed:
switch filter.SortType {
case nosqlplugin.SortByStartTime:
Expand Down Expand Up @@ -523,7 +523,7 @@ func (db *cdb) closedFilteredByClosedStatusSortedByClosedTime(
return processQuery(query, request, readClosedWorkflowExecutionRecord)
}

func (db *cdb) openSortedyByStartTime(
func (db *cdb) openSortedByStartTime(
ctx context.Context,
request *persistence.InternalListWorkflowExecutionsRequest,
) (*nosqlplugin.SelectVisibilityResponse, error) {
Expand Down
64 changes: 64 additions & 0 deletions common/persistence/nosql/nosqlplugin/dynamodb/visibility.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright (c) 2021 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package dynamodb

import (
"context"

"github.com/uber/cadence/common/persistence/nosql/nosqlplugin"
)

func (db *ddb) InsertVisibility(
ctx context.Context,
ttlSeconds int64,
row *nosqlplugin.VisibilityRowForInsert,
) error {
panic("TODO")
}

func (db *ddb) UpdateVisibility(
ctx context.Context,
ttlSeconds int64,
row *nosqlplugin.VisibilityRowForUpdate,
) error {
panic("TODO")
}

func (db *ddb) SelectVisibility(
ctx context.Context,
filter *nosqlplugin.VisibilityFilter,
) (*nosqlplugin.SelectVisibilityResponse, error) {
panic("TODO")
}

func (db *ddb) DeleteVisibility(
ctx context.Context,
domainID, workflowID, runID string,
) error {
panic("TODO")
}

func (db *ddb) SelectOneClosedWorkflow(
ctx context.Context,
domainID, workflowID, runID string,
) (*nosqlplugin.VisibilityRow, error) {
panic("TODO")
}
3 changes: 2 additions & 1 deletion service/history/replication/task_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/uber-go/tally"

"github.com/uber/cadence/client"
"github.com/uber/cadence/client/admin"
historyClient "github.com/uber/cadence/client/history"
Expand Down Expand Up @@ -265,4 +266,4 @@ func (s *taskExecutorSuite) TestProcess_SyncActivityReplicationTask_DifferentSha
s.historyClient.EXPECT().SyncActivity(gomock.Any(), request).Return(nil).Times(2)
_, err := s.taskHandler.execute(task, true)
s.NoError(err)
}
}

0 comments on commit 532dfb1

Please sign in to comment.