-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathqueue.go
45 lines (40 loc) · 880 Bytes
/
queue.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
package bulk
type queueT struct {
ty queueType
cnt int
head *bulkT
pending int
}
type queueType int
const (
kQueueBulk queueType = iota
kQueueRead
kQueueSearch
kQueueFleetSearch
kQueueRefreshBulk
kQueueRefreshRead
kQueueAPIKeyUpdate
kNumQueues
)
func (q queueT) Type() string {
switch q.ty {
case kQueueBulk:
return "bulk"
case kQueueRead:
return "read"
case kQueueSearch:
return "search"
case kQueueFleetSearch:
return "fleetSearch"
case kQueueRefreshBulk:
return "refreshBulk"
case kQueueRefreshRead:
return "refreshRead"
case kQueueAPIKeyUpdate:
return "apiKeyUpdate"
}
panic("unknown")
}