use of java.util.LinkedHashSet in project hazelcast by hazelcast.
the class MapServiceContextImpl method reloadOwnedPartitions.
@Override
public void reloadOwnedPartitions() {
IPartitionService partitionService = nodeEngine.getPartitionService();
Collection<Integer> partitions = partitionService.getMemberPartitions(nodeEngine.getThisAddress());
ownedPartitions.set(Collections.unmodifiableSet(new LinkedHashSet<Integer>(partitions)));
}
use of java.util.LinkedHashSet in project gradle by gradle.
the class JsonProjectDependencyRenderer method createInsight.
private List createInsight(ModuleIdentifier module, final Configuration configuration) {
final Spec<DependencyResult> dependencySpec = new StrictDependencyResultSpec(module);
ResolutionResult result = configuration.getIncoming().getResolutionResult();
final Set<DependencyResult> selectedDependencies = new LinkedHashSet<DependencyResult>();
result.allDependencies(new Action<DependencyResult>() {
@Override
public void execute(DependencyResult it) {
if (dependencySpec.isSatisfiedBy(it)) {
selectedDependencies.add(it);
}
}
});
Collection<RenderableDependency> sortedDeps = new DependencyInsightReporter().prepare(selectedDependencies, versionSelectorScheme, versionComparator);
return CollectionUtils.collect(sortedDeps, new Transformer<Object, RenderableDependency>() {
@Override
public Object transform(RenderableDependency dependency) {
String name = replaceArrow(dependency.getName());
LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>(5);
map.put("name", replaceArrow(dependency.getName()));
map.put("description", dependency.getDescription());
map.put("resolvable", dependency.getResolutionState());
map.put("hasConflict", !name.equals(dependency.getName()));
map.put("children", createInsightDependencyChildren(dependency, new HashSet<Object>(), configuration));
return map;
}
});
}
use of java.util.LinkedHashSet in project gradle by gradle.
the class DefaultArtifactSet method snapshot.
@Override
public ArtifactSet snapshot() {
ImmutableSet.Builder<ResolvedVariant> result = ImmutableSet.builder();
for (VariantMetadata variant : variants) {
Set<? extends ComponentArtifactMetadata> artifacts = variant.getArtifacts();
Set<ResolvedArtifact> resolvedArtifacts = new LinkedHashSet<ResolvedArtifact>(artifacts.size());
// Add artifact format as an implicit attribute when all artifacts have the same format
AttributeContainerInternal attributes = variant.getAttributes();
if (!attributes.contains(ArtifactAttributes.ARTIFACT_FORMAT)) {
String format = null;
for (ComponentArtifactMetadata artifact : artifacts) {
String candidateFormat = artifact.getName().getType();
if (format == null) {
format = candidateFormat;
} else if (!format.equals(candidateFormat)) {
format = null;
break;
}
}
if (format != null) {
attributes = attributesFactory.concat(attributes.asImmutable(), ArtifactAttributes.ARTIFACT_FORMAT, format);
}
}
for (ComponentArtifactMetadata artifact : artifacts) {
IvyArtifactName artifactName = artifact.getName();
if (exclusions.excludeArtifact(moduleVersionIdentifier.getModule(), artifactName)) {
continue;
}
ResolvedArtifact resolvedArtifact = allResolvedArtifacts.get(artifact.getId());
if (resolvedArtifact == null) {
Factory<File> artifactSource = new BuildOperationArtifactSource(buildOperationExecutor, artifact.getId(), new LazyArtifactSource(artifact, moduleSource, artifactResolver));
resolvedArtifact = new DefaultResolvedArtifact(moduleVersionIdentifier, artifactName, artifact.getId(), artifact.getBuildDependencies(), artifactSource);
allResolvedArtifacts.put(artifact.getId(), resolvedArtifact);
}
resolvedArtifacts.add(resolvedArtifact);
}
result.add(ArtifactBackedResolvedVariant.create(attributes, resolvedArtifacts));
}
return new ArtifactSetSnapshot(id, componentIdentifier, result.build());
}
use of java.util.LinkedHashSet in project gradle by gradle.
the class ExternalResourceResolver method doListModuleVersions.
private void doListModuleVersions(DependencyMetadata dependency, BuildableModuleVersionListingResolveResult result) {
ModuleIdentifier module = moduleIdentifierFactory.module(dependency.getRequested().getGroup(), dependency.getRequested().getName());
Set<String> versions = new LinkedHashSet<String>();
VersionPatternVisitor visitor = versionLister.newVisitor(module, versions, result);
// List modules based on metadata files (artifact version is not considered in listVersionsForAllPatterns())
IvyArtifactName metaDataArtifact = getMetaDataArtifactName(dependency.getRequested().getName());
listVersionsForAllPatterns(ivyPatterns, metaDataArtifact, visitor);
// List modules with missing metadata files
for (IvyArtifactName otherArtifact : getDependencyArtifactNames(dependency.getRequested().getName(), dependency.getArtifacts())) {
listVersionsForAllPatterns(artifactPatterns, otherArtifact, visitor);
}
result.listed(versions);
}
use of java.util.LinkedHashSet in project grails-core by grails.
the class FetchAllTaskSelectorsBuildAction method execute.
public AllTasksModel execute(BuildController controller) {
AllTasksModel model = new AllTasksModel();
Map<String, Set<String>> allTaskSelectors = new LinkedHashMap<String, Set<String>>();
model.allTaskSelectors = allTaskSelectors;
Map<String, Set<String>> allTasks = new LinkedHashMap<String, Set<String>>();
model.allTasks = allTasks;
Map<String, String> projectPaths = new HashMap<String, String>();
model.projectPaths = projectPaths;
for (BasicGradleProject project : controller.getBuildModel().getProjects()) {
BuildInvocations entryPointsForProject = controller.getModel(project, BuildInvocations.class);
Set<String> selectorNames = new LinkedHashSet<String>();
for (TaskSelector selector : entryPointsForProject.getTaskSelectors()) {
selectorNames.add(selector.getName());
}
allTaskSelectors.put(project.getName(), selectorNames);
Set<String> taskNames = new LinkedHashSet<String>();
for (Task task : entryPointsForProject.getTasks()) {
taskNames.add(task.getName());
}
allTasks.put(project.getName(), taskNames);
projectPaths.put(project.getName(), project.getPath());
if (project.getProjectDirectory().getAbsolutePath().equals(currentProjectPath)) {
model.currentProject = project.getName();
}
}
return model;
}
Aggregations