public RandomTimeSlot(String externalId, int maxValue) { this.maxValue = maxValue; random = new Random(fromExternalId(externalId)); }
private void sleepBeforeRegistrationRetry() { long sleepTimeInMs = DateUtils.MILLIS_PER_SECOND * randomTimeSlot.getRandomValueSeededByExternalId(); log.warn("Could not register. Sleeping for {} ms before attempting again.", sleepTimeInMs); AppUtils.sleep(sleepTimeInMs); }
nodeCommunication.getNodeId()), e); long sleepTime = DateUtils.MILLIS_PER_SECOND * new RandomTimeSlot(nodeCommunication.getNodeId(), 30).getRandomValueSeededByExternalId(); log.warn("Sleeping for {} ms before attempting to unlock the node communication record again", sleepTime); AppUtils.sleep(sleepTime);
public RegistrationService(IParameterService parameterService, ISymmetricDialect symmetricDialect, INodeService nodeService, IDataExtractorService dataExtractorService, IDataService dataService, IDataLoaderService dataLoaderService, ITransportManager transportManager, IStatisticManager statisticManager, IConfigurationService configurationService) { super(parameterService, symmetricDialect); this.nodeService = nodeService; this.dataExtractorService = dataExtractorService; this.dataService = dataService; this.dataLoaderService = dataLoaderService; this.transportManager = transportManager; this.statisticManager = statisticManager; this.configurationService = configurationService; this.randomTimeSlot = new RandomTimeSlot(parameterService.getExternalId(), 30); setSqlMap(new RegistrationServiceSqlMap(symmetricDialect.getPlatform(), createSqlReplacementTokens())); }