public Node getOrCreateNode(GraphDatabaseService _graphDb,Object _obj,Map<String, Object> _propsMap) {
long start=System.currentTimeMillis();
Validate.notNull(_obj);
Validate.notNull(_graphDb);
UniqueNodeFactory uniqueNodeFactory=new UniqueNodeFactory(_graphDb, CUSTOM_KEY_INDEX) {
@Override
protected void initialize(Node created, Map<String, Object> properties) {
created.setProperty(CUSTOM_KEY, properties.get(CUSTOM_KEY));
}
};
Node node= uniqueNodeFactory.getOrCreate(CUSTOM_KEY,_obj);
if (MapUtils.isNotEmpty(_propsMap)) {
for (String p : _propsMap.keySet()) {
if (!p.equals(CUSTOM_KEY)) {
Object objValue=_propsMap.get(p);
if (objValue instanceof List) {
Object objs=Neo4jTypeConverter.convertToNeo4jPropArray((List)objValue);
node.setProperty(p, objs);
}else {
node.setProperty(p, objValue);
}
}
}
}
if (LOG.isDebugEnabled()) {
long end=System.currentTimeMillis();
LOG.debug(GDBConstant.PROJECT+" "+node.getId()+",耗时:"+(end-start)+"ms");
}
return node;
}
neostore.nodestore.db.mapped_memory=250Mneostore.relationshipstore.db.mapped_memory=100Mneostore.propertystore.db.mapped_memory=100Mneostore.propertystore.db.strings.mapped_memory=100Mneostore.propertystore.db.arrays.mapped_memory=100M
vm.dirty_background_ratio = 50vm.dirty_ratio = 80
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Am 25.05.2015 um 03:45 schrieb Xin Su <suxinin...@gmail.com>:Thanks for your reply.I user verson 2.0.1 of Neo4j.
1000 nodes in a single transaction.
I don't hava the size of the heap.
My system has 12G memory and 300g hard drive