@Override public String getIpAddress() { return hostInfo.first(); }
@After public void tearDown() throws Exception { for (Pair<String, String> registeredApp : registeredApps) { System.out.println("Canceling application: " + registeredApp.first() + " from local registry."); registry.cancel(registeredApp.first(), registeredApp.second(), false); } serverContext.shutdown(); mockRemoteEurekaServer.stop(); remoteRegionApps.clear(); remoteRegionAppsDelta.clear(); ConfigurationManager.getConfigInstance().clearProperty("eureka.remoteRegionUrls"); ConfigurationManager.getConfigInstance().clearProperty("eureka.deltaRetentionTimerIntervalInMs"); }
final ChunkInfo ci = entry.getKey(); final Pair<List<String>, byte[]> pair = entry.getValue(); final List<String> ciKeys = pair.first(); byte[] data = pair.second(); int index = 0;
final ChunkInfo ci = entry.getKey(); final Pair<List<String>, byte[]> pair = entry.getValue(); final List<String> ciKeys = pair.first(); byte[] data = pair.second(); int index = 0;
@Override public String getIpAddress() { return hostInfo.first(); }
@RequestMapping(value = "/lastn", method = RequestMethod.GET) public String lastn(HttpServletRequest request, Map<String, Object> model) { populateBase(request, model); PeerAwareInstanceRegistryImpl registry = (PeerAwareInstanceRegistryImpl) getRegistry(); ArrayList<Map<String, Object>> lastNCanceled = new ArrayList<>(); List<Pair<Long, String>> list = registry.getLastNCanceledInstances(); for (Pair<Long, String> entry : list) { lastNCanceled.add(registeredInstance(entry.second(), entry.first())); } model.put("lastNCanceled", lastNCanceled); list = registry.getLastNRegisteredInstances(); ArrayList<Map<String, Object>> lastNRegistered = new ArrayList<>(); for (Pair<Long, String> entry : list) { lastNRegistered.add(registeredInstance(entry.second(), entry.first())); } model.put("lastNRegistered", lastNRegistered); return "eureka/lastn"; }
@RequestMapping(value = "/lastn", method = RequestMethod.GET) public String lastn(HttpServletRequest request, Map<String, Object> model) { populateBase(request, model); PeerAwareInstanceRegistryImpl registry = (PeerAwareInstanceRegistryImpl) getRegistry(); ArrayList<Map<String, Object>> lastNCanceled = new ArrayList<>(); List<Pair<Long, String>> list = registry.getLastNCanceledInstances(); for (Pair<Long, String> entry : list) { lastNCanceled.add(registeredInstance(entry.second(), entry.first())); } model.put("lastNCanceled", lastNCanceled); list = registry.getLastNRegisteredInstances(); ArrayList<Map<String, Object>> lastNRegistered = new ArrayList<>(); for (Pair<Long, String> entry : list) { lastNRegistered.add(registeredInstance(entry.second(), entry.first())); } model.put("lastNRegistered", lastNRegistered); return "eureka/lastn"; }
private void lastn(NutMap result) { PeerAwareInstanceRegistryImpl registry = (PeerAwareInstanceRegistryImpl) getRegistry(); List<NutMap> lastNCanceled = registry.getLastNCanceledInstances() .stream() .map(entry -> NutMap.NEW() .setv("id", entry.second()) .setv("date", new Date(entry.first()))) .collect(Collectors.toList()); result.put("lastNCanceled", lastNCanceled); List<NutMap> lastNRegistered = registry.getLastNRegisteredInstances() .stream() .map(entry -> NutMap.NEW() .setv("id", entry.second()) .setv("date", new Date(entry.first()))) .collect(Collectors.toList()); result.put("lastNRegistered", lastNRegistered); }
LinkedHashMap<String, Object> instance = new LinkedHashMap<>(); instances.add(instance); instance.put("id", p.first()); String url = p.second(); instance.put("url", url);
LinkedHashMap<String, Object> instance = new LinkedHashMap<>(); instances.add(instance); instance.put("id", p.first()); String url = p.second(); instance.put("url", url);
LinkedHashMap<String, Object> instance = new LinkedHashMap<>(); instances.add(instance); instance.put("id", p.first()); String url = p.second(); instance.put("url", url);