MCPcopy
hub / github.com/uber/aresdb / updateAssignmentHash

Method updateAssignmentHash

subscriber/common/job/controller.go:426–446  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

424}
425
426func (c *Controller) updateAssignmentHash() (update bool, newHash string) {
427 // get the hash of the assignment
428 oldHash := c.assignmentHashCode
429 newHash, err := c.aresControllerClient.GetAssignmentHash(c.jobNS, c.serviceConfig.Environment.InstanceID)
430 if err != nil {
431 c.serviceConfig.Logger.Error("Failed to get assignment hash from aresDB controller",
432 zap.String("jobNamespace", c.jobNS),
433 zap.String("aresDB Controller", c.serviceConfig.ControllerConfig.Address),
434 zap.Error(err))
435 return false, ""
436 }
437
438 if strings.Compare(oldHash, newHash) == 0 {
439 return false, newHash
440 }
441 c.serviceConfig.Logger.Info("Found assignment hash changed",
442 zap.String("jobNamespace", c.jobNS),
443 zap.String("aresDB Controller", c.serviceConfig.ControllerConfig.Address))
444
445 return true, newHash
446}
447
448func (c *Controller) addDriver(
449 jobConfig *rules.JobConfig, aresCluster string, aresClusterDrivers map[string]*Driver, stop bool) bool {

Callers 2

SyncUpJobConfigsMethod · 0.95
controller_test.goFile · 0.80

Calls 5

CompareMethod · 0.80
GetAssignmentHashMethod · 0.65
ErrorMethod · 0.65
StringMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected