builder.setDurationInSecs((int) longValue); } else if (ELEM_EVICTION_TIMESTAMP.equals(nodeName)) { builder.setEvictionTimestamp(longValue); } else if (ELEM_LAST_RENEW_TIMETSTAMP.equals(nodeName)) { builder.setRenewalTimestamp(longValue);
break; case EVICTION_TIMESTAMP: builder.setEvictionTimestamp(jp.getValueAsLong()); break; case LAST_RENEW_TIMESTAMP:
.setServiceUpTimestamp(now - RENEW_INTERVAL) .setRegistrationTimestamp(now) .setEvictionTimestamp(now + 3 * RENEW_INTERVAL) .setRenewalTimestamp(now + RENEW_INTERVAL) .build();
.setServiceUpTimestamp(now - RENEW_INTERVAL) .setRegistrationTimestamp(now) .setEvictionTimestamp(now + 3 * RENEW_INTERVAL) .setRenewalTimestamp(now + RENEW_INTERVAL) .build();
break; case EVICTION_TIMESTAMP: builder.setEvictionTimestamp(jp.getValueAsLong()); break; case LAST_RENEW_TIMESTAMP:
builder.setDurationInSecs((int) longValue); } else if (ELEM_EVICTION_TIMESTAMP.equals(nodeName)) { builder.setEvictionTimestamp(longValue); } else if (ELEM_LAST_RENEW_TIMETSTAMP.equals(nodeName)) { builder.setRenewalTimestamp(longValue);
private InstanceInfo decorateInstanceInfo(Lease<InstanceInfo> lease) { InstanceInfo info = lease.getHolder(); // client app settings int renewalInterval = LeaseInfo.DEFAULT_LEASE_RENEWAL_INTERVAL; int leaseDuration = LeaseInfo.DEFAULT_LEASE_DURATION; // TODO: clean this up if (info.getLeaseInfo() != null) { renewalInterval = info.getLeaseInfo().getRenewalIntervalInSecs(); leaseDuration = info.getLeaseInfo().getDurationInSecs(); } info.setLeaseInfo(LeaseInfo.Builder.newBuilder() .setRegistrationTimestamp(lease.getRegistrationTimestamp()) .setRenewalTimestamp(lease.getLastRenewalTimestamp()) .setServiceUpTimestamp(lease.getServiceUpTimestamp()) .setRenewalIntervalInSecs(renewalInterval) .setDurationInSecs(leaseDuration) .setEvictionTimestamp(lease.getEvictionTimestamp()).build()); info.setIsCoordinatingDiscoveryServer(); return info; }
LeaseInfo leaseInfo = LeaseInfo.Builder.newBuilder() .setDurationInSecs(leaseSeed.getDurationInSecs()) .setEvictionTimestamp(leaseSeed.getEvictionTimestamp()) .setRegistrationTimestamp(leaseSeed.getRegistrationTimestamp()) .setServiceUpTimestamp(leaseSeed.getServiceUpTimestamp())
private InstanceInfo decorateInstanceInfo(Lease<InstanceInfo> lease) { InstanceInfo info = lease.getHolder(); // client app settings int renewalInterval = LeaseInfo.DEFAULT_LEASE_RENEWAL_INTERVAL; int leaseDuration = LeaseInfo.DEFAULT_LEASE_DURATION; // TODO: clean this up if (info.getLeaseInfo() != null) { renewalInterval = info.getLeaseInfo().getRenewalIntervalInSecs(); leaseDuration = info.getLeaseInfo().getDurationInSecs(); } info.setLeaseInfo(LeaseInfo.Builder.newBuilder() .setRegistrationTimestamp(lease.getRegistrationTimestamp()) .setRenewalTimestamp(lease.getLastRenewalTimestamp()) .setServiceUpTimestamp(lease.getServiceUpTimestamp()) .setRenewalIntervalInSecs(renewalInterval) .setDurationInSecs(leaseDuration) .setEvictionTimestamp(lease.getEvictionTimestamp()).build()); info.setIsCoordinatingDiscoveryServer(); return info; }