@@ -69,8 +69,10 @@ type offeringChordDiscBackend struct {
69
69
MaxRefreshesFailed int `json:"MaxRefreshesFailed"` // Maximum amount of refreshes that a supplier failed to reply
70
70
MaxRefreshesMissed int `json:"MaxRefreshesMissed"` // Maximum amount of refreshes a trader failed to send to the supplier
71
71
// Debug performance flags
72
- SpreadOffers bool `json:"SpreadOffers"` // Used to tell if the spread offers mechanism is used or not.
73
- SpreadPartitionsState bool `json:"SpreadPartitionsState"` // Used to tell if the spread partitions state is used or not.
72
+ SpreadOffers bool `json:"SpreadOffers"` // Used to tell if the spread offers mechanism is used or not.
73
+ SpreadPartitionsState bool `json:"SpreadPartitionsState"` // Used to tell if the spread partitions state is used or not.
74
+ GUIDEstimatedNetworkSize int `json:"GUIDEstimatedNetworkSize"` // Estimated network size to tune the GUID scale.
75
+ GUIDScaleFactor int `json:"GUIDScaleFactor"` // GUID scale's factor.
74
76
}
75
77
76
78
type randomChordDiscBackend struct {
@@ -132,8 +134,10 @@ func Default(hostIP string) *Configuration {
132
134
MaxRefreshesMissed : 2 ,
133
135
RefreshMissedTimeout : duration {Duration : refreshingInterval .Duration + (5 * time .Second )},
134
136
// Debug performance flags
135
- SpreadOffers : true ,
136
- SpreadPartitionsState : true ,
137
+ SpreadOffers : true ,
138
+ SpreadPartitionsState : true ,
139
+ GUIDEstimatedNetworkSize : 50000 ,
140
+ GUIDScaleFactor : 5 ,
137
141
},
138
142
RandomChordBackend : randomChordDiscBackend {
139
143
RandBackendMaxRetries : 6 ,
@@ -271,6 +275,14 @@ func (c *Configuration) validate() error {
271
275
return fmt .Errorf ("maximum number of missed refreshes must be a positive integer" )
272
276
}
273
277
278
+ if c .GUIDEstimatedNetworkSize () <= 0 {
279
+ return fmt .Errorf ("estimated network size must a positive integer" )
280
+ }
281
+
282
+ if c .GUIDScaleFactor () <= 0 {
283
+ return fmt .Errorf ("GUID scale factor must a positive integer" )
284
+ }
285
+
274
286
// ======================= Random Chord Discovery Backend specific ==========================
275
287
276
288
if c .RandBackendMaxRetries () <= 0 {
@@ -316,7 +328,7 @@ func (c *Configuration) Print() {
316
328
log .Printf ("Messages Timeout: %s" , c .APITimeout ().String ())
317
329
log .Printf ("CPU Slices: %d" , c .CPUSlices ())
318
330
log .Printf ("CPU Overcommit: %d" , c .CPUOvercommit ())
319
- log .Printf ("Memory Overcommit: %d" , c .MemoryOvercommit ())
331
+ log .Printf ("Memory Overcommit: %d" , c .MemoryOvercommit ())
320
332
log .Printf ("Scheduling Policy: %s" , c .SchedulingPolicy ())
321
333
log .Printf ("FreeResources Partitions:" )
322
334
for _ , powerPart := range c .Caravela .Resources .CPUClasses {
@@ -341,8 +353,11 @@ func (c *Configuration) Print() {
341
353
log .Printf (" Refresh missed timeout: %s" , c .RefreshMissedTimeout ().String ())
342
354
log .Printf (" Max num of refreshes failed: %d" , c .MaxRefreshesFailed ())
343
355
log .Printf (" Max num of refreshes missed: %d" , c .MaxRefreshesMissed ())
356
+ // Debug performance flags.
344
357
log .Printf (" Spread Offers: %t" , c .SpreadOffers ())
345
358
log .Printf (" Spread Partitions State: %t" , c .SpreadPartitionsState ())
359
+ log .Printf (" GUID Estimated Network Size: %d" , c .GUIDEstimatedNetworkSize ())
360
+ log .Printf (" GUID Scale Factor: %d" , c .GUIDScaleFactor ())
346
361
347
362
log .Printf ("$$$$$$$$$$$$$$$$$$$$$$$ IMAGES STORAGE $$$$$$$$$$$$$$$$$$$$$$$$$$$" )
348
363
log .Printf ("Active Storage Backend: %s" , c .ImagesStorageBackend ())
@@ -440,14 +455,26 @@ func (c *Configuration) RefreshMissedTimeout() time.Duration {
440
455
return c .Caravela .DiscoveryBackend .OfferingChordBackend .RefreshMissedTimeout .Duration
441
456
}
442
457
458
+ // Debug performance flag.
443
459
func (c * Configuration ) SpreadOffers () bool {
444
460
return c .Caravela .DiscoveryBackend .OfferingChordBackend .SpreadOffers
445
461
}
446
462
463
+ // Debug performance flag.
447
464
func (c * Configuration ) SpreadPartitionsState () bool {
448
465
return c .Caravela .DiscoveryBackend .OfferingChordBackend .SpreadPartitionsState
449
466
}
450
467
468
+ // Debug performance flag.
469
+ func (c * Configuration ) GUIDEstimatedNetworkSize () int {
470
+ return c .Caravela .DiscoveryBackend .OfferingChordBackend .GUIDEstimatedNetworkSize
471
+ }
472
+
473
+ // Debug performance flag.
474
+ func (c * Configuration ) GUIDScaleFactor () int {
475
+ return c .Caravela .DiscoveryBackend .OfferingChordBackend .GUIDScaleFactor
476
+ }
477
+
451
478
// =================== Random Chord Discovery Backend specific ==============
452
479
453
480
func (c * Configuration ) RandBackendMaxRetries () int {
0 commit comments