Package com.netflix.discovery.shared

Examples of com.netflix.discovery.shared.Applications$Pair


                }
            }
        }

        protected String getDeltaAppsHashCode(boolean includeRemote) {
            Applications allApps = new Applications();
            for (Application application : applicationMap.values()) {
                allApps.addApplication(application);
            }

            if (includeRemote) {
                for (Application application : remoteRegionApps.values()) {
                    allApps.addApplication(application);
                }
            }
            addDeltaApps(includeRemote, allApps);
            return allApps.getReconcileHashCode();
        }
View Full Code Here


    private Applications localRegionApps;

    @Override
    public Applications fetchRegistry() {
        if (null == localRegionApps) {
            return new Applications();
        }
        return localRegionApps;
    }
View Full Code Here

        return localRegionApps;
    }

    @Override
    public Applications fetchRegistry(String[] includeRemoteRegions) {
        Applications toReturn = new Applications();
        for (Application application : localRegionApps.getRegisteredApplications()) {
            toReturn.addApplication(application);
        }
        for (String region : includeRemoteRegions) {
            Applications applications = remoteRegionVsApps.get(region);
            if (null != applications) {
                for (Application application : applications.getRegisteredApplications()) {
                    toReturn.addApplication(application);
                }
            }
        }
        return toReturn;
View Full Code Here

                                                 }
                                             }).build()
                                             .createInjector();

        MockBackupRegistry backupRegistry = (MockBackupRegistry) injector.getInstance(BackupRegistry.class);
        Applications apps = new Applications();
        String dummyappName = "dummyapp";
        Application dummyapp = new Application(dummyappName);
        apps.addApplication(dummyapp);
        dummyapp.addInstance(InstanceInfo.Builder.newBuilder().setHostName("host").setAppName(dummyappName).build());
        backupRegistry.setLocalRegionApps(apps);

        DiscoveryClient client = injector.getInstance(DiscoveryClient.class);
View Full Code Here

            logger.warn("Cannot find localhost ip", e);
        }
        EurekaServerIdentity identity = new EurekaServerIdentity(ip);
        discoveryApacheClient.addFilter(new EurekaIdentityHeaderFilter(identity));

        applications.set(new Applications());
        try {
            if (fetchRegistry()) {
                this.readyForServingData = true;
            } else {
                logger.warn("Failed to fetch remote registry. This means this eureka server is not ready for serving "
View Full Code Here

                logger.info(
                        "Registered Applications size is zero : {}",
                        (getApplications().getRegisteredApplications().size() == 0));
                response = storeFullRegistry();
            } else {
                Applications delta = null;
                response = fetchRemoteRegistry(true);
                if (null != response) {
                    if (response.getStatus() == Status.OK.getStatusCode()) {
                        delta = response.getEntity(Applications.class);
                        this.applicationsDelta.set(delta);
                    }
                    if (delta == null) {
                        logger.warn("The server does not allow the delta revision to be applied because it is not "
                                + "safe. Hence got the full registry.");
                        this.closeResponse(response);
                        response = fetchRemoteRegistry(true);
                    } else {
                        updateDelta(delta);
                        String reconcileHashCode = getApplications()
                                .getReconcileHashCode();
                        // There is a diff in number of instances for some reason
                        if ((!reconcileHashCode.equals(delta.getAppsHashCode()))) {
                            response = reconcileAndLogDifference(response, delta, reconcileHashCode);

                        }
                    }
                }
View Full Code Here

        ClientResponse response = fetchRemoteRegistry(false);
        if (response == null) {
            logger.error("The response is null.");
            return null;
        }
        Applications apps = response.getEntity(Applications.class);
        if (apps == null) {
            logger.error("The application is null for some reason. Not storing this information");
        } else {
            applications.set(apps);
        }
View Full Code Here

        response = this.fetchRemoteRegistry(false);
        if (null == response) {
            logger.warn("Response is null while fetching remote registry during reconcile difference.");
            return null;
        }
        Applications serverApps = response.getEntity(Applications.class);
        Map<String, List<String>> reconcileDiffMap = getApplications()
                .getReconcileMapDiff(serverApps);
        String reconcileString = "";
        for (Map.Entry<String, List<String>> mapEntry : reconcileDiffMap
                .entrySet()) {
View Full Code Here

     *
     * @return the set of ASG names.
     */
    private Set<String> getASGNames() {
        Set<String> asgNames = new HashSet<String>();
        Applications apps = PeerAwareInstanceRegistry.getInstance()
        .getApplications(false);
        for (Application app : apps.getRegisteredApplications()) {
            for (InstanceInfo instanceInfo : app.getInstances()) {
                String asgName = instanceInfo.getASGName();
                if (asgName != null) {
                    asgNames.add(asgName);
                }
View Full Code Here

    private static Applications getApplicationsForVip(Key key, InstanceRegistry registry) {
        Object[] args = {key.getEntityType(), key.getName(), key.getVersion(), key.getType()};
        logger.debug(
                "Retrieving applications from registry for key : {} {} {} {}",
                args);
        Applications toReturn = new Applications();
        Applications applications = registry.getApplications();
        for (Application application : applications.getRegisteredApplications()) {
            Application appToAdd = null;
            for (InstanceInfo instanceInfo : application.getInstances()) {
                String vipAddress;
                if (Key.EntityType.VIP.equals(key.getEntityType())) {
                    vipAddress = instanceInfo.getVIPAddress();
View Full Code Here

TOP

Related Classes of com.netflix.discovery.shared.Applications$Pair

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.