This commit is contained in:
crusader 2018-03-16 15:35:37 +09:00
parent d2cd8ed86a
commit 7fe426dd07
2 changed files with 18 additions and 18 deletions

View File

@ -36,6 +36,8 @@ func (pm *probeManagers) Start() error {
logging.Logger().Panic("Probe: already running. Stop it before starting it again") logging.Logger().Panic("Probe: already running. Stop it before starting it again")
} }
oops.InitService()
probeRPCRegistry := crr.NewRPCRegistry() probeRPCRegistry := crr.NewRPCRegistry()
centralProbeClient := oopccp.New(probeRPCRegistry) centralProbeClient := oopccp.New(probeRPCRegistry)
@ -46,8 +48,6 @@ func (pm *probeManagers) Start() error {
} }
cdr.RegisterResource("CentralClients", centralClients) cdr.RegisterResource("CentralClients", centralClients)
oops.InitService()
services := cdr.GetInstancesByAnnotationName(oopca.ServiceTag) services := cdr.GetInstancesByAnnotationName(oopca.ServiceTag)
for _, s := range services { for _, s := range services {

View File

@ -21,35 +21,35 @@ type DiscoveryService struct {
CentralService *CentralService `annotation:"@Inject()"` CentralService *CentralService `annotation:"@Inject()"`
} }
func (ds *DiscoveryService) DiscoverZone(dz *discoveryM.DiscoveryZone) error { func (ds *DiscoveryService) DiscoverZone(requesterID string, dz *discoveryM.DiscoveryZone) error {
return ds.ContainerService.Send(oocmpsp.ProbeContainerNameDiscovery, "DiscoveryService.DiscoverZone", dz) return ds.ContainerService.Send(oocmpsp.ProbeContainerNameDiscovery, "DiscoveryService.DiscoverZone", requesterID, dz)
} }
func (ds *DiscoveryService) DiscoverHost(zone *discoveryM.Zone, dh *discoveryM.DiscoveryHost) error { func (ds *DiscoveryService) DiscoverHost(requesterID string, zone *discoveryM.Zone, dh *discoveryM.DiscoveryHost) error {
return ds.ContainerService.Send(oocmpsp.ProbeContainerNameDiscovery, "DiscoveryService.DiscoverHost", zone, dh) return ds.ContainerService.Send(oocmpsp.ProbeContainerNameDiscovery, "DiscoveryService.DiscoverHost", requesterID, zone, dh)
} }
func (ds *DiscoveryService) DiscoverPort(host *discoveryM.Host, dp *discoveryM.DiscoveryPort) error { func (ds *DiscoveryService) DiscoverPort(requesterID string, host *discoveryM.Host, dp *discoveryM.DiscoveryPort) error {
return ds.ContainerService.Send(oocmpsp.ProbeContainerNameDiscovery, "DiscoveryService.DiscoverPort", host, dp) return ds.ContainerService.Send(oocmpsp.ProbeContainerNameDiscovery, "DiscoveryService.DiscoverPort", requesterID, host, dp)
} }
func (ds *DiscoveryService) DiscoverService(port *discoveryM.Port, dService *discoveryM.DiscoveryService) error { func (ds *DiscoveryService) DiscoverService(requesterID string, port *discoveryM.Port, dService *discoveryM.DiscoveryService) error {
return ds.ContainerService.Send(oocmpsp.ProbeContainerNameDiscovery, "DiscoveryService.DiscoverZone", port, dService) return ds.ContainerService.Send(oocmpsp.ProbeContainerNameDiscovery, "DiscoveryService.DiscoverZone", requesterID, port, dService)
} }
// use by discovery // use by discovery
func (ds *DiscoveryService) DiscoveredZone(zone *discoveryM.Zone) error { func (ds *DiscoveryService) DiscoveredZone(requesterID string, zone *discoveryM.Zone) error {
return ds.CentralService.Send(oocmp.HTTPEntry_Probe, "DiscoveryService.DiscoveredZone", zone) return ds.CentralService.Send(oocmp.HTTPEntry_Probe, "DiscoveryService.discoveredZone", requesterID, zone)
} }
func (ds *DiscoveryService) DiscoveredHost(host *discoveryM.Host) error { func (ds *DiscoveryService) DiscoveredHost(requesterID string, host *discoveryM.Host) error {
return ds.CentralService.Send(oocmp.HTTPEntry_Probe, "DiscoveryService.DiscoveredHost", host) return ds.CentralService.Send(oocmp.HTTPEntry_Probe, "DiscoveryService.discoveredHost", requesterID, host)
} }
func (ds *DiscoveryService) DiscoveredPort(port *discoveryM.Port) error { func (ds *DiscoveryService) DiscoveredPort(requesterID string, port *discoveryM.Port) error {
return ds.CentralService.Send(oocmp.HTTPEntry_Probe, "DiscoveryService.DiscoveredPort", port) return ds.CentralService.Send(oocmp.HTTPEntry_Probe, "DiscoveryService.discoveredPort", requesterID, port)
} }
func (ds *DiscoveryService) DiscoveredService(service *discoveryM.Service) error { func (ds *DiscoveryService) DiscoveredService(requesterID string, service *discoveryM.Service) error {
return ds.CentralService.Send(oocmp.HTTPEntry_Probe, "DiscoveryService.DiscoveredService", service) return ds.CentralService.Send(oocmp.HTTPEntry_Probe, "DiscoveryService.discoveredService", requesterID, service)
} }