|
24 | 24 |
|
25 | 25 | package gocql |
26 | 26 |
|
27 | | -//This file will be the future home for more policies |
| 27 | +// This file will be the future home for more policies |
28 | 28 |
|
29 | 29 | import ( |
30 | 30 | "context" |
@@ -157,7 +157,7 @@ type RetryPolicy interface { |
157 | 157 | // //Assign to a query |
158 | 158 | // query.RetryPolicy(&gocql.SimpleRetryPolicy{NumRetries: 1}) |
159 | 159 | type SimpleRetryPolicy struct { |
160 | | - NumRetries int //Number of times to retry a query |
| 160 | + NumRetries int // Number of times to retry a query |
161 | 161 | } |
162 | 162 |
|
163 | 163 | // Attempt tells gocql to attempt the query again based on query.Attempts being less |
@@ -696,8 +696,8 @@ type dcAwareRR struct { |
696 | 696 | } |
697 | 697 |
|
698 | 698 | // DCAwareRoundRobinPolicy is a host selection policies which will prioritize and |
699 | | -// return hosts which are in the local datacentre before returning hosts in all |
700 | | -// other datercentres |
| 699 | +// return hosts which are in the local datacenter before returning hosts in all |
| 700 | +// other datacenters |
701 | 701 | func DCAwareRoundRobinPolicy(localDC string) HostSelectionPolicy { |
702 | 702 | return &dcAwareRR{local: localDC} |
703 | 703 | } |
@@ -742,7 +742,6 @@ func roundRobbin(shift int, hosts ...[]*HostInfo) NextHost { |
742 | 742 | currentlyObserved := 0 |
743 | 743 |
|
744 | 744 | return func() SelectedHost { |
745 | | - |
746 | 745 | // iterate over layers |
747 | 746 | for { |
748 | 747 | if currentLayer == len(hosts) { |
@@ -778,7 +777,7 @@ func (d *dcAwareRR) Pick(q ExecutableQuery) NextHost { |
778 | 777 |
|
779 | 778 | // RackAwareRoundRobinPolicy is a host selection policies which will prioritize and |
780 | 779 | // return hosts which are in the local rack, before hosts in the local datacenter but |
781 | | -// a different rack, before hosts in all other datercentres |
| 780 | +// a different rack, before hosts in all other datacenters |
782 | 781 |
|
783 | 782 | type rackAwareRR struct { |
784 | 783 | // lastUsedHostIdx keeps the index of the last used host. |
@@ -888,14 +887,13 @@ func (s *singleHostReadyPolicy) Ready() bool { |
888 | 887 | type ConvictionPolicy interface { |
889 | 888 | // Implementations should return `true` if the host should be convicted, `false` otherwise. |
890 | 889 | AddFailure(error error, host *HostInfo) bool |
891 | | - //Implementations should clear out any convictions or state regarding the host. |
| 890 | + // Implementations should clear out any convictions or state regarding the host. |
892 | 891 | Reset(host *HostInfo) |
893 | 892 | } |
894 | 893 |
|
895 | 894 | // SimpleConvictionPolicy implements a ConvictionPolicy which convicts all hosts |
896 | 895 | // regardless of error |
897 | | -type SimpleConvictionPolicy struct { |
898 | | -} |
| 896 | +type SimpleConvictionPolicy struct{} |
899 | 897 |
|
900 | 898 | func (e *SimpleConvictionPolicy) AddFailure(error error, host *HostInfo) bool { |
901 | 899 | return true |
|
0 commit comments