long startime = System.currentTimeMillis();
System.out.println("Going to add 300,000 Edges! ");
cellgraph.addVertex(sourceCell);
for(int i =0; i <300000; i++){
CellLite_itf sourceCellTemp= new CellLite(10,155,27414529+i);
//cellgraph.addVertex(sourceCellTemp);
for(int k =0; k <60; k++){
CellLite_itf targetCellTemp= new CellLite(10,155,27412484+k);
//cellgraph.addVertex(targetCellTemp);
cellgraph.addEdgeExpiriment(sourceCellTemp, targetCellTemp);
}
}
long timetaken = (System.currentTimeMillis() -startime)/1000;
public void addEdgeExpiriment(CellLite_itf sourceCell, CellLite_itf adjcell) {
//TransactionalGraph tx = graph.newTransaction(); //Only needed for multithreaded application, was not showing much performance
Kpi_itf kpitemp = new Kpi_Edge(1.0, null, 0, 0);
Vertex sourceT= graph.addVertex(null);
sourceT.setProperty("EutranCell", new Integer(sourceCell.hashCode()).toString());
sourceT.setProperty("EutranCellObj", sourceCell);
Vertex targetT =graph.addVertex(null);
targetT.setProperty("EutranCell", new Integer(adjcell.hashCode()).toString());
targetT.setProperty("EutranCellObj", adjcell);
Edge edge= graph.addEdge(null,sourceT,targetT,"LNREL");
edge.setProperty("Kpi_startdate", kpitemp.getStartDate());
edge.setProperty("Kpi_enddate", kpitemp.getEndDate());
edge.setProperty("Kpi_value", kpitemp.getValue());
count++;
if(count % 10000 ==0){ --> I did this to batch writes to diskthough I know there is a conf.setProperty("tx-cache-size",60000)
System.out.println("100,00 Calls to AddEdgeCompleted Invocation=" +count + " TimeTaken=-" + (System.currentTimeMillis()-starttime));
starttime=System.currentTimeMillis();
//tx.commit();
graph.commit();
};
Configuration conf = new BaseConfiguration();
conf.setProperty("storage.backend","embeddedcassandra");
conf.setProperty("storage.conf-file","file:///d:/Program_Files/apache-cassandra-2.0.8/conf/cassandra.yaml");
conf.setProperty("ids.block-size",1000000);
conf.setProperty("storage.buffer-size",2024);
conf.setProperty("tx-cache-size",60000);
conf.setProperty("autotype","blueprints");
conf.setProperty("attributes.allow-all", true);
//conf.setProperty("storage.batch-loading",true);
TitanManagement mgmt = graph.getManagementSystem();
try{
mgmt.getEdgeLabel("LNREL");
}catch(IllegalArgumentException e)
{
System.out.println("Adding Edge and Poprety keys");
graph.makeEdgeLabel("LNREL").make();
graph.makePropertyKey("Kpi_startdate").dataType(Long.class).make();
graph.makePropertyKey("Kpi_enddate").dataType(Long.class).make();
graph.makePropertyKey("Kpi_value").dataType(Double.class).make();
graph.makePropertyKey("EutranCellObj").dataType(CellLite.class).make();
graph.makePropertyKey("EutranCell").dataType(String.class).make();
}