本文整理匯總了Golang中github.com/chrislusf/glow/resource.Location.URL方法的典型用法代碼示例。如果您正苦於以下問題:Golang Location.URL方法的具體用法?Golang Location.URL怎麽用?Golang Location.URL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/chrislusf/glow/resource.Location
的用法示例。
在下文中一共展示了Location.URL方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: findAgentInformation
func (l *MasterResource) findAgentInformation(location resource.Location) (*resource.AgentInformation, bool) {
d, hasDc := l.Topology.GetDataCenter(location.DataCenter)
if !hasDc {
return nil, false
}
r, hasRack := d.Racks[location.Rack]
if !hasRack {
return nil, false
}
ai, ok := r.Agents[location.URL()]
return ai, ok
}
示例2: setupInputChannels
func (s *Scheduler) setupInputChannels(fc *flow.FlowContext, task *flow.Task, location resource.Location, waitGroup *sync.WaitGroup) {
if len(task.Inputs) > 0 {
return
}
ds := task.Outputs[0].Parent
if len(ds.ExternalInputChans) == 0 {
return
}
// connect local typed chan to remote raw chan
// write to the dataset location in the cluster so that the task can be retried if needed.
for i, inChan := range ds.ExternalInputChans {
inputChanName := fmt.Sprintf("%s-ct-%d-input-%d-p-%d", s.option.ExecutableFileHash, fc.Id, ds.Id, i)
// println("setup input channel for", task.Name(), "on", location.URL())
s.shardLocator.SetShardLocation(inputChanName, location)
rawChan, err := netchan.GetDirectSendChannel(inputChanName, location.URL(), waitGroup)
if err != nil {
log.Panic(err)
}
// println("writing", inputChanName, "to", location.URL())
netchan.ConnectTypedWriteChannelToRaw(inChan, rawChan, waitGroup)
}
}