public static Applications updateMeta(Applications applications) { applications.setVersion(1L); applications.setAppsHashCode(applications.getReconcileHashCode()); return applications; }
public static Applications updateMeta(Applications applications) { applications.setVersion(1L); applications.setAppsHashCode(applications.getReconcileHashCode()); return applications; }
apps.setVersion(jp.getValueAsLong()); } else if (appHashCodeKey.equals(fieldName)){ apps.setAppsHashCode(jp.getValueAsString());
public Applications toApplications() { Map<String, Application> appsByName = new HashMap<>(); Iterator<InstanceInfo> it = serviceIterator(); while (it.hasNext()) { InstanceInfo instanceInfo = it.next(); Application instanceApp = appsByName.get(instanceInfo.getAppName()); if (instanceApp == null) { instanceApp = new Application(instanceInfo.getAppName()); appsByName.put(instanceInfo.getAppName(), instanceApp); } instanceApp.addInstance(instanceInfo); } // Do not pass application list to the constructor, as it does not initialize properly Applications // data structure. Applications applications = new Applications(); for (Application app : appsByName.values()) { applications.addApplication(app); } applications.shuffleInstances(false); applications.setAppsHashCode(applications.getReconcileHashCode()); applications.setVersion(1L); return applications; }
@Override public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { Applications apps = new Applications(); while (reader.hasMoreChildren()) { reader.moveDown(); String nodeName = reader.getNodeName(); if (NODE_APP.equals(nodeName)) { apps.addApplication((Application) context.convertAnother( apps, Application.class)); } else if (VERSIONS_DELTA.equals(nodeName)) { apps.setVersion(Long.valueOf(reader.getValue())); } else if (APPS_HASHCODE.equals(nodeName)) { apps.setAppsHashCode(reader.getValue()); } reader.moveUp(); } return apps; } }
getApplications().setVersion(delta.getVersion()); logger.debug( "The Reconcile hashcodes after complete sync up, client : {}, server : {}.",
GET_ALL_CACHE_MISS.increment(); Applications apps = new Applications(); apps.setVersion(1L); for (Entry<String, Map<String, Lease<InstanceInfo>>> entry : registry.entrySet()) { Application app = null;
apps.setVersion(1L); for (Entry<String, Map<String, Lease<InstanceInfo>>> entry : registry.entrySet()) { Application app = null;
GET_ALL_CACHE_MISS_DELTA.increment(); Applications apps = new Applications(); apps.setVersion(responseCache.getVersionDelta().get()); Map<String, Application> applicationInstancesMap = new HashMap<String, Application>(); try {
apps.setVersion(100L); if (sentDelta.compareAndSet(false, true)) { addDeltaApps(includeRemote, apps); apps.setVersion(100L); for (Application application : applicationMap.values()) { apps.addApplication(application); apps.setVersion(-1l); for (Application application : applicationMap.values()) { Application retApp = new Application(application.getName());
apps.setVersion(responseCache.getVersionDeltaWithRegions().get()); Map<String, Application> applicationInstancesMap = new HashMap<String, Application>(); try {
getApplications().setVersion(delta.getVersion()); getApplications().shuffleInstances(clientConfig.shouldFilterOnlyUpInstances()); applications.setVersion(delta.getVersion()); applications.shuffleInstances(clientConfig.shouldFilterOnlyUpInstances());
@Test public void testVersionAndAppHash() { Applications apps = new Applications(); assertEquals(-1L, (long)apps.getVersion()); assertNull(apps.getAppsHashCode()); apps.setVersion(101L); apps.setAppsHashCode("UP_5_DOWN_6_"); assertEquals(101L, (long)apps.getVersion()); assertEquals("UP_5_DOWN_6_", apps.getAppsHashCode()); }
public static Applications updateMeta(Applications applications) { applications.setVersion(1L); applications.setAppsHashCode(applications.getReconcileHashCode()); return applications; }
public static Applications updateMeta(Applications applications) { applications.setVersion(1L); applications.setAppsHashCode(applications.getReconcileHashCode()); return applications; }
apps.setVersion(jp.getValueAsLong()); } else if (appHashCodeKey.equals(fieldName)){ apps.setAppsHashCode(jp.getValueAsString());
public Applications toApplications() { Map<String, Application> appsByName = new HashMap<>(); Iterator<InstanceInfo> it = serviceIterator(); while (it.hasNext()) { InstanceInfo instanceInfo = it.next(); Application instanceApp = appsByName.get(instanceInfo.getAppName()); if (instanceApp == null) { instanceApp = new Application(instanceInfo.getAppName()); appsByName.put(instanceInfo.getAppName(), instanceApp); } instanceApp.addInstance(instanceInfo); } // Do not pass application list to the constructor, as it does not initialize properly Applications // data structure. Applications applications = new Applications(); for (Application app : appsByName.values()) { applications.addApplication(app); } applications.shuffleInstances(false); applications.setAppsHashCode(applications.getReconcileHashCode()); applications.setVersion(1L); return applications; }
@Override public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { Applications apps = new Applications(); while (reader.hasMoreChildren()) { reader.moveDown(); String nodeName = reader.getNodeName(); if (NODE_APP.equals(nodeName)) { apps.addApplication((Application) context.convertAnother( apps, Application.class)); } else if (VERSIONS_DELTA.equals(nodeName)) { apps.setVersion(Long.valueOf(reader.getValue())); } else if (APPS_HASHCODE.equals(nodeName)) { apps.setAppsHashCode(reader.getValue()); } reader.moveUp(); } return apps; } }
getApplications().setVersion(delta.getVersion()); logger.debug( "The Reconcile hashcodes after complete sync up, client : {}, server : {}.",
GET_ALL_CACHE_MISS.increment(); Applications apps = new Applications(); apps.setVersion(1L); for (Entry<String, Map<String, Lease<InstanceInfo>>> entry : registry.entrySet()) { Application app = null;