public AggregationOptions( final AggregationOptions options, final ProjectRelationshipFilter filter ) { this.filter = filter; this.processIncomplete = options.processIncompleteSubgraphs(); this.processVariable = options.processVariableSubgraphs(); this.discoveryEnabled = options.isDiscoveryEnabled(); this.discoverySource = options.getDiscoverySource(); this.discoveryTimeoutMillis = options.getDiscoveryTimeoutMillis(); this.dc = options.getDiscoveryConfig(); }
private AggregationOptions createAggregationOptions( final AbstractGraphRequest recipe, final ProjectRelationshipFilter baseFilter ) throws CartoDataException, CartoRequestException { final AggregationOptions options = new AggregationOptions(); options.setDiscoveryEnabled( recipe.isResolve() ); options.setFilter( recipe.buildFilter( baseFilter ) ); options.setDiscoveryConfig( recipe.getDiscoveryConfig() ); options.setProcessIncompleteSubgraphs( true ); options.setProcessVariableSubgraphs( true ); return options; }
public RepoContentCollector( final ProjectVersionRef ref, final ProjectRefCollection refs, final RepositoryContentRequest recipe, final Location location, final DiscoveryConfig discoveryConfig, final ArtifactManager artifacts, final ProjectRelationshipDiscoverer discoverer, final Set<Location> excluded, final int projectCounter, final int projectSz ) { this.ref = ref; this.refs = refs.getArtifactRefs(); this.recipe = recipe; this.location = location; this.discoveryConfig = discoveryConfig; this.artifacts = artifacts; this.discoverer = discoverer; this.excluded = excluded; this.projectCounter = projectCounter; this.projectSz = projectSz; this.counter = 0; this.artifactSz = refs.getArtifactRefs() .size(); }
public static Map<ProjectRef, ProjectRefCollection> collectProjectReferences( final Map<ProjectVersionRef, Map<ArtifactRef, ConcreteResource>> refMap ) { final Map<ProjectRef, ProjectRefCollection> projects = new HashMap<>(); for ( final Map.Entry<ProjectVersionRef, Map<ArtifactRef, ConcreteResource>> projectEntry : refMap.entrySet() ) { final ProjectVersionRef pvr = projectEntry.getKey(); final ProjectRef r = pvr.asProjectRef(); ProjectRefCollection prc = projects.get( r ); if ( prc == null ) { prc = new ProjectRefCollection(); projects.put( r, prc ); } prc.addVersionRef( pvr ); prc.addArtifactRef( pvr.asPomArtifact() ); for ( final ArtifactRef ar : projectEntry.getValue() .keySet() ) { prc.addArtifactRef( ar ); } } return projects; }
private Set<DiscoveryTodo> discover( final Set<DiscoveryTodo> todos, final AggregationOptions config, final Set<ProjectVersionRef> missing, final Map<ProjectVersionRef, Set<ProjectRef>> seen, final int pass ) throws CartoDataException { logger.info( "Starting pass: {}", pass ); logger.debug( "{}. Performing discovery and cycle-detection on {} missing subgraphs:\n {}", pass, todos.size(), new JoinString( "\n ", todos ) ); final Set<DiscoveryRunnable> runnables = executeTodoBatch( todos, config, missing, seen, /*cycleParticipants,*/pass ); logger.debug( "{}. Accounting for discovery results. Before discovery, these were missing:\n\n {}\n\n", pass, new JoinString( "\n ", missing ) ); final Map<ProjectVersionRef, DiscoveryTodo> nextTodos = new HashMap<ProjectVersionRef, DiscoveryTodo>(); for ( final DiscoveryRunnable r : runnables ) { if ( !processDiscoveryOutput( r, nextTodos, config.getDiscoveryConfig(), seen, pass ) ) { markMissing( r, missing, pass ); } } logger.info( "{}. After discovery, {} are missing", pass, missing.size() ); logger.debug( "Missing:\n\n {}\n\n", new JoinString( "\n ", missing ) ); return new HashSet<DiscoveryTodo>( nextTodos.values() ); }
public static Map<ProjectVersionRef, ProjectRefCollection> collectProjectVersionReferences( final RelationshipGraph graph ) { final Collection<ProjectRelationship<?, ?>> rels = graph.getAllRelationships(); final Map<ProjectVersionRef, ProjectRefCollection> result = collectProjectVersionReferences( rels ); for ( final ProjectVersionRef root : graph.getParams() .getRoots() ) { ProjectRefCollection collection = result.get( root ); if ( collection == null ) { collection = new ProjectRefCollection(); result.put( root, collection ); } collection.addArtifactRef( root.asPomArtifact() ); } return result; }
throws CartoDataException if ( graph != null && config.isDiscoveryEnabled() )
public void addArtifactRef( final ArtifactRef ref ) { addVersionRef( ref.asProjectVersionRef() ); artifactRefs.add( ref ); }
public AggregationOptions( final AggregationOptions options, final ProjectRelationshipFilter filter ) { this.filter = filter; this.processIncomplete = options.processIncompleteSubgraphs(); this.processVariable = options.processVariableSubgraphs(); this.discoveryEnabled = options.isDiscoveryEnabled(); this.discoverySource = options.getDiscoverySource(); this.discoveryTimeoutMillis = options.getDiscoveryTimeoutMillis(); this.dc = options.getDiscoveryConfig(); }
private AggregationOptions createAggregationOptions( final AbstractGraphRequest recipe, final ProjectRelationshipFilter baseFilter ) throws CartoDataException, CartoRequestException { final AggregationOptions options = new AggregationOptions(); options.setDiscoveryEnabled( recipe.isResolve() ); options.setFilter( recipe.buildFilter( baseFilter ) ); options.setDiscoveryConfig( recipe.getDiscoveryConfig() ); options.setProcessIncompleteSubgraphs( true ); options.setProcessVariableSubgraphs( true ); return options; }
public static Map<ProjectRef, ProjectRefCollection> collectProjectReferences( final Map<ProjectVersionRef, Map<ArtifactRef, ConcreteResource>> refMap ) { final Map<ProjectRef, ProjectRefCollection> projects = new HashMap<>(); for ( final Map.Entry<ProjectVersionRef, Map<ArtifactRef, ConcreteResource>> projectEntry : refMap.entrySet() ) { final ProjectVersionRef pvr = projectEntry.getKey(); final ProjectRef r = pvr.asProjectRef(); ProjectRefCollection prc = projects.get( r ); if ( prc == null ) { prc = new ProjectRefCollection(); projects.put( r, prc ); } prc.addVersionRef( pvr ); prc.addArtifactRef( pvr.asPomArtifact() ); for ( final ArtifactRef ar : projectEntry.getValue() .keySet() ) { prc.addArtifactRef( ar ); } } return projects; }
private Set<DiscoveryTodo> discover( final Set<DiscoveryTodo> todos, final AggregationOptions config, final Set<ProjectVersionRef> missing, final Set<ProjectVersionRef> seen, final int pass ) throws CartoDataException { logger.info( "Starting pass: {}", pass ); logger.debug( "{}. Performing discovery and cycle-detection on {} missing subgraphs:\n {}", pass, todos.size(), new JoinString( "\n ", todos ) ); final Set<DiscoveryRunnable> runnables = executeTodoBatch( todos, config, missing, seen, /*cycleParticipants,*/pass ); logger.debug( "{}. Accounting for discovery results. Before discovery, these were missing:\n\n {}\n\n", pass, new JoinString( "\n ", missing ) ); final Map<ProjectVersionRef, DiscoveryTodo> nextTodos = new HashMap<ProjectVersionRef, DiscoveryTodo>(); for ( final DiscoveryRunnable r : runnables ) { if ( !processDiscoveryOutput( r, nextTodos, config.getDiscoveryConfig(), seen, pass ) ) { markMissing( r, missing, pass ); } } logger.info( "{}. After discovery, {} are missing", pass, missing.size() ); logger.debug( "Missing:\n\n {}\n\n", new JoinString( "\n ", missing ) ); return new HashSet<DiscoveryTodo>( nextTodos.values() ); }
public static Map<ProjectVersionRef, ProjectRefCollection> collectProjectVersionReferences( final RelationshipGraph graph ) { final Collection<ProjectRelationship<?, ?>> rels = graph.getAllRelationships(); final Map<ProjectVersionRef, ProjectRefCollection> result = collectProjectVersionReferences( rels ); for ( final ProjectVersionRef root : graph.getParams() .getRoots() ) { ProjectRefCollection collection = result.get( root ); if ( collection == null ) { collection = new ProjectRefCollection(); result.put( root, collection ); } collection.addArtifactRef( root.asPomArtifact() ); } return result; }
public void addArtifactRef( final ArtifactRef ref ) { addVersionRef( ref.asProjectVersionRef() ); artifactRefs.add( ref ); }
public RepoContentCollector( final ProjectVersionRef ref, final ProjectRefCollection refs, final RepositoryContentRequest recipe, final Location location, final DiscoveryConfig discoveryConfig, final ArtifactManager artifacts, final ProjectRelationshipDiscoverer discoverer, final Set<Location> excluded, final int projectCounter, final int projectSz ) { this.ref = ref; this.refs = refs.getArtifactRefs(); this.recipe = recipe; this.location = location; this.discoveryConfig = discoveryConfig; this.artifacts = artifacts; this.discoverer = discoverer; this.excluded = excluded; this.projectCounter = projectCounter; this.projectSz = projectSz; this.counter = 0; this.artifactSz = refs.getArtifactRefs() .size(); }
if ( prc == null ) prc = new ProjectRefCollection(); projects.put( pvr, prc ); prc.addVersionRef( pvr ); prc.addArtifactRef( pvr.asPomArtifact() ); if ( tprc == null ) tprc = new ProjectRefCollection(); projects.put( tr, tprc ); tprc.addArtifactRef( tar );
final DiscoveryConfig discoveryConfig = config.getDiscoveryConfig();
if ( prc == null ) prc = new ProjectRefCollection(); projects.put( pvr, prc ); prc.addVersionRef( pvr ); prc.addArtifactRef( pvr.asPomArtifact() ); if ( tprc == null ) tprc = new ProjectRefCollection(); projects.put( tr, tprc ); tprc.addArtifactRef( tar );
if ( prc == null ) prc = new ProjectRefCollection(); projects.put( r, prc ); prc.addVersionRef( pvr ); prc.addArtifactRef( pvr.asPomArtifact() ); if ( tprc == null ) tprc = new ProjectRefCollection(); projects.put( tr, tprc ); tprc.addArtifactRef( tar );
if ( prc == null ) prc = new ProjectRefCollection(); projects.put( r, prc ); prc.addVersionRef( pvr ); prc.addArtifactRef( pvr.asPomArtifact() ); if ( tprc == null ) tprc = new ProjectRefCollection(); projects.put( tr, tprc ); tprc.addArtifactRef( tar );