This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void readPathElement(final FaunusPathElement element, Schema schema, final DataInput in) throws IOException { | |
readElement(element,schema,in); | |
//in.readBoolean(); | |
element.pathEnabled = element.getConf().getBoolean(FaunusCompiler.PATH_ENABLED, false); | |
if (element.pathEnabled) { | |
element.paths = readElementPaths(in); | |
element.microVersion = (element instanceof FaunusVertex) ? new FaunusVertex.MicroVertex(element.id) : new FaunusEdge.MicroEdge(element.id); | |
} else | |
element.pathCounter = WritableUtils.readVLong(in); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# input graph parameters | |
faunus.graph.input.format=com.thinkaurelius.faunus.formats.titan.cassandra.TitanCassandraInputFormat | |
faunus.graph.input.titan.storage.backend=cassandrathrift | |
faunus.graph.input.titan.storage.hostname=localhost | |
faunus.graph.input.titan.storage.port=9160 | |
faunus.graph.input.titan.storage.keyspace=titan | |
cassandra.input.partitioner.class=org.apache.cassandra.dht.Murmur3Partitioner | |
# cassandra.input.split.size=512 | |
# cassandra.thrift.framed.size_mb=49 | |
# cassandra.thrift.message.max_size_mb=50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<version>2.4.2</version> | |
<configuration> | |
<excludes> | |
<exclude>**/*CassandaOutputFormatTest.java</exclude> | |
</excludes> | |
</configuration> | |
</plugin> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testBulkEdgeDerivations() throws Exception { | |
TitanGraph g = generateTitanGraph(); | |
bulkLoadGraphOfTheGods(); | |
FaunusGraph f = generateFaunusGraph(TitanCassandraOutputFormat.class.getResourceAsStream("cassandra-cassandra.properties")); | |
new FaunusPipeline(f).V().as("x").out("father").out("father").linkIn("grandfather", "x").submit(); | |
assertEquals(12, new GremlinPipeline(g).V().count()); | |
assertEquals(18, new GremlinPipeline(g).E().count()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (this.trackState && faunusVertex.isLoaded()) { | |
final TitanVertex titanVertex = (TitanVertex) this.graph.getVertex(faunusVertex.getId()); | |
for (final FaunusProperty property : faunusVertex.getPropertiesWithState()) { | |
if (property.isNew()) { | |
// TODO is this right? | |
titanVertex.addProperty(property.getName(), property.getValue()); | |
context.getCounter(Counters.VERTEX_PROPERTIES_CREATED).increment(1l); | |
} else if (property.isDeleted()) { | |
// TODO: what if there are multiple properties of the same key? | |
titanVertex.removeProperty(property.getName()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// do all property deletions, then do all property additions (ensures proper order of operations) | |
for (final FaunusProperty faunusProperty : faunusEdge.getPropertiesWithState()) { | |
if (faunusProperty.isDeleted()) { | |
titanEdge.removeProperty(faunusProperty.getName()); | |
context.getCounter(Counters.EDGE_PROPERTIES_DELETED).increment(1l); | |
} | |
} | |
for (final FaunusProperty faunusProperty : faunusEdge.getPropertiesWithState()) { | |
if (faunusProperty.isNew()) { | |
titanEdge.setProperty(faunusProperty.getName(), faunusProperty.getValue()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-failsafe-plugin</artifactId> | |
<version>2.16</version> | |
<executions> | |
<execution> | |
<id>titan-cassandra-test</id> | |
<goals> | |
<goal>integration-test</goal> | |
</goals> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Vertex extends Element { | |
static final String V = "v"; | |
static final String L_BRACKET = "["; | |
static final String R_BRACKET = "]"; | |
public default Set<String> getPropertyKeys() { | |
return this.getProperties().keySet(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Extension { | |
public default Optional<Object[]> beforeAddVertex(Optional<Object[]> keyValues) { | |
return keyValues; | |
} | |
public default Optional<Vertex> afterAddVertex(Optional<Vertex> vertex) { | |
return vertex; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tinkerpop.blueprints.extension; | |
import com.tinkerpop.blueprints.Graph; | |
import com.tinkerpop.blueprints.Vertex; | |
import com.tinkerpop.blueprints.util.ElementHelper; | |
import java.util.Arrays; | |
import java.util.Optional; | |
/** |