// com.netflix.discovery.InstanceInfoReplicatorpublicvoidrun(){boolean var6 =false;
ScheduledFuture next;
label53:{try{
var6 =true;this.discoveryClient.refreshInstanceInfo();
Long dirtyTimestamp =this.instanceInfo.isDirtyWithTime();if(dirtyTimestamp != null){this.discoveryClient.register();this.instanceInfo.unsetIsDirty(dirtyTimestamp);
var6 =false;}else{
var6 =false;}break label53;}catch(Throwable var7){
logger.warn("There was a problem with the instance info replicator", var7);
var6 =false;}finally{if(var6){
ScheduledFuture next =this.scheduler.schedule(this,(long)this.replicationIntervalSeconds, TimeUnit.SECONDS);this.scheduledPeriodicRef.set(next);}}
next =this.scheduler.schedule(this,(long)this.replicationIntervalSeconds, TimeUnit.SECONDS);this.scheduledPeriodicRef.set(next);return;}
next =this.scheduler.schedule(this,(long)this.replicationIntervalSeconds, TimeUnit.SECONDS);this.scheduledPeriodicRef.set(next);}
// com.netflix.eureka.registry.AbstractInstanceRegistrypublicvoidregister(InstanceInfo registrant,int leaseDuration,boolean isReplication){try{this.read.lock();
Map<String, Lease<InstanceInfo>> gMap =(Map)this.registry.get(registrant.getAppName());
EurekaMonitors.REGISTER.increment(isReplication);if(gMap == null){
ConcurrentHashMap<String, Lease<InstanceInfo>> gNewMap =newConcurrentHashMap();
gMap =(Map)this.registry.putIfAbsent(registrant.getAppName(), gNewMap);if(gMap == null){
gMap = gNewMap;}}
Lease<InstanceInfo> existingLease =(Lease)((Map)gMap).get(registrant.getId());if(existingLease != null && existingLease.getHolder()!= null){
Long existingLastDirtyTimestamp =((InstanceInfo)existingLease.getHolder()).getLastDirtyTimestamp();
Long registrationLastDirtyTimestamp = registrant.getLastDirtyTimestamp();
logger.debug("Existing lease found (existing={}, provided={}", existingLastDirtyTimestamp, registrationLastDirtyTimestamp);if(existingLastDirtyTimestamp > registrationLastDirtyTimestamp){
logger.warn("There is an existing lease and the existing lease's dirty timestamp {} is greater than the one that is being registered {}", existingLastDirtyTimestamp, registrationLastDirtyTimestamp);
logger.warn("Using the existing instanceInfo instead of the new instanceInfo as the registrant");
registrant =(InstanceInfo)existingLease.getHolder();}}else{synchronized(this.lock){if(this.expectedNumberOfClientsSendingRenews >0){++this.expectedNumberOfClientsSendingRenews;this.updateRenewsPerMinThreshold();}}
logger.debug("No previous lease information found; it is new registration");}
Lease<InstanceInfo> lease =newLease(registrant, leaseDuration);if(existingLease != null){
lease.setServiceUpTimestamp(existingLease.getServiceUpTimestamp());}((Map)gMap).put(registrant.getId(), lease);synchronized(this.recentRegisteredQueue){this.recentRegisteredQueue.add(newPair(System.currentTimeMillis(), registrant.getAppName()+"("+ registrant.getId()+")"));}if(!InstanceStatus.UNKNOWN.equals(registrant.getOverriddenStatus())){
logger.debug("Found overridden status {} for instance {}. Checking to see if needs to be add to the overrides", registrant.getOverriddenStatus(), registrant.getId());if(!this.overriddenInstanceStatusMap.containsKey(registrant.getId())){
logger.info("Not found overridden id {} and hence adding it", registrant.getId());this.overriddenInstanceStatusMap.put(registrant.getId(), registrant.getOverriddenStatus());}}
InstanceStatus overriddenStatusFromMap =(InstanceStatus)this.overriddenInstanceStatusMap.get(registrant.getId());if(overriddenStatusFromMap != null){
logger.info("Storing overridden status {} from map", overriddenStatusFromMap);
registrant.setOverriddenStatus(overriddenStatusFromMap);}
InstanceStatus overriddenInstanceStatus =this.getOverriddenInstanceStatus(registrant, existingLease, isReplication);
registrant.setStatusWithoutDirty(overriddenInstanceStatus);if(InstanceStatus.UP.equals(registrant.getStatus())){
lease.serviceUp();}
registrant.setActionType(ActionType.ADDED);this.recentlyChangedQueue.add(newAbstractInstanceRegistry.RecentlyChangedItem(lease));
registrant.setLastUpdatedTimestamp();this.invalidateCache(registrant.getAppName(), registrant.getVIPAddress(), registrant.getSecureVipAddress());
logger.info("Registered instance {}/{} with status {} (replication={})",newObject[]{registrant.getAppName(), registrant.getId(), registrant.getStatus(), isReplication});}finally{this.read.unlock();}}