Package com.tinkerpop.blueprints.impls.tg

Examples of com.tinkerpop.blueprints.impls.tg.IgnoreIdTinkerGraph


    }

    public void testLoadingWithExisting2() {
        int numEdges = 1000;
        String[][] quads = generateQuads(100, numEdges, new String[]{"knows", "friend"});
        TinkerGraph tg = new IgnoreIdTinkerGraph();
        BatchGraph bg = new BatchGraph(new WritethroughGraph(tg), VertexIDType.STRING, 100);
        try {
            bg.setLoadingFromScratch(false);
            fail();
        } catch (IllegalStateException e) {
        }
        bg.setVertexIdKey("uid");
        bg.setLoadingFromScratch(false);
        try {
            bg.setVertexIdKey(null);
            fail();
        } catch (IllegalStateException e) {
        }

        Graph graph = null;
        int counter = 0;
        for (String[] quad : quads) {
            if (counter < numEdges / 2) graph = tg;
            else graph = bg;

            Vertex[] vertices = new Vertex[2];
            for (int i = 0; i < 2; i++) {
                vertices[i] = graph.getVertex(quad[i]);
                if (vertices[i] == null) vertices[i] = graph.addVertex(quad[i]);
            }
            Edge edge = graph.addEdge(null, vertices[0], vertices[1], quad[2]);
            edge.setProperty("annotation", quad[3]);
            counter++;
        }
        assertEquals(numEdges, BaseTest.count(tg.getEdges()));

        bg.shutdown();
    }
View Full Code Here


    public void loadingTest(int total, int bufferSize, VertexIDType type, LoadingFactory ids) {
        final VertexEdgeCounter counter = new VertexEdgeCounter();

        MockTransactionalGraph tgraph = null;
        if (ignoreIDs) {
            tgraph = new MockTransactionalGraph(new IgnoreIdTinkerGraph());
        } else {
            tgraph = new MockTransactionalGraph(new TinkerGraph());
        }

        BLGraph graph = new BLGraph(tgraph, counter, ids);
View Full Code Here

TOP

Related Classes of com.tinkerpop.blueprints.impls.tg.IgnoreIdTinkerGraph

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.