Examples of FeatureInfo


Examples of org.apache.hadoop.hdfs.protocol.LayoutVersion.FeatureInfo

  /**
   * Given feature {@code f}, ensures the layout version of that feature
   * supports all the features supported by it's ancestor.
   */
  private void validateFeatureList(LayoutFeature f) {
    final FeatureInfo info = f.getInfo();
    int lv = info.getLayoutVersion();
    int ancestorLV = info.getAncestorLayoutVersion();
    SortedSet<LayoutFeature> ancestorSet = NameNodeLayoutVersion.getFeatures(ancestorLV);
    assertNotNull(ancestorSet);
    for (LayoutFeature  feature : ancestorSet) {
      assertTrue("LV " + lv + " does nto support " + feature
          + " supported by the ancestor LV " + info.getAncestorLayoutVersion(),
          NameNodeLayoutVersion.supports(feature, lv));
    }
  }
View Full Code Here

Examples of org.apache.karaf.cellar.features.FeatureInfo

            // get the features in the cluster group
            Map<FeatureInfo, Boolean> clusterFeatures = clusterManager.getMap(Constants.FEATURES + Configurations.SEPARATOR + groupName);

            // check if the feature exist
            FeatureInfo feature = null;
            for (FeatureInfo info : clusterFeatures.keySet()) {
                if (version == null) {
                    if (info.getName().equals(name)) {
                        feature = info;
                        break;
                    }
                } else {
                    if (info.getName().equals(name) && info.getVersion().equals(version)) {
                        feature = info;
                        break;
                    }
                }
            }

            if (feature == null) {
                if (version == null)
                    throw new IllegalArgumentException("Feature " + name + " doesn't exist in cluster group " + groupName);
                else
                    throw new IllegalArgumentException("Feature " + name + "/" + version + " doesn't exist in cluster group " + groupName);
            }

            // update the features in the cluster group
            clusterFeatures.put(feature, true);
            try {
                // update the bundles in the cluster group
                // TODO does it make really sense
                List<BundleInfo> bundles = featuresService.getFeature(feature.getName(), version).getBundles();
                Map<String, BundleState> clusterBundles = clusterManager.getMap(org.apache.karaf.cellar.bundle.Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);
                for (BundleInfo bundle : bundles) {
                    BundleState state = new BundleState();
                    state.setLocation(bundle.getLocation());
                    state.setStatus(BundleEvent.STARTED);
View Full Code Here

Examples of org.apache.karaf.cellar.features.FeatureInfo

            // get the features in the cluster group
            Map<FeatureInfo, Boolean> clusterFeatures = clusterManager.getMap(Constants.FEATURES + Configurations.SEPARATOR + groupName);

            // check if the feature exist
            FeatureInfo feature = null;
            for (FeatureInfo info : clusterFeatures.keySet()) {
                if (version == null) {
                    if (info.getName().equals(name)) {
                        feature = info;
                        break;
View Full Code Here

Examples of org.apache.karaf.cellar.features.FeatureInfo

                // update the features repositories in the cluster group
                clusterRepositories.add(url);

                // update the features in the cluster group
                for (Feature feature : repository.getFeatures()) {
                    FeatureInfo info = new FeatureInfo(feature.getName(), feature.getVersion());
                    clusterFeatures.put(info, false);
                }

                // un-register the repository if it's not local registered
                if (!localRegistered)
View Full Code Here

Examples of org.apache.karaf.cellar.features.FeatureInfo

            // update the features repositories in the cluster group
            clusterRepositories.remove(url);

            // update the features in the cluster group
            for (Feature feature : repository.getFeatures()) {
                FeatureInfo info = new FeatureInfo(feature.getName(), feature.getVersion());
                clusterFeatures.remove(info);
            }

            // un-register the repository if it's not local registered
            if (!localRegistered)
View Full Code Here

Examples of org.apache.karaf.cellar.features.FeatureInfo

        try {
            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
            Group group = groupManager.findGroupByName(groupName);
            if (group == null || group.getNodes().isEmpty()) {

                FeatureInfo info = new FeatureInfo(feature, version);
                Map<FeatureInfo, Boolean> clusterFeatures = clusterManager.getMap(Constants.FEATURES + Configurations.SEPARATOR + groupName);
                // check the existing configuration
                if (version == null || (version.trim().length() < 1)) {
                    for (FeatureInfo f : clusterFeatures.keySet()) {
                        if (f.getName().equals(feature)) {
                            version = f.getVersion();
                            info.setVersion(version);
                        }
                    }
                }

                // check the features service
                try {
                    for (Feature f : featuresService.listFeatures()) {
                        if (f.getName().equals(feature)) {
                            version = f.getVersion();
                            info.setVersion(version);
                        }
                    }
                } catch (Exception e) {
                    LOGGER.error("Error while browsing features", e);
                }

                if (info.getVersion() != null && (info.getVersion().trim().length() > 0)) {
                    clusterFeatures.put(info, status);
                    result = Boolean.TRUE;
                }
            }
        } finally {
View Full Code Here

Examples of org.apache.karaf.cellar.features.FeatureInfo

                    // update the repositories in the cluster group
                    clusterRepositories.add(url);

                    // update the features in the cluster group
                    for (Feature feature : repository.getFeatures()) {
                        FeatureInfo info = new FeatureInfo(feature.getName(), feature.getVersion());
                        clusterFeatures.put(info, false);
                    }

                    // un-register the repository if it's not local registered
                    if (!localRegistered)
View Full Code Here

Examples of org.apache.karaf.cellar.features.FeatureInfo

                // update the repositories in the cluster group
                clusterRepositories.remove(url);

                // update the features in the cluster group
                for (Feature feature : repository.getFeatures()) {
                    FeatureInfo info = new FeatureInfo(feature.getName(), feature.getVersion());
                    clusterFeatures.remove(info);
                }

                // un-register the repository if it's not local registered
                if (!localRegistered)
View Full Code Here

Examples of org.apache.karaf.cellar.features.FeatureInfo

        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
            Group group = groupManager.findGroupByName(groupName);
            if (group == null || group.getNodes().isEmpty()) {
                FeatureInfo info = new FeatureInfo(feature, version);
                Map<FeatureInfo, Boolean> features = clusterManager.getMap(Constants.FEATURES + Configurations.SEPARATOR + groupName);
                //1st check the existing configuration
                if (version == null || (version.trim().length() < 1)) {
                    for (FeatureInfo f : features.keySet()) {
                        if (f.getName().equals(feature)) {
                            version = f.getVersion();
                            info.setVersion(version);
                        }
                    }
                }

                //2nd check the Features Service.
                try {
                    for (Feature f : featuresService.listFeatures()) {
                        if (f.getName().equals(feature)) {
                            version = f.getVersion();
                            info.setVersion(version);
                        }
                    }
                } catch (Exception e) {
                    LOGGER.error("Error while browsing features", e);
                }

                if (info.getVersion() != null && (info.getVersion().trim().length() > 0)) {
                    features.put(info, status);
                    result = Boolean.TRUE;
                }
            }
        } finally {
View Full Code Here

Examples of org.apache.karaf.cellar.features.FeatureInfo

        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
            Group group = groupManager.findGroupByName(groupName);
            if (group == null || group.getMembers().isEmpty()) {
                FeatureInfo info = new FeatureInfo(feature, version);
                Map<FeatureInfo, Boolean> features = clusterManager.getMap(Constants.FEATURES + Configurations.SEPARATOR + groupName);
                //1st check the existing configuration
                if (version == null || (version.trim().length() < 1)) {
                    for (FeatureInfo f : features.keySet()) {
                        if (f.getName().equals(feature)) {
                            version = f.getVersion();
                            info.setVersion(version);
                        }
                    }
                }

                //2nd check the Features Service.
                try {
                    for (Feature f : featuresService.listFeatures()) {
                        if (f.getName().equals(feature)) {
                            version = f.getVersion();
                            info.setVersion(version);
                        }
                    }
                } catch (Exception e) {
                    logger.error("Error while browsing features", e);
                }

                if (info.getVersion() != null && (info.getVersion().trim().length() > 0)) {
                    features.put(info, status);
                    result = Boolean.TRUE;
                }
            }
        } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.