Search in sources :

Example 6 with DefaultVertexHopCriteria

use of org.opennms.features.topology.api.support.VertexHopGraphProvider.DefaultVertexHopCriteria in project opennms by OpenNMS.

the class VertexHopGraphProviderScaleTest method testGraphProvider.

@Test
public void testGraphProvider() {
    VertexRef randomVertex = randomVertex();
    DefaultVertexHopCriteria criteria = new DefaultVertexHopCriteria(randomVertex);
    LOG.info("Focus Nodes: {}", criteria.getVertices());
    long start = System.nanoTime();
    List<Vertex> vertices2 = m_provider.getVertices(criteria);
    long end = System.nanoTime();
    double time = (end - start) / (1000000.0);
    LOG.info("ElapsedTime = {} ms", time);
    LOG.info("{}, {}, {}, {}", m_vertexCount, m_edgeCount, time, vertices2.size());
}
Also used : DefaultVertexHopCriteria(org.opennms.features.topology.api.support.VertexHopGraphProvider.DefaultVertexHopCriteria) Vertex(org.opennms.features.topology.api.topo.Vertex) DefaultVertexRef(org.opennms.features.topology.api.topo.DefaultVertexRef) VertexRef(org.opennms.features.topology.api.topo.VertexRef) Test(org.junit.Test)

Example 7 with DefaultVertexHopCriteria

use of org.opennms.features.topology.api.support.VertexHopGraphProvider.DefaultVertexHopCriteria in project opennms by OpenNMS.

the class SimpleSearchProvider method addVertexHopCriteria.

@Override
public void addVertexHopCriteria(SearchResult searchResult, GraphContainer container) {
    LOG.debug("SimpleSearchProvider->addVertexHopCriteria: called with search result: '{}'", searchResult);
    final DefaultVertexHopCriteria criterion = new DefaultVertexHopCriteria(new DefaultVertexRef(searchResult.getNamespace(), searchResult.getId(), searchResult.getLabel()));
    container.addCriteria(criterion);
    LOG.debug("SimpleSearchProvider->addVertexHop: adding hop criteria {}.", criterion);
    LOG.debug("SimpleSearchProvider->addVertexHop: current criteria {}.", Arrays.toString(container.getCriteria()));
}
Also used : DefaultVertexHopCriteria(org.opennms.features.topology.api.support.VertexHopGraphProvider.DefaultVertexHopCriteria)

Aggregations

DefaultVertexHopCriteria (org.opennms.features.topology.api.support.VertexHopGraphProvider.DefaultVertexHopCriteria)7 DefaultVertexRef (org.opennms.features.topology.api.topo.DefaultVertexRef)3 Test (org.junit.Test)2 VertexRef (org.opennms.features.topology.api.topo.VertexRef)2 GraphContainer (org.opennms.features.topology.api.GraphContainer)1 Vertex (org.opennms.features.topology.api.topo.Vertex)1