Skip to content

Commit

Permalink
move cross DC domain replication config from 0.4 to 0.5 (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
wxing1292 authored Feb 1, 2018
1 parent 952e86d commit d429f53
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
10 changes: 5 additions & 5 deletions common/cluster/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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
}
3 changes: 1 addition & 2 deletions schema/cadence/versioned/v0.4/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
8 changes: 8 additions & 0 deletions schema/cadence/versioned/v0.5/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"CurrVersion": "0.5",
"MinCompatibleVersion": "0.5",
"Description": "add cross DC domain replication config",
"SchemaUpdateCqlFiles": [
"add_replication_config.cql"
]
}
2 changes: 1 addition & 1 deletion tools/cassandra/updateTask_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (s *UpdateSchemaTestSuite) TestDryrun() {
s.Nil(err)
// update the version to the latest
s.log.Infof("Ver: %v", ver)
s.Equal(0, cmpVersion(ver, "0.4"))
s.Equal(0, cmpVersion(ver, "0.5"))

dropAllTablesTypes(client)
}
Expand Down

0 comments on commit d429f53

Please sign in to comment.