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 static void write(final Map<String, Object> properties, final DataOutput out) throws IOException { | |
if (null == properties) { | |
WritableUtils.writeVInt(out, 0); | |
} else { | |
WritableUtils.writeVInt(out, properties.size()); | |
for (final Map.Entry<String, Object> entry : properties.entrySet()) { | |
out.writeUTF(entry.getKey()); | |
final Class valueClass = entry.getValue().getClass(); | |
final Object valueObject = entry.getValue(); | |
if (valueClass.equals(Integer.class)) { |
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 static void write(final Map<String, Object> properties, final DataOutput out) throws IOException { | |
if (null == properties) { | |
WritableUtils.writeVInt(out, 0); | |
} else { | |
WritableUtils.writeVInt(out, properties.size()); | |
com.thinkaurelius.titan.graphdb.database.serialize.DataOutput o = s.getDataOutput(128, true); | |
for (final Map.Entry<String, Object> entry : properties.entrySet()) { | |
o.putString(entry.getKey()); | |
o.writeClassAndObject(entry.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
protected FaunusVertex readFaunusVertex(final ByteBuffer key, Iterable<Entry> entries) { | |
FaunusVertexLoader loader = new FaunusVertexLoader(key); | |
for (Entry data : entries) { | |
try { | |
FaunusVertexLoader.RelationFactory factory = loader.getFactory(); | |
super.edgeSerializer.readRelation(factory,data,tx); | |
factory.build(); | |
} catch (Exception e) { | |
//Log exception | |
} |
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
conf = new BaseConfiguration() | |
conf.setProperty("storage.backend","cassandra") | |
//conf.setProperty("storage.hostname","localhost") | |
conf.setProperty("storage.hostname","10.172.137.237,10.174.89.108,10.172.111.134") | |
conf.setProperty("storage.batch-loading","true") | |
g = TitanFactory.open(conf) | |
bg = new BatchGraph(g, VertexIDType.NUMBER, 2000); | |
bg.setVertexIdKey("uid") | |
def getOrCreate(BatchGraph bg, long id) { |
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
@Condition("it.out('authored').hasNext()") | |
@GremlinGroovy(frame = false, value = | |
""" | |
other = g.V('uri',authorUri).next() | |
c = 0; | |
it.as('x').out('authored').in('authored').loop('x'){ | |
c++ < 100 & | |
new HashSet(it.path).size() == it.path.size() & | |
it.object != other | |
}.simplePath.path{it}{null}.transform{it.minus(null)}.toList() |
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
@ExtensionNaming(namespace = "egosystem", name = "faunus") | |
class FaunusExtension extends AbstractRexsterExtension { | |
private static FaunusGremlinScriptEngine engine = new FaunusGremlinScriptEngine(); | |
static { | |
Configuration configuration = new Configuration(); | |
Properties properties = new Properties(); | |
properties.load(FaunusExtension.class.getResourceAsStream("titan-cassandra-input.properties")); | |
for (Map.Entry<Object, Object> entry : properties.entrySet()) { |
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 testUpdateValuesInIndexKeys() throws Exception { | |
KeyIndexableGraph graph = (KeyIndexableGraph) graphTest.generateGraph(); | |
graph.createKeyIndex("name", Vertex.class); | |
Vertex v1 = graph.addVertex(null); | |
v1.setProperty("name","marko"); | |
assertEquals(v1.getProperty("name"),"marko"); | |
vertexCount(graph, 1); | |
if(graph instanceof TransactionalGraph) |
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.furnace.algorithms.vertexcentric.programs.ranking; | |
import com.tinkerpop.blueprints.Direction; | |
import com.tinkerpop.blueprints.Edge; | |
import com.tinkerpop.blueprints.Vertex; | |
import com.tinkerpop.blueprints.util.EdgeHelper; | |
import com.tinkerpop.furnace.algorithms.vertexcentric.GraphMemory; | |
import com.tinkerpop.furnace.algorithms.vertexcentric.programs.AbstractVertexProgram; | |
import com.tinkerpop.furnace.util.VertexQueryBuilder; | |
import com.tinkerpop.pipes.PipeFunction; |
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.thinkaurelius.faunus.formats.titan; | |
import com.thinkaurelius.faunus.FaunusVertex; | |
import com.thinkaurelius.faunus.Holder; | |
import com.thinkaurelius.faunus.formats.BlueprintsGraphOutputMapReduce; | |
import com.thinkaurelius.faunus.formats.JobConfigurationFormat; | |
import com.thinkaurelius.faunus.formats.MapReduceFormat; | |
import com.thinkaurelius.faunus.formats.noop.NoOpOutputFormat; | |
import com.thinkaurelius.faunus.hdfs.HDFSTools; | |
import com.thinkaurelius.faunus.mapreduce.FaunusCompiler; |
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.thinkaurelius.faunus.formats.titan; | |
import com.thinkaurelius.faunus.FaunusVertex; | |
import com.thinkaurelius.faunus.Holder; | |
import com.thinkaurelius.faunus.formats.BlueprintsGraphOutputMapReduce; | |
import com.thinkaurelius.faunus.formats.JobConfigurationFormat; | |
import com.thinkaurelius.faunus.formats.MapReduceFormat; | |
import com.thinkaurelius.faunus.formats.noop.NoOpOutputFormat; | |
import com.thinkaurelius.faunus.hdfs.HDFSTools; | |
import com.thinkaurelius.faunus.mapreduce.FaunusCompiler; |