From ba98a3b1e47c101a49fabafde23ea47a4f7c993d Mon Sep 17 00:00:00 2001 From: Wenquan Xing Date: Tue, 27 Mar 2018 10:41:33 -0700 Subject: [PATCH] fix comments --- service/history/historyTestBase.go | 10 ++++++---- service/history/shardContext.go | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/service/history/historyTestBase.go b/service/history/historyTestBase.go index d26c0943314..d29e7f242a0 100644 --- a/service/history/historyTestBase.go +++ b/service/history/historyTestBase.go @@ -138,13 +138,14 @@ func (s *TestShardContext) GetTransferAckLevel() int64 { s.RLock() defer s.RUnlock() - // TODO change make this cluster input parameter + // TODO cluster should be an input parameter cluster := s.GetService().GetClusterMetadata().GetCurrentClusterName() - // if can find corresponding ack level in the cluster to timer ack level map + // if we can find corresponding ack level if ackLevel, ok := s.shardInfo.ClusterTransferAckLevel[cluster]; ok { return ackLevel } // otherwise, default to existing ack level, which belongs to local cluster + // this can happen if you add more cluster return s.shardInfo.TransferAckLevel } @@ -153,7 +154,7 @@ func (s *TestShardContext) UpdateTransferAckLevel(ackLevel int64) error { s.RLock() defer s.RUnlock() - // TODO change make this cluster input parameter + // TODO cluster should be an input parameter cluster := s.GetService().GetClusterMetadata().GetCurrentClusterName() if cluster == s.GetService().GetClusterMetadata().GetCurrentClusterName() { s.shardInfo.TransferAckLevel = ackLevel @@ -172,11 +173,12 @@ func (s *TestShardContext) GetTimerAckLevel(cluster string) time.Time { s.RLock() defer s.RUnlock() - // if can find corresponding ack level in the cluster to timer ack level map + // if we can find corresponding ack level if ackLevel, ok := s.shardInfo.ClusterTimerAckLevel[cluster]; ok { return ackLevel } // otherwise, default to existing ack level, which belongs to local cluster + // this can happen if you add more cluster return s.shardInfo.TimerAckLevel } diff --git a/service/history/shardContext.go b/service/history/shardContext.go index 04e95a6842c..8d87c914e1c 100644 --- a/service/history/shardContext.go +++ b/service/history/shardContext.go @@ -121,13 +121,14 @@ func (s *shardContextImpl) GetTransferAckLevel() int64 { s.RLock() defer s.RUnlock() - // TODO change make this cluster input parameter + // TODO cluster should be an input parameter cluster := s.GetService().GetClusterMetadata().GetCurrentClusterName() - // if can find corresponding ack level in the cluster to timer ack level map + // if we can find corresponding ack level if ackLevel, ok := s.shardInfo.ClusterTransferAckLevel[cluster]; ok { return ackLevel } // otherwise, default to existing ack level, which belongs to local cluster + // this can happen if you add more cluster return s.shardInfo.TransferAckLevel } @@ -141,7 +142,7 @@ func (s *shardContextImpl) UpdateTransferAckLevel(ackLevel int64) error { s.Lock() defer s.Unlock() - // TODO change make this cluster input parameter + // TODO cluster should be an input parameter cluster := s.GetService().GetClusterMetadata().GetCurrentClusterName() if cluster == s.GetService().GetClusterMetadata().GetCurrentClusterName() { s.shardInfo.TransferAckLevel = ackLevel @@ -155,11 +156,12 @@ func (s *shardContextImpl) GetTimerAckLevel(cluster string) time.Time { s.RLock() defer s.RUnlock() - // if can find corresponding ack level in the cluster to timer ack level map + // if we can find corresponding ack level if ackLevel, ok := s.shardInfo.ClusterTimerAckLevel[cluster]; ok { return ackLevel } // otherwise, default to existing ack level, which belongs to local cluster + // this can happen if you add more cluster return s.shardInfo.TimerAckLevel }