|
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" |
@@ -159,7 +159,7 @@ type RetryPolicy interface { |
159 | 159 | // //Assign to a query |
160 | 160 | // query.RetryPolicy(&gocql.SimpleRetryPolicy{NumRetries: 1}) |
161 | 161 | type SimpleRetryPolicy struct { |
162 | | - NumRetries int //Number of times to retry a query |
| 162 | + NumRetries int // Number of times to retry a query |
163 | 163 | } |
164 | 164 |
|
165 | 165 | // Attempt tells gocql to attempt the query again based on query.Attempts being less |
@@ -839,8 +839,8 @@ type dcAwareRR struct { |
839 | 839 | } |
840 | 840 |
|
841 | 841 | // DCAwareRoundRobinPolicy is a host selection policies which will prioritize and |
842 | | -// return hosts which are in the local datacentre before returning hosts in all |
843 | | -// other datercentres |
| 842 | +// return hosts which are in the local datacenter before returning hosts in all |
| 843 | +// other datacenters |
844 | 844 | func DCAwareRoundRobinPolicy(localDC string) HostSelectionPolicy { |
845 | 845 | return &dcAwareRR{local: localDC} |
846 | 846 | } |
@@ -885,7 +885,6 @@ func roundRobbin(shift int, hosts ...[]*HostInfo) NextHost { |
885 | 885 | currentlyObserved := 0 |
886 | 886 |
|
887 | 887 | return func() SelectedHost { |
888 | | - |
889 | 888 | // iterate over layers |
890 | 889 | for { |
891 | 890 | if currentLayer == len(hosts) { |
@@ -921,7 +920,7 @@ func (d *dcAwareRR) Pick(q ExecutableQuery) NextHost { |
921 | 920 |
|
922 | 921 | // RackAwareRoundRobinPolicy is a host selection policies which will prioritize and |
923 | 922 | // return hosts which are in the local rack, before hosts in the local datacenter but |
924 | | -// a different rack, before hosts in all other datercentres |
| 923 | +// a different rack, before hosts in all other datacenters |
925 | 924 |
|
926 | 925 | type rackAwareRR struct { |
927 | 926 | // lastUsedHostIdx keeps the index of the last used host. |
@@ -1031,14 +1030,13 @@ func (s *singleHostReadyPolicy) Ready() bool { |
1031 | 1030 | type ConvictionPolicy interface { |
1032 | 1031 | // Implementations should return `true` if the host should be convicted, `false` otherwise. |
1033 | 1032 | AddFailure(error error, host *HostInfo) bool |
1034 | | - //Implementations should clear out any convictions or state regarding the host. |
| 1033 | + // Implementations should clear out any convictions or state regarding the host. |
1035 | 1034 | Reset(host *HostInfo) |
1036 | 1035 | } |
1037 | 1036 |
|
1038 | 1037 | // SimpleConvictionPolicy implements a ConvictionPolicy which convicts all hosts |
1039 | 1038 | // regardless of error |
1040 | | -type SimpleConvictionPolicy struct { |
1041 | | -} |
| 1039 | +type SimpleConvictionPolicy struct{} |
1042 | 1040 |
|
1043 | 1041 | func (e *SimpleConvictionPolicy) AddFailure(error error, host *HostInfo) bool { |
1044 | 1042 | return true |
|
0 commit comments