From be1a8eab2da1fa681182b54069328ae37038a4ce Mon Sep 17 00:00:00 2001 From: Wenquan Xing Date: Thu, 1 Feb 2018 10:43:47 -0800 Subject: [PATCH] move cross DC domain replication config from 0.4 to 0.5 --- common/cluster/metadata.go | 10 +++++----- schema/cadence/versioned/v0.4/manifest.json | 3 +-- .../{v0.4 => v0.5}/add_replication_config.cql | 0 schema/cadence/versioned/v0.5/manifest.json | 8 ++++++++ 4 files changed, 14 insertions(+), 7 deletions(-) rename schema/cadence/versioned/{v0.4 => v0.5}/add_replication_config.cql (100%) create mode 100644 schema/cadence/versioned/v0.5/manifest.json diff --git a/common/cluster/metadata.go b/common/cluster/metadata.go index f4c2a7c2efd..b591322b32c 100644 --- a/common/cluster/metadata.go +++ b/common/cluster/metadata.go @@ -30,7 +30,7 @@ type ( GetAllClusterNames() map[string]bool } - MetadataImpl struct { + metadataImpl struct { // initialFailoverVersion is the initial failover version initialFailoverVersion int64 // failoverVersionIncrement is the increment of each cluster failover version @@ -67,7 +67,7 @@ func NewMetadata(initialFailoverVersion int64, failoverVersionIncrement int64, panic("Current cluster is not specified in all cluster names") } - return &MetadataImpl{ + return &metadataImpl{ initialFailoverVersion: initialFailoverVersion, failoverVersionIncrement: failoverVersionIncrement, currentClusterName: currentClusterName, @@ -76,7 +76,7 @@ func NewMetadata(initialFailoverVersion int64, failoverVersionIncrement int64, } // GetNextFailoverVersion return the next failover version based on input -func (metadata *MetadataImpl) GetNextFailoverVersion(currentFailoverVersion int64) int64 { +func (metadata *metadataImpl) GetNextFailoverVersion(currentFailoverVersion int64) int64 { failoverVersion := currentFailoverVersion/metadata.failoverVersionIncrement + metadata.initialFailoverVersion if failoverVersion < currentFailoverVersion { return failoverVersion + metadata.failoverVersionIncrement @@ -85,11 +85,11 @@ func (metadata *MetadataImpl) GetNextFailoverVersion(currentFailoverVersion int6 } // GetCurrentClusterName return the current cluster name -func (metadata *MetadataImpl) GetCurrentClusterName() string { +func (metadata *metadataImpl) GetCurrentClusterName() string { return metadata.currentClusterName } // GetAllClusterNames return the all cluster names -func (metadata *MetadataImpl) GetAllClusterNames() map[string]bool { +func (metadata *metadataImpl) GetAllClusterNames() map[string]bool { return metadata.clusterNames } diff --git a/schema/cadence/versioned/v0.4/manifest.json b/schema/cadence/versioned/v0.4/manifest.json index 3e9354eb35d..2be817a9d85 100644 --- a/schema/cadence/versioned/v0.4/manifest.json +++ b/schema/cadence/versioned/v0.4/manifest.json @@ -4,7 +4,6 @@ "Description": "add signal_decision to mutable state, add kind to taskList", "SchemaUpdateCqlFiles": [ "add_signal_decision.cql", - "add_tasklist_kind.cql", - "add_replication_config.cql" + "add_tasklist_kind.cql" ] } diff --git a/schema/cadence/versioned/v0.4/add_replication_config.cql b/schema/cadence/versioned/v0.5/add_replication_config.cql similarity index 100% rename from schema/cadence/versioned/v0.4/add_replication_config.cql rename to schema/cadence/versioned/v0.5/add_replication_config.cql diff --git a/schema/cadence/versioned/v0.5/manifest.json b/schema/cadence/versioned/v0.5/manifest.json new file mode 100644 index 00000000000..0cafde63139 --- /dev/null +++ b/schema/cadence/versioned/v0.5/manifest.json @@ -0,0 +1,8 @@ +{ + "CurrVersion": "0.5", + "MinCompatibleVersion": "0.5", + "Description": "add cross DC domain replication config", + "SchemaUpdateCqlFiles": [ + "add_replication_config.cql" + ] +}