The road so far….

September 21, 2010

TIP! : use ScheduledExecutor instead of Thread for polling or infinite loops

Filed under: java — Tags: — Rahul Sharma @ 10:34 pm

Often we have the requirement of polling/ long or infiniteĀ  running loops that should continually run and then break on a certain condition. These loops are often constructed using the Runnable interface and are scheduled as separated threads using theĀ  Thread class.

A typical code looks some thing like this: (more…)

September 5, 2010

Inserting and Indexing Bulk data in Neo4J

Filed under: java — Tags: — Rahul Sharma @ 10:23 pm

In my previous blog I tried to import some 151K names in Neo4J using Transactions, but the db gave me all sorts of exceptions while importing this much data. I was then advised to use BatchInserter api to import data in bulk as the Transaction interface keeps data in memory untill everything has been committed. On the other hand the BatchInserter directly writes back to store without any transaction mechanism. (more…)