Skip to content

Instantly share code, notes, and snippets.

@spmallette
Last active August 29, 2015 13:59
Show Gist options
  • Save spmallette/10464036 to your computer and use it in GitHub Desktop.
Save spmallette/10464036 to your computer and use it in GitHub Desktop.
g = TitanFactory.open('conf/titan-cassandra.properties')
//v1 = g.addVertex( null )
v1 = g.getVertex(4)
bytes = new byte[ 65536 ]
Arrays.fill( bytes, (byte) 0 )
i = 0;
lastTime = System.currentTimeMillis();
toRemove = null
while ( true ) {
def v2 = g.addVertex( null );
v2.setProperty('b',bytes)
if (toRemove != null) toRemove.remove()
toRemove = v2.addEdge( "last-data", v1 );
g.commit();
if ( i % 100 == 0 ) {
def duration = ( System.currentTimeMillis() - lastTime );
println "count:" + String.format( "%7s", i ) + ", duration:" + String.format( "%7s", duration ) + "ms"
lastTime = System.currentTimeMillis();
} // end if
i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment