Update apache/thrift to 0.11.0 and remove pinning (#1317)
The `apache/thrift` recently released a new version of `0.11.0` several days ago. This release is compatible with other packages and as such, there is no need to pinning the `apache/thrift` to `master` anymore in Gopkg.toml. This fix removes the pinning of `apache/thrift` in Gopkg.toml, and updates all dependencies of coredns. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
parent
ba4e77672c
commit
4dd40a292c
6992 changed files with 30842 additions and 1995023 deletions
32
vendor/github.com/eapache/queue/queue.go
generated
vendored
32
vendor/github.com/eapache/queue/queue.go
generated
vendored
|
@ -7,6 +7,8 @@ The queue implemented here is as fast as it is for an additional reason: it is *
|
|||
*/
|
||||
package queue
|
||||
|
||||
// minQueueLen is smallest capacity that queue may have.
|
||||
// Must be power of 2 for bitwise modulus: x % n == x & (n - 1).
|
||||
const minQueueLen = 16
|
||||
|
||||
// Queue represents a single instance of the queue data structure.
|
||||
|
@ -30,7 +32,7 @@ func (q *Queue) Length() int {
|
|||
// resizes the queue to fit exactly twice its current contents
|
||||
// this can result in shrinking if the queue is less than half-full
|
||||
func (q *Queue) resize() {
|
||||
newBuf := make([]interface{}, q.count*2)
|
||||
newBuf := make([]interface{}, q.count<<1)
|
||||
|
||||
if q.tail > q.head {
|
||||
copy(newBuf, q.buf[q.head:q.tail])
|
||||
|
@ -51,7 +53,8 @@ func (q *Queue) Add(elem interface{}) {
|
|||
}
|
||||
|
||||
q.buf[q.tail] = elem
|
||||
q.tail = (q.tail + 1) % len(q.buf)
|
||||
// bitwise modulus
|
||||
q.tail = (q.tail + 1) & (len(q.buf) - 1)
|
||||
q.count++
|
||||
}
|
||||
|
||||
|
@ -65,24 +68,35 @@ func (q *Queue) Peek() interface{} {
|
|||
}
|
||||
|
||||
// Get returns the element at index i in the queue. If the index is
|
||||
// invalid, the call will panic.
|
||||
// invalid, the call will panic. This method accepts both positive and
|
||||
// negative index values. Index 0 refers to the first element, and
|
||||
// index -1 refers to the last.
|
||||
func (q *Queue) Get(i int) interface{} {
|
||||
// If indexing backwards, convert to positive index.
|
||||
if i < 0 {
|
||||
i += q.count
|
||||
}
|
||||
if i < 0 || i >= q.count {
|
||||
panic("queue: Get() called with index out of range")
|
||||
}
|
||||
return q.buf[(q.head+i)%len(q.buf)]
|
||||
// bitwise modulus
|
||||
return q.buf[(q.head+i)&(len(q.buf)-1)]
|
||||
}
|
||||
|
||||
// Remove removes the element from the front of the queue. If you actually
|
||||
// want the element, call Peek first. This call panics if the queue is empty.
|
||||
func (q *Queue) Remove() {
|
||||
// Remove removes and returns the element from the front of the queue. If the
|
||||
// queue is empty, the call will panic.
|
||||
func (q *Queue) Remove() interface{} {
|
||||
if q.count <= 0 {
|
||||
panic("queue: Remove() called on empty queue")
|
||||
}
|
||||
ret := q.buf[q.head]
|
||||
q.buf[q.head] = nil
|
||||
q.head = (q.head + 1) % len(q.buf)
|
||||
// bitwise modulus
|
||||
q.head = (q.head + 1) & (len(q.buf) - 1)
|
||||
q.count--
|
||||
if len(q.buf) > minQueueLen && q.count*4 == len(q.buf) {
|
||||
// Resize down if buffer 1/4 full.
|
||||
if len(q.buf) > minQueueLen && (q.count<<2) == len(q.buf) {
|
||||
q.resize()
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
|
20
vendor/github.com/eapache/queue/queue_test.go
generated
vendored
20
vendor/github.com/eapache/queue/queue_test.go
generated
vendored
|
@ -12,7 +12,10 @@ func TestQueueSimple(t *testing.T) {
|
|||
if q.Peek().(int) != i {
|
||||
t.Error("peek", i, "had value", q.Peek())
|
||||
}
|
||||
q.Remove()
|
||||
x := q.Remove()
|
||||
if x != i {
|
||||
t.Error("remove", i, "had value", x)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,6 +72,19 @@ func TestQueueGet(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestQueueGetNegative(t *testing.T) {
|
||||
q := New()
|
||||
|
||||
for i := 0; i < 1000; i++ {
|
||||
q.Add(i)
|
||||
for j := 1; j <= q.Length(); j++ {
|
||||
if q.Get(-j).(int) != q.Length()-j {
|
||||
t.Errorf("index %d doesn't contain %d", -j, q.Length()-j)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestQueueGetOutOfRangePanics(t *testing.T) {
|
||||
q := New()
|
||||
|
||||
|
@ -77,7 +93,7 @@ func TestQueueGetOutOfRangePanics(t *testing.T) {
|
|||
q.Add(3)
|
||||
|
||||
assertPanics(t, "should panic when negative index", func() {
|
||||
q.Get(-1)
|
||||
q.Get(-4)
|
||||
})
|
||||
|
||||
assertPanics(t, "should panic when index greater than length", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue