Examples of KryoReader


Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoReader

            writer.writeVertex(os, v1, Direction.BOTH);

            final AtomicBoolean vertexCalled = new AtomicBoolean(false);
            final AtomicBoolean edgeCalled = new AtomicBoolean(false);

            final KryoReader reader = KryoReader.build()
                    .custom(graphProvider.createConfiguredGremlinKryo())
                    .workingDirectory(File.separator + "tmp").create();
            try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                reader.readVertex(bais, Direction.OUT, detachedVertex -> {
                            assertEquals(v1.id(), detachedVertex.id());
                            assertEquals(v1.label(), detachedVertex.label());
                            assertEquals(0, StreamFactory.stream(detachedVertex.iterators().hiddenPropertyIterator()).count());
                            assertEquals(1, StreamFactory.stream(detachedVertex.iterators().propertyIterator()).count());
                            assertEquals(v1.value("name"), detachedVertex.value("name").toString());
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoReader

        try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
            final KryoWriter writer = KryoWriter.build().custom(graphProvider.createConfiguredGremlinKryo()).create();
            writer.writeVertex(os, v1, Direction.OUT);

            final KryoReader reader = KryoReader.build()
                    .custom(graphProvider.createConfiguredGremlinKryo())
                    .workingDirectory(File.separator + "tmp").create();
            try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                reader.readVertex(bais,
                        Direction.BOTH,
                        detachedVertex -> null,
                        detachedEdge -> null);
            }
        }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoReader

        try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
            final KryoWriter writer = KryoWriter.build().custom(graphProvider.createConfiguredGremlinKryo()).create();
            writer.writeVertex(os, v1, Direction.IN);

            final KryoReader reader = KryoReader.build()
                    .custom(graphProvider.createConfiguredGremlinKryo())
                    .workingDirectory(File.separator + "tmp").create();
            try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                reader.readVertex(bais,
                        Direction.BOTH,
                        detachedVertex -> null,
                        detachedEdge -> null);
            }
        }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoReader

        try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
            final KryoWriter writer = KryoWriter.build().custom(graphProvider.createConfiguredGremlinKryo()).create();
            writer.writeVertex(os, v1, Direction.IN);

            final KryoReader reader = KryoReader.build()
                    .custom(graphProvider.createConfiguredGremlinKryo())
                    .workingDirectory(File.separator + "tmp").create();
            try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                reader.readVertex(bais,
                        Direction.OUT,
                        detachedVertex -> null,
                        detachedEdge -> null);
            }
        }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoReader

        try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
            final KryoWriter writer = KryoWriter.build().custom(graphProvider.createConfiguredGremlinKryo()).create();
            writer.writeVertex(os, v1, Direction.IN);

            final KryoReader reader = KryoReader.build()
                    .custom(graphProvider.createConfiguredGremlinKryo())
                    .workingDirectory(File.separator + "tmp").create();
            try (final ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray())) {
                reader.readVertex(bais,
                        Direction.OUT,
                        detachedVertex -> null,
                        detachedEdge -> null);
            }
        }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoReader

    }

    private void inflateTinkerVertex() {
        try {
            final ByteArrayInputStream bis = new ByteArrayInputStream(this.getValue().getBytes());
            final KryoReader reader = KryoReader.build().create();
            final TinkerGraph tinkerGraph = TinkerGraph.open();
            reader.readGraph(bis, tinkerGraph);
            bis.close();
            this.tinkerVertex = (TinkerVertex) tinkerGraph.v(tinkerGraph.variables().get(VERTEX_ID).get());
        } catch (final Exception e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.io.kryo.KryoReader

        try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
            final KryoWriter writer = KryoWriter.build().create();
            writer.writeVertices(os, g.V(), Direction.BOTH);

            final AtomicInteger called = new AtomicInteger(0);
            final KryoReader reader = KryoReader.build()
                    .workingDirectory(File.separator + "tmp").create();

            VertexStreamIterator vsi = new VertexStreamIterator(new ByteArrayInputStream(os.toByteArray()), reader);

            boolean found = false;
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.