id stringlengths 2 7 | text stringlengths 17 51.2k | title stringclasses 1
value |
|---|---|---|
c162200 | normBits1Hit,
includeFreqNorm: includeFreqNorm,
includeLocs: includeLocs,
}, nil
} | |
c162201 | if shift < 0 || shift < 63 {
return uint(shift), nil
}
}
return 0, fmt.Errorf("invalid prefix coded value")
} | |
c162202 |
if ok {
return int(floatVal), nil
}
return 0, fmt.Errorf("failed to convert to int value")
} | |
c162203 | := make([]string, size*sortsize)
// make these initial instances available
i, j := 0, 0
for i < size {
avail[i] = &startBlock[i]
avail[i].Sort = startSorts[j:j]
i += 1
j += sortsize
}
return &DocumentMatchPool{
avail: avail,
TooSmall: defaultDocumentMatchPoolTooSmall,
}
} | |
c162204 | p.avail[:len(p.avail)-1]
} else {
rv = p.TooSmall(p)
}
return rv
} | |
c162205 | to available pool
d.Reset()
p.avail = append(p.avail, d)
} | |
c162206 | &MultiPhraseQuery{
Terms: terms,
Field: field,
}
} | |
c162207 | -1 {
return tag[:idx]
}
return tag
} | |
c162208 |
fieldDict, err := ir.FieldDictRegexp(field, pattern)
if err != nil {
return nil, err
}
defer func() {
if cerr := fieldDict.Close(); cerr != nil && err == nil {
err = cerr
}
}()
var candidateTerms []string
tfd, err := fieldDict.Next()
for err == nil && tfd != nil {
candidateTerms = append(candidat... | |
c162209 | {
svefp := svef.Addr().Interface()
m[svet.Field(i).Name] = atomic.LoadUint64(svefp.(*uint64))
}
}
return m
} | |
c162210 | + len(b.internal.InternalOps)
} | |
c162211 |
b.lastDocSize = 0
b.totalSize = 0
} | |
c162212 | if c.s != nil {
c.s.ReportBytesWritten(uint64(n))
}
return n, err
} | |
c162213 | if s.deleted != nil {
rv.AndNot(s.deleted)
}
return rv
} | |
c162214 | false // found a field not in cache
}
}
c.m.Unlock()
return true
} | |
c162215 | := prealloc.(*PostingsList)
if ok && pl != nil {
preallocPL = pl
}
return d.postingsList(term, except, preallocPL)
} | |
c162216 | rv.itr = itr
} else if err != vellum.ErrIteratorDone {
rv.err = err
}
}
return rv
} | |
c162217 |
if err == nil {
rv.itr = itr
} else if err != vellum.ErrIteratorDone {
rv.err = err
}
}
return rv
} | |
c162218 | if !i.omitCount {
i.err = i.tmp.read(postingsOffset, i.d)
if i.err != nil {
return nil, i.err
}
i.entry.Count = i.tmp.Count()
}
i.err = i.itr.Next()
return &i.entry, nil
} | |
c162219 | true,
Index: true,
IncludeTermVectors: true,
IncludeInAll: true,
DocValues: true,
}
} | |
c162220 | true,
Index: true,
IncludeInAll: true,
DocValues: true,
}
} | |
c162221 | true,
Index: true,
IncludeInAll: true,
DocValues: true,
}
} | |
c162222 | true,
Index: true,
IncludeInAll: true,
DocValues: true,
}
} | |
c162223 | true,
Index: true,
IncludeInAll: true,
DocValues: true,
}
} | |
c162224 | rv |= document.IncludeTermVectors
}
if fm.DocValues {
rv |= document.DocValues
}
return rv
} | |
c162225 | *docValueReader
for _, field := range fields {
if fieldIDPlus1, ok = s.fieldsMap[field]; !ok {
continue
}
fieldID := fieldIDPlus1 - 1
if dvr, ok = dvs.dvrs[fieldID]; ok && dvr != nil {
// check if the chunk is already loaded
if docInChunk != dvr.curChunkNumber() {
err := dvr.loadDvChunk(docInChun... | |
c162226 | 0; i < len(encoder); i++ {
e.dec[encoder[i]] = byte(i)
}
return e
} | |
c162227 | for i := 0; i < len(s); i++ {
x = (x << 5) | uint64(e.dec[s[i]])
}
return x
} | |
c162228 |
return geoBoundingBoxIntWithPrecision(inthash, bits)
} | |
c162229 | maxDecimalPower(b.maxLng - b.minLng)
lng = math.Ceil(b.minLng/x) * x
return
} | |
c162230 | latBits
latErr = math.Ldexp(180.0, -latBits)
lngErr = math.Ldexp(360.0, -lngBits)
return
} | |
c162231 |
m := int(math.Floor(math.Log10(r)))
return math.Pow10(m)
} | |
c162232 | * r)
return uint32(p * exp232)
} | |
c162233 | float64(X) / exp232
x := 2*r*p - r
return x
} | |
c162234 | (X >> 8)) & 0x0000ffff0000ffff
X = (X | (X >> 16)) & 0x00000000ffffffff
return uint32(X)
} | |
c162235 | 180)
latErr, lngErr := errorWithPrecision(bits)
return geoBox{
minLat: lat,
maxLat: lat + latErr,
minLng: lng,
maxLng: lng + lngErr,
}
} | |
c162236 | != nil {
return tw, err
}
// write out the roaring bytes
nw, err = w.Write(buf)
tw += nw
if err != nil {
return tw, err
}
return tw, nil
} | |
c162237 |
found = &NumberCaseState{}
if found.StartSym(sym) {
return found
}
return &NonAlphaNumericCaseState{}
} | |
c162238 | bytes to decode uvarint value: %q", b)
}
var v uint64
// It is faster to range over the elements in a slice than to index
// into the slice on each loop iteration.
for _, t := range b[:length] {
v = (v << 8) | uint64(t)
}
return b[length:], v, nil
} | |
c162239 | < 0 {
return 0
}
return n
} | |
c162240 | r.C++
if b < 0x80 {
return
}
}
} | |
c162241 |
r.C = r.C + count
} | |
c162242 | case w.Errors <- ErrEventOverflow:
case <-w.done:
return
}
}
// If the event happened to the watched directory or the watched file, the kernel
// doesn't append the filename to the event, but we would like to always fill the
// the "Name" field with a valid filename. We retrieve the path o... | |
c162243 | will come or has come if the file doesn't exist.
if !(e.Op&Remove == Remove || e.Op&Rename == Rename) {
_, statErr := os.Lstat(e.Name)
return os.IsNotExist(statErr)
}
return false
} | |
c162244 |
e.Op |= Write
}
if mask&unix.IN_MOVE_SELF == unix.IN_MOVE_SELF || mask&unix.IN_MOVED_FROM == unix.IN_MOVED_FROM {
e.Op |= Rename
}
if mask&unix.IN_ATTRIB == unix.IN_ATTRIB {
e.Op |= Chmod
}
return e
} | |
c162245 | // Look for a file that may have overwritten this.
// For example, mv f1 f2 will delete f2, then create f2.
if path.isDir {
fileDir := filepath.Clean(event.Name)
w.mu.Lock()
_, found := w.watches[fileDir]
w.mu.Unlock()
if found {
// make sure the directory exists before we watch ... | |
c162246 | mask&unix.NOTE_WRITE == unix.NOTE_WRITE {
e.Op |= Write
}
if mask&unix.NOTE_RENAME == unix.NOTE_RENAME {
e.Op |= Rename
}
if mask&unix.NOTE_ATTRIB == unix.NOTE_ATTRIB {
e.Op |= Chmod
}
return e
} | |
c162247 | range files {
filePath := filepath.Join(dirPath, fileInfo.Name())
filePath, err = w.internalWatch(filePath, fileInfo)
if err != nil {
return err
}
w.mu.Lock()
w.fileExists[filePath] = true
w.mu.Unlock()
}
return nil
} | |
c162248 | case <-w.done:
return
}
}
// Search for new files
for _, fileInfo := range files {
filePath := filepath.Join(dirPath, fileInfo.Name())
err := w.sendFileCreatedEventIfNew(filePath, fileInfo)
if err != nil {
return
}
}
} | |
c162249 | case w.Events <- newCreateEvent(filePath):
case <-w.done:
return
}
}
// like watchDirectoryFiles (but without doing another ReadDir)
filePath, err = w.internalWatch(filePath, fileInfo)
if err != nil {
return err
}
w.mu.Lock()
w.fileExists[filePath] = true
w.mu.Unlock()
return nil
} | |
c162250 | return kq, err
}
return kq, nil
} | |
c162251 | // register the events
success, err := unix.Kevent(kq, changes, nil, nil)
if success == -1 {
return err
}
return nil
} | |
c162252 | timeout)
if err != nil {
return nil, err
}
return events[0:n], nil
} | |
c162253 | {
return unix.NsecToTimespec(d.Nanoseconds())
} | |
c162254 | Events: unix.EPOLLIN,
}
errno = unix.EpollCtl(poller.epfd, unix.EPOLL_CTL_ADD, poller.fd, &event)
if errno != nil {
return nil, errno
}
// Register pipe fd with epoll
event = unix.EpollEvent{
Fd: int32(poller.pipe[0]),
Events: unix.EPOLLIN,
}
errno = unix.EpollCtl(poller.epfd, unix.EPOLL_CTL_ADD, po... | |
c162255 | }
}
if event.Fd == int32(poller.pipe[0]) {
if event.Events&unix.EPOLLHUP != 0 {
// Write pipe descriptor was closed, by us. This means we're closing down the
// watcher, and we should wake up.
}
if event.Events&unix.EPOLLERR != 0 {
// If an error is waiting on the pipe file descriptor.... | |
c162256 | Buffer is full, poller will wake.
return nil
}
return errno
}
return nil
} | |
c162257 | unix.Close(poller.pipe[0])
}
if poller.epfd != -1 {
unix.Close(poller.epfd)
}
} | |
c162258 | return true
}
controllerManager.UpdateController(fmt.Sprintf("add-derivative-cnp-%s", cnp.ObjectMeta.Name),
controller.ControllerParams{
DoFunc: func(ctx context.Context) error {
return addDerivativeCNP(cnp)
},
})
return true
} | |
c162259 | err := k8s.CiliumClient().CiliumV2().CiliumNetworkPolicies(cnp.ObjectMeta.Namespace).DeleteCollection(
&v1.DeleteOptions{},
v1.ListOptions{LabelSelector: fmt.Sprintf("%s=%s", parentCNP, cnp.ObjectMeta.UID)})
if err != nil {
return err
}
DeleteDerivativeFromCache(cnp)
return nil
} | |
c162260 | for %s: %s", cmd.Args, ctx.Err())
}
if err != nil {
if verbose {
scopedLog.WithError(err).WithField("cmd", cmd.Args).Error("Command execution failed")
scanner := bufio.NewScanner(bytes.NewReader(out))
scan:
for scanner.Scan() {
text := scanner.Text()
for _, filter := range filters {
if str... | |
c162261 | *Cmd {
return &Cmd{
Cmd: exec.CommandContext(ctx, prog, args...),
ctx: ctx,
}
} | |
c162262 | cmd := CommandContext(ctx, prog, args...)
cmd.cancelFn = cancel
return cmd
} | |
c162263 | = append(c.filters, filters...)
return c
} | |
c162264 | c.filters, scopedLog, verbose)
if c.cancelFn != nil {
c.cancelFn()
}
return out, err
} | |
c162265 | datapathConfig: datapathConfig,
nodes: map[node.Identity]*node.Node{},
}
} | |
c162266 | log.WithFields(logrus.Fields{
logfields.IPAddr: newIP,
"allocCIDR": newCIDR,
}).Debug("Updating tunnel map entry")
if err := tunnel.TunnelMap.SetTunnelEndpoint(newEncryptKey, newCIDR.IP, newIP); err != nil {
log.WithError(err).WithFields(logrus.Fields{
"allocCIDR": newCIDR,
}).Error("bpf: Una... | |
c162267 |
_, err := route.Upsert(n.createNodeIPSecOutRoute(ip), n.nodeConfig.MtuConfig)
if err != nil {
log.WithError(err).Error("Unable to replace the IPSec route OUT the host routing table")
}
} | |
c162268 | been disabled, remove route
n.deleteNodeRoute(n.nodeAddressing.IPv4().AllocationCIDR())
n.deleteNodeRoute(n.nodeAddressing.IPv6().AllocationCIDR())
}
if !n.isInitialized {
n.isInitialized = true
if !n.nodeConfig.UseSingleClusterRoute {
for _, unlinkedNode := range n.nodes {
n.nodeUpdate(nil, unlinked... | |
c162269 | return n.nodeUpdate(nil, &nodeToValidate, false)
} | |
c162270 | time.Duration) *GetEndpointIDConfigParams {
o.SetTimeout(timeout)
return o
} | |
c162271 | context.Context) *GetEndpointIDConfigParams {
o.SetContext(ctx)
return o
} | |
c162272 | *http.Client) *GetEndpointIDConfigParams {
o.SetHTTPClient(client)
return o
} | |
c162273 | string) *GetEndpointIDConfigParams {
o.SetID(id)
return o
} | |
c162274 | kubeconfigPath
if IsEnabled() &&
config.APIServer != "" &&
!strings.HasPrefix(apiServer, "http") {
config.APIServer = "http://" + apiServer
}
} | |
c162275 | (os.Getenv("KUBERNETES_SERVICE_HOST") != "" &&
os.Getenv("KUBERNETES_SERVICE_PORT") != "")
} | |
c162276 | p := strings.Split(s, ":")
if len(p) >= 3 && p[0] == grpName {
return strconv.Atoi(p[2])
}
}
return -1, fmt.Errorf("group %q not found", grpName)
} | |
c162277 | socketPath, err)
}
}
if err := os.Chmod(socketPath, SocketFileMode); err != nil {
return fmt.Errorf("failed while setting up %s's file"+
" permissions in %q: %s", CiliumGroupName, socketPath, err)
}
return nil
} | |
c162278 | mapPrefix, name)
}
return mapPathFromMountInfo(name)
} | |
c162279 | fmt.Sprintf("%s%05d", name, id)
} | |
c162280 | MapPath(LocalMapName(name, id))
} | |
c162281 | GetMapRoot()),
fmt.Sprintf("TC_BPF_MNT=%s", GetMapRoot()),
)
} | |
c162282 | != nil {
return fmt.Errorf("unable to create bpf mount directory: %s", err)
}
} else {
return fmt.Errorf("failed to stat the mount path %s: %s", mapRoot, err)
}
} else if !mapRootStat.IsDir() {
return fmt.Errorf("%s is a file which is not a directory", mapRoot)
}
if err := syscall.Mount(mapRoot, m... | |
c162283 | if mountInfo.Root == "/" && mountInfo.MountPoint == mapRoot {
num++
}
}
return num > 1, nil
} | |
c162284 | append(backends, fmt.Sprintf("%s/%s", net.JoinHostPort(ip, strconv.Itoa(int(port.Port))), port.Protocol))
}
}
sort.Strings(backends)
return strings.Join(backends, ",")
} | |
c162285 | := range e.Backends {
ports2, ok := o.Backends[ip1]
if !ok {
return false
}
if !ports1.DeepEquals(ports2) {
return false
}
}
return true
} | |
c162286 | if len(invalid) > 0 {
return nil, fmt.Errorf("invalid IPs specified as backends: %+v", invalid)
}
return valid, nil
} | |
c162287 | svc.ObjectMeta.Name,
Namespace: svc.ObjectMeta.Namespace,
}
} | |
c162288 | lbPort := loadbalancer.NewL4Addr(loadbalancer.L4Type(port.Protocol), uint16(port.Port))
backend[port.Name] = lbPort
}
}
}
return ParseEndpointsID(ep), endpoints
} | |
c162289 | return v1.NamespaceDefault
}
return ns
} | |
c162290 | GetObjNamespaceName(obj) + "/" + string(obj.GetUID())
} | |
c162291 |
fmt.Fprintf(w, "%s\t%s\n", v, text)
}
for _, v := range lbls.Disabled {
text := color.Red("Disabled")
fmt.Fprintf(w, "%s\t%s\n", v, text)
}
w.Flush()
} | |
c162292 | instead of %d", feL3n4Addr.L3n4Addr.String(), feAddr.ID, feL3n4Addr.ID)
}
}
feAddr256Sum := feAddr.L3n4Addr.SHA256Sum()
feL3n4Addr256Sum := feL3n4Addr.L3n4Addr.SHA256Sum()
if feAddr256Sum != feL3n4Addr256Sum {
return false, fmt.Errorf("service ID %d is already registered to L3n4Addr %s, please choose a diffe... | |
c162293 | d.loadBalancer.BPFMapMU.Unlock()
return d.svcDeleteByFrontendLocked(frontend)
} | |
c162294 | locked.
beCpy := []loadbalancer.LBBackEnd{}
for _, v := range v.BES {
beCpy = append(beCpy, v)
}
return &loadbalancer.LBSVC{
FE: *v.FE.DeepCopy(),
BES: beCpy,
}
} | |
c162295 | := lbmap.UpdateRevNat(revNATK, revNATV)
if err != nil {
return err
}
d.loadBalancer.RevNATMap[id] = *revNAT.DeepCopy()
return nil
} | |
c162296 |
// TODO should we delete even if err is != nil?
if err == nil {
delete(d.loadBalancer.RevNATMap, id)
}
return err
} | |
c162297 | }
}
// TODO should we delete even if err is != nil?
d.loadBalancer.RevNATMap = map[loadbalancer.ServiceID]loadbalancer.L3n4Addr{}
return nil
} | |
c162298 |
defer d.loadBalancer.BPFMapMU.RUnlock()
revNAT, ok := d.loadBalancer.RevNATMap[id]
if !ok {
return nil, nil
}
return revNAT.DeepCopy(), nil
} | |
c162299 |
for k, v := range d.loadBalancer.RevNATMap {
dump = append(dump, loadbalancer.L3n4AddrID{
ID: loadbalancer.ID(k),
L3n4Addr: *v.DeepCopy(),
})
}
return dump, nil
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.