Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customized data map to domain type #863

Merged
merged 7 commits into from
Jun 21, 2018

Conversation

longquanzheng
Copy link
Contributor

@longquanzheng longquanzheng commented Jun 19, 2018

Tested manually.
I will add CLI support after adding the thrift change to cadence-client repo and make a release.

longer@~/gocode/src/github.com/uber/cadence:(domain_data)$ yab -p 127.0.0.1:7933 --service cadence-frontend -t idl/github.com/uber/cadence/cadence.thrift  -m WorkflowService::RegisterDomain -r '{
>     "registerRequest": {
>         "name": "testdm1",
>         "description": "abc",
>         "ownerEmail": "lg@uber.com",
>         "workflowExecutionRetentionPeriodInDays": 123,
>         "emitMetric": true,
>         "clusters":[],
>         "data": {
>             "k1 ": "v1"
>         }
>     }
> }'
{
  "body": {},
  "ok": true,
  "trace": "0"
}

longer@~/gocode/src/github.com/uber/cadence:(domain_data)$ yab -p 127.0.0.1:7933 --service cadence-frontend -t idl/github.com/uber/cadence/cadence.thrift  -m WorkflowService::DescribeDomain -r '
>
longer@~/gocode/src/github.com/uber/cadence:(domain_data)$ yab -p 127.0.0.1:7933 --service cadence-frontend -t idl/github.com/uber/cadence/cadence.thrift  -m WorkflowService::DescribeDomain -r '{"describeRequest":{"name":"testdm1"}}'
{
  "body": {
    "result": {
      "configuration": {
        "emitMetric": true,
        "workflowExecutionRetentionPeriodInDays": 123
      },
      "domainInfo": {
        "data": {
          "k1 ": "v1"
        },
        "description": "abc",
        "name": "testdm1",
        "ownerEmail": "lg@uber.com",
        "status": "REGISTERED"
      },
      "failoverVersion": 0,
      "isGlobalDomain": false,
      "replicationConfiguration": {
        "activeClusterName": "active",
        "clusters": [
          {
            "clusterName": "active"
          }
        ]
      }
    }
  },
  "ok": true,
  "trace": "0"
}

longer@~/gocode/src/github.com/uber/cadence:(domain_data)$ yab -p 127.0.0.1:7933 --service cadence-frontend -t idl/github.com/uber/cadence/cadence.thrift  -m WorkflowService::UpdateDomain -r '
>
longer@~/gocode/src/github.com/uber/cadence:(domain_data)$ yab -p 127.0.0.1:7933 --service cadence-frontend -t idl/github.com/uber/cadence/cadence.thrift  -m WorkflowService::UpdateDomain -r '{"updateRequest":{"name":"testdm1","updatedInfo":{"data":{"k2":"v2"}}}}'
{
  "body": {
    "result": {
      "configuration": {
        "emitMetric": true,
        "workflowExecutionRetentionPeriodInDays": 123
      },
      "domainInfo": {
        "data": {
          "k1 ": "v1",
          "k2": "v2"
        },
        "description": "abc",
        "name": "testdm1",
        "ownerEmail": "lg@uber.com",
        "status": "REGISTERED"
      },
      "failoverVersion": 0,
      "isGlobalDomain": false,
      "replicationConfiguration": {
        "activeClusterName": "active",
        "clusters": [
          {
            "clusterName": "active"
          }
        ]
      }
    }
  },
  "ok": true,
  "trace": "0"
}

longer@~/gocode/src/github.com/uber/cadence:(domain_data)$ yab -p 127.0.0.1:7933 --service cadence-frontend -t idl/github.com/uber/cadence/cadence.thrift  -m WorkflowService::DescribeDomain -r '{"describeRequest":{"name":"testdm1"}}'
{
  "body": {
    "result": {
      "configuration": {
        "emitMetric": true,
        "workflowExecutionRetentionPeriodInDays": 123
      },
      "domainInfo": {
        "data": {
          "k1 ": "v1",
          "k2": "v2"
        },
        "description": "abc",
        "name": "testdm1",
        "ownerEmail": "lg@uber.com",
        "status": "REGISTERED"
      },
      "failoverVersion": 0,
      "isGlobalDomain": false,
      "replicationConfiguration": {
        "activeClusterName": "active",
        "clusters": [
          {
            "clusterName": "active"
          }
        ]
      }
    }
  },
  "ok": true,
  "trace": "0"
}

@longquanzheng longquanzheng changed the title Add data to domain type Add customized data map to domain type Jun 20, 2018
Copy link
Contributor

@samarabbas samarabbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Can you also add a test for inserting new values to the data map. Cover both situations where you add a new value and also update an existing value.
Also add a test for concurrent updates to data map.

@longquanzheng longquanzheng merged commit 710b688 into cadence-workflow:master Jun 21, 2018
@longquanzheng longquanzheng deleted the domain_data branch January 5, 2020 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants