id stringlengths 2 7 | text stringlengths 17 51.2k | title stringclasses 1
value |
|---|---|---|
c13000 | != nil {
resp.Close()
}
return nil, errNotHTTPCli
}
if debug {
log.Println("master changed?")
}
location, ok := buildNewEndpoint(res.Header.Get("Location"), cli.Endpoint())
if !ok {
return nil, errBadLocation
}
res.Close()
return nil, &mesosRedirectionError{location}
})
} | |
c13001 | case scheduler.Call_DECLINE_INVERSE_OFFERS:
c.DeclineInverseOffers.Filters = mesos.OptionalFilters(fo...)
default:
panic("filters not supported for type " + c.Type.String())
}
}
} | |
c13002 | return Filters(func(f *mesos.Filters) {
s := time.Duration(r.Int63n(int64(d))).Seconds()
f.RefuseSeconds = &s
})
} | |
c13003 | Filters(func(f *mesos.Filters) {
f.RefuseSeconds = &asFloat
})
} | |
c13004 | FrameworkID: info.GetID(),
Subscribe: &scheduler.Call_Subscribe{FrameworkInfo: info},
}
} | |
c13005 |
return &scheduler.Call{
Type: scheduler.Call_ACCEPT,
Accept: &scheduler.Call_Accept{
OfferIDs: offerIDs,
Operations: ab.operations,
},
}
} | |
c13006 | AcceptInverseOffers: &scheduler.Call_AcceptInverseOffers{
InverseOfferIDs: offerIDs,
},
}
} | |
c13007 | DeclineInverseOffers: &scheduler.Call_DeclineInverseOffers{
InverseOfferIDs: offerIDs,
},
}
} | |
c13008 |
Launch: &mesos.Offer_Operation_Launch{
TaskInfos: ti,
},
}
} | |
c13009 |
Type: scheduler.Call_REVIVE,
Revive: &scheduler.Call_Revive{Roles: roles},
}
} | |
c13010 | Suppress: &scheduler.Call_Suppress{Roles: roles},
}
} | |
c13011 |
Type: scheduler.Call_DECLINE,
Decline: &scheduler.Call_Decline{
OfferIDs: offerIDs,
},
}
} | |
c13012 | mesos.TaskID{Value: taskID},
AgentID: optionalAgentID(agentID),
},
}
} | |
c13013 |
Shutdown: &scheduler.Call_Shutdown{
ExecutorID: mesos.ExecutorID{Value: executorID},
AgentID: mesos.AgentID{Value: agentID},
},
}
} | |
c13014 |
Acknowledge: &scheduler.Call_Acknowledge{
AgentID: mesos.AgentID{Value: agentID},
TaskID: mesos.TaskID{Value: taskID},
UUID: uuid,
},
}
} | |
c13015 |
Reconcile: (&scheduler.Call_Reconcile{}).With(opts...),
}
} | |
c13016 | mesos.AgentID{Value: agentID},
ExecutorID: mesos.ExecutorID{Value: executorID},
Data: data,
},
}
} | |
c13017 |
Type: scheduler.Call_REQUEST,
Request: &scheduler.Call_Request{
Requests: requests,
},
}
} | |
c13018 | optionalAgentID(req[i].AgentID),
ResourceProviderID: optionalResourceProviderID(req[i].ResourceProviderID),
})
}
return &scheduler.Call{
Type: scheduler.Call_RECONCILE_OPERATIONS,
ReconcileOperations: &scheduler.Call_ReconcileOperations{
Operations: operations,
},
}
} | |
c13019 | return true
}
return f(o)
} | |
c13020 | return FilterFunc(func(o *mesos.Offer) bool {
return o.Hostname == hostname
})
} | |
c13021 | FilterFunc(func(o *mesos.Offer) bool {
return f(o.Attributes)
})
} | |
c13022 | return resources.ContainsAll(resources.Flatten(mesos.Resources(o.Resources)), wanted)
})
} | |
c13023 |
code: code,
message: ErrorTable[code],
}
if details != "" {
err.message = err.message + ": " + details
}
return err
} | |
c13024 | as of right now, a client cannot distinguish between
// these cases.
// https://issues.apache.org/jira/browse/MESOS-7697
case CodeRateLimitExceeded, CodeMesosUnavailable:
return true
default:
return false
}
} | |
c13025 | = CodesIndicatingSubscriptionLoss[e.code]
return
} | |
c13026 | err.(*Error)
return ok && apiErr.code == code
} | |
c13027 | it for reporting delivery errors.
return sessionid.NewContext(context.TODO(), driver.connection.String())
} | |
c13028 |
master := msg.Master
if master != nil {
log.Infof("New master %s detected\n", master.GetPid())
pid, err := upid.Parse(master.GetPid())
if err != nil {
panic("Unable to parse Master's PID value.") // this should not happen.
}
driver.masterPid = pid // save for downstream ops.
defer driver.tryAuthent... | |
c13029 | err := driver.authenticate(masterPid, authenticating); err != nil {
log.Errorf("Scheduler failed to authenticate: %v\n", err)
if err == auth.AuthenticationFailed {
result.Completed = proto.Bool(true)
}
} else {
result.Completed = proto.Bool(true)
result.Success = proto.Bool(true)
}
pi... | |
c13030 | return driver.status == mesos.Status_DRIVER_RUNNING
} | |
c13031 |
// update uuid check here, until then we must still check for
// this being sent from the driver (from == UPID()) or from
// the master (pid == UPID()).
// TODO(vinod): Get rid of this logic in 0.25.0 because master
// and slave correctly set task status in 0.24.0.
if clearUUID := len(msg.Update.Uuid) == 0 || fr... | |
c13032 | driver.messenger.Route(context.TODO(), driver.self, &mesos.InternalMasterChangeDetected{
Master: m,
})
})
if driver.masterDetector != nil {
// register with Detect() AFTER we have a self pid from the messenger, otherwise things get ugly
// because our internal messaging depends on it. detector callbacks a... | |
c13033 | defer t.Stop()
driver.eventLock.Unlock()
defer func() {
driver.eventLock.Lock()
stat = driver.status
}()
waitForDeath:
for {
select {
case <-driver.done:
break waitForDeath
case <-t.C:
}
t.Reset(timeout)
}
return
} | |
c13034 | driver.eventLock.Unlock()
return driver.run(driver.context())
} | |
c13035 | %s:", mesos.Status_DRIVER_RUNNING, driver.status)
}
log.Infoln("Scheduler driver running. Waiting to be stopped.")
return driver.join()
} | |
c13036 | defer driver.eventLock.Unlock()
return driver.stop(driver.context(), nil, failover)
} | |
c13037 | driver.stop(ctx, cause, true)
} else {
driver._stop(cause, mesos.Status_DRIVER_ABORTED)
}
stat = mesos.Status_DRIVER_ABORTED
driver.status = stat
return
} | |
c13038 | taskInfo.Executor.ExecutorId,
Timestamp: proto.Float64(float64(time.Now().Unix())),
},
Pid: proto.String(driver.self.String()),
}
// put it on internal chanel
// will cause handler to push to attached Scheduler
driver.statusUpdated(ctx, driver.self, msg)
} | |
c13039 | {
log.V(3).Infoln("Ignoring error message, the driver is aborted!")
return
}
driver.abort(ctx, &ErrDriverAborted{Reason: err})
} | |
c13040 | ok bool) {
name, ok = ctx.Value(loginProviderNameKey).(string)
return
} | |
c13041 | _ := LoginProviderFrom(ctx)
return name
} | |
c13042 | *mesosproto.FrameworkInfo, *mesosproto.SlaveInfo) {
e.Called()
} | |
c13043 |
if err != nil {
return err
}
return w.WriteFrame(b)
})
} | |
c13044 | json.Unmarshal)
return encoding.DecoderFunc(func(u encoding.Unmarshaler) error { return dec.Decode(u) })
} | |
c13045 | agent.Call_AttachContainerInput_CONTAINER_ID,
ContainerID: &cid,
},
}
} | |
c13046 | threshold: int32(threshold),
checkDuration: checkDuration,
stop: make(chan struct{}),
ch: make(chan time.Time, 1),
tr: tr,
}
if timeout == 0 {
checker.client.Timeout = defaultTimeout
}
if checkDuration == 0 {
checker.checkDuration = defaultCheckDuration
}
if thresho... | |
c13047 | defer s.RUnlock()
x = s.paused
if s.slaveUPID != nil {
y = *s.slaveUPID
}
return
}(); !paused {
s.doCheck(slavepid)
}
case <-s.stop:
return
}
}
}()
return s.ch
} | |
c13048 | defer s.Unlock()
s.paused = true
} | |
c13049 | {
s.Lock()
defer s.Unlock()
s.paused = false
s.slaveUPID = slaveUPID
} | |
c13050 | how important this is; if there's an error ack'ing
// because we beacame disconnected, then we'll just reconnect later and
// Mesos will ask us to ACK anyway -- why pay special attention to these
// call failures vs others?
err = &calls.AckError{Ack: ack, Cause: err}
return ctx, e, Error2(orig... | |
c13051 | }
}
return func(e *scheduler.Event) { log.Println(eventLabel, e) }
} | |
c13052 | Rule(func(ctx context.Context, e *scheduler.Event, err error, chain Chain) (context.Context, *scheduler.Event, error) {
f(e)
return chain(ctx, e, err)
})
} | |
c13053 | }
ack := calls.AcknowledgeOperationStatus(
"", // agentID: optional
rpID, // optional
uuid,
opID,
)
err = calls.CallNoData(ctx, callerLookup(), ack)
if err != nil {
// TODO(jdef): not sure how important this is; if there's an error ack'ing
// because we became disconne... | |
c13054 | c.subscriptionTerminated = handler
return WithSubscriptionTerminated(old)
}
} | |
c13055 |
case _, ok := <-config.registrationTokens:
if !ok {
// re-registration canceled, exit Run loop
return
}
case <-ctx.Done():
return ctx.Err()
}
}
resp, err := caller.Call(ctx, subscribe)
lastErr = processSubscription(ctx, config, resp, err)
if config.subscriptionTerminated != nil {... | |
c13056 | (mesos.Response, error) {
return f(ctx, r)
} | |
c13057 | r)
if resp != nil {
resp.Close()
}
return nil, err
}
} | |
c13058 | Request) (err error) {
_, err = IgnoreResponse(sender).Send(ctx, r)
return
} | |
c13059 | make(map[string]messenger.MessageHandler),
stop: make(chan struct{}),
}
} | |
c13060 | error {
m.handlers[reflect.TypeOf(msg).Elem().Name()] = handler
return m.Called().Error(0)
} | |
c13061 | *upid.UPID, msg proto.Message) error {
return m.Called().Error(0)
} | |
c13062 | // noop
default:
close(m.stop)
}
return m.Called().Error(0)
} | |
c13063 | {
return m.Called().Get(0).(upid.UPID)
} | |
c13064 | m.messageQueue <- &message{from, msg}
} | |
c13065 | err := r(ctx, c, nil, nil, ChainIdentity)
return resp, err
} | |
c13066 | (mesos.Response, error) {
return Rule(rs.Eval).Call(ctx, c)
} | |
c13067 | (context.Context, *scheduler.Event, error) {
if r != nil {
return r(ctx, e, err, ch)
}
return ch(ctx, e, err)
} | |
c13068 | left[len(right)] == '/' && strings.HasPrefix(left, right)
} | |
c13069 | c.FrameworkID = mesos.FrameworkID{Value: id}
}
} | |
c13070 | c.ExecutorID = mesos.ExecutorID{Value: id}
}
} | |
c13071 | UnacknowledgedTasks: unackdTasks,
UnacknowledgedUpdates: unackdUpdates,
},
}
} | |
c13072 |
Type: executor.Call_UPDATE,
Update: &executor.Call_Update{
Status: status,
},
}
} | |
c13073 |
Type: executor.Call_MESSAGE,
Message: &executor.Call_Message{
Data: data,
},
}
} | |
c13074 | }
if left.Value == nil {
return right.Value == nil
} else {
return right.Value != nil && *left.Value == *right.Value
}
} | |
c13075 | // that byte buffers are copied vs. referenced by sub-slice (gogo protoc).
frame, err := r.ReadFrame()
if err != nil {
return err
}
return uf(frame, m)
}
} | |
c13076 | {
for _, opt := range opts {
opt(c)
}
return c
} | |
c13077 | := range offers {
ids[i] = offers[i].ID
}
return ids
} | |
c13078 | {
ids = append(ids, offer.GetID())
}
return ids
} | |
c13079 | make(Slice, 0, sz)
for i := range offers {
if filter.Accept(&offers[i]) {
result = append(result, offers[i])
}
}
}
return
} | |
c13080 | if filter.Accept(offer) {
result[id] = offer
}
}
}
return
} | |
c13081 |
slice = make(Slice, 0, sz)
for _, offer := range offers {
slice = append(slice, *offer)
}
}
return
} | |
c13082 | {
return r.Call()
}
head := c[0]
c = c[1:]
return head
}
} | |
c13083 | c = c.With(opts...)
}
return
}
switch r.(type) {
case RequestStreaming:
return s.Send(ctx, RequestStreamingFunc(f))
default:
return... | |
c13084 |
return fmt.Sprintf("/%s/%s", m.UPID.ID, m.Name)
} | |
c13085 | "" {
return nil, nil
}
return parseAddressList(v)
} | |
c13086 | h.Set(key, formatAddressList(addrs))
} | |
c13087 | mail.ParseDate(h.Get("Date"))
} | |
c13088 | {
h.Set("Date", t.Format(dateLayout))
} | |
c13089 |
if !ok {
// Using "name" in Content-Type is discouraged
_, params, err = h.ContentType()
filename = params["name"]
}
return filename, err
} | |
c13090 | h.SetContentDisposition("attachment", dispParams)
} | |
c13091 |
for fields.Next() {
m.Add(fields.Key(), fields.Value())
}
return m
} | |
c13092 | h.Set("Content-Type", formatHeaderWithParams(t, params))
} | |
c13093 | return parseHeaderWithParams(h.Get("Content-Disposition"))
} | |
c13094 | h.Set("Content-Disposition", formatHeaderWithParams(disp, params))
} | |
c13095 | decodeHeader(h.Get(k))
} | |
c13096 | h.Set(k, encodeHeader(v))
} | |
c13097 |
mediaType, mediaParams, _ := header.ContentType()
if ch, ok := mediaParams["charset"]; ok {
if converted, charsetErr := charsetReader(ch, body); charsetErr != nil {
err = unknownCharsetError{charsetErr}
} else {
body = converted
}
}
return &Entity{
Header: header,
Body: body,
mediaT... | |
c13098 | {
return nil, err
}
return New(Header{h}, br)
} | |
c13099 |
}
return &multipartReader{multipart.NewReader(e.Body, e.mediaParams["boundary"])}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.