Skip to content

Instantly share code, notes, and snippets.

@yhemanth
yhemanth / TitanIndexTest.java
Created May 3, 2016 13:21
Test case that can be embedded in Apache Atlas to demonstrate Titan index query inconsistency
package org.apache.atlas.service;
import com.thinkaurelius.titan.core.Cardinality;
import com.thinkaurelius.titan.core.PropertyKey;
import com.thinkaurelius.titan.core.TitanGraph;
import com.thinkaurelius.titan.core.schema.TitanManagement;
import com.tinkerpop.blueprints.Vertex;
import org.apache.atlas.AtlasException;
import org.apache.atlas.repository.graph.TitanGraphProvider;
import org.testng.annotations.Test;
@yhemanth
yhemanth / index-property-value-update.groovy
Created May 3, 2016 13:08
A Gremlin Groovy script that illustrates a non-obvious behavior with Titan composite Indexes
g = TitanFactory.open("conf/titan-berkeleydb-es.properties")
m = g.getManagementSystem()
//constants
propertyName = "name"
statePropertyName = "state"
propertyValue = "value"
activeStateValue = "active"
deletedStateValue = "deleted"
@yhemanth
yhemanth / MapReduceDriver.java
Created March 27, 2013 05:03
Script and options that should be used to copy a memory dump from a node on Hadoop Cluster to HDFS on OutOfMemory in MR task - Thanks to Koji Noguchi (http://goo.gl/jWR4x)
conf.set("mapred.create.symlink", "yes");
conf.set("mapred.cache.files", "hdfs:///user/hemanty/scripts/copy_dump.sh#copy_dump.sh");
conf.set("mapred.child.java.opts",
"-Xmx200m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./heapdump.hprof -XX:OnOutOfMemoryError=./copy_dump.sh");