Package org.lab41.dendrite.metagraph

Examples of org.lab41.dendrite.metagraph.DendriteGraphTx.commit()


                          .make();
              }
            }

            // commit the indices
            graph.commit();

            InputStream inputStream = file.getInputStream();
            if (format.equalsIgnoreCase("GraphSON")) {
                GraphSONReader.inputGraph(graph, inputStream);
            } else if (format.equalsIgnoreCase("GraphML")) {
View Full Code Here


            tx.rollback();

            return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
        }

        tx.commit();

        return new ResponseEntity<>(byteArrayOutputStream.toByteArray(), headers, HttpStatus.OK);
    }

    @PreAuthorize("hasPermission(#graphId, 'graph', 'admin')")
View Full Code Here

            response.put("status", "error");
            response.put("msg", "exception: " + e.toString());
            return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST);
        }

        tx.commit();

        response.put("status", "ok");

        return new ResponseEntity<>(response, HttpStatus.NO_CONTENT);
    }
View Full Code Here

                    .indexed("search", Vertex.class)
                    .make();
            srcTx.makeLabel("friends").make();
            srcTx.makeLabel("enemies").make();
        } finally {
            srcTx.commit();
        }

        // Create a trivial graph.
        srcTx = srcGraph.newTransaction();
        try {
View Full Code Here

            srcTx.addEdge(null, srcAVertex, srcBVertex, "friends");
            srcTx.addEdge(null, srcBVertex, srcCVertex, "enemies");
            srcTx.addEdge(null, srcCVertex, srcDVertex, "friends");
        } finally {
            srcTx.commit();
        }
    }

    @After
    public void tearDown() throws IOException {
View Full Code Here

            Assert.assertFalse(dstTx.getVertices("name", "B").iterator().hasNext());
            Assert.assertFalse(dstTx.getVertices("name", "C").iterator().hasNext());
            Assert.assertFalse(dstTx.getVertices("name", "D").iterator().hasNext());
        } finally {
            dstTx.commit();
        }
    }

    @Test
    public void testStep1() {
View Full Code Here

            Assert.assertFalse(dstBVertex.getEdges(Direction.OUT).iterator().hasNext());

            Assert.assertFalse(dstTx.getVertices("name", "C").iterator().hasNext());
            Assert.assertFalse(dstTx.getVertices("name", "D").iterator().hasNext());
        } finally {
            dstTx.commit();
        }
    }

    @Test
    public void testStep2() {
View Full Code Here

            Assert.assertFalse(dstCVertex.getEdges(Direction.OUT).iterator().hasNext());

            Assert.assertFalse(dstTx.getVertices("name", "D").iterator().hasNext());
        } finally {
            dstTx.commit();
        }
    }
}
View Full Code Here

                }

                response.put("vertices", new ArrayList<>(verticesMap.values()));
                response.put("edges", new ArrayList<>(edgesMap.values()));
            } finally {
                dendriteGraphTx.commit();
            }

            return new ResponseEntity<>(response, HttpStatus.OK);
        } finally {
            tx.commit();
View Full Code Here

            if (dstTx.getType(keyVertex.getName()) == null) {
                dstTx.makeEdgeLabel(keyVertex.getName(), definition);
            }
        }

        dstTx.commit();
        srcTx.commit();
    }

    protected abstract void copyGraph(DendriteGraph srcGraph, DendriteGraph dstGraph);
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.