|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.neo4j.kernel.impl.batchinsert.BatchInserterImpl
public class BatchInserterImpl
| Constructor Summary | |
|---|---|
BatchInserterImpl(String storeDir)
|
|
BatchInserterImpl(String storeDir,
Map<String,String> stringParams)
|
|
| Method Summary | |
|---|---|
void |
createNode(long id,
Map<String,Object> properties)
Creates a node with supplied id and properties. |
long |
createNode(Map<String,Object> properties)
Creates a node assigning next available id to id and also adds any properties supplied. |
long |
createRelationship(long node1,
long node2,
RelationshipType type,
Map<String,Object> properties)
Creates a relationship between two nodes of a specific type. |
GraphDatabaseService |
getGraphDbService()
|
IdGeneratorFactory |
getIdGeneratorFactory()
|
IndexStore |
getIndexStore()
|
Map<String,Object> |
getNodeProperties(long nodeId)
Returns a map containing all the properties of this node. |
long |
getReferenceNode()
Returns the reference node id or -1 if it doesn't exist. |
SimpleRelationship |
getRelationshipById(long relId)
Gets a relationship by id. |
Iterable<Long> |
getRelationshipIds(long nodeId)
Returns an iterable over all the relationship ids connected to node with supplied id. |
Map<String,Object> |
getRelationshipProperties(long relId)
Returns a map containing all the properties of the relationships. |
Iterable<SimpleRelationship> |
getRelationships(long nodeId)
Returns an iterable of relationships connected
to the node with supplied id. |
String |
getStore()
Returns the path to this Neo4j store. |
static Map<String,String> |
loadProperties(String file)
|
boolean |
nodeExists(long nodeId)
Checks if a node with the given id exists. |
boolean |
nodeHasProperty(long node,
String propertyName)
Returns true iff the node with id has a property with name . |
boolean |
relationshipHasProperty(long relationship,
String propertyName)
Returns true iff the relationship with id has a property with name . |
void |
removeNodeProperty(long node,
String propertyName)
Removes the property named from the node with id , if present. |
void |
removeRelationshipProperty(long relationship,
String propertyName)
Removes the property named from the relationship with id , if present. |
void |
setNodeProperties(long node,
Map<String,Object> properties)
Sets the properties of a node. |
void |
setNodeProperty(long node,
String propertyName,
Object propertyValue)
Sets the property with name of node with id to the value . |
void |
setRelationshipProperties(long rel,
Map<String,Object> properties)
Sets the properties of a relationship. |
void |
setRelationshipProperty(long relationship,
String propertyName,
Object propertyValue)
Sets the property with name of relationship with id to the value . |
void |
shutdown()
Shuts down this batch inserter syncing all changes that are still only in memory to disk. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BatchInserterImpl(String storeDir)
public BatchInserterImpl(String storeDir,
Map<String,String> stringParams)
| Method Detail |
|---|
public boolean nodeHasProperty(long node,
String propertyName)
BatchInserter
nodeHasProperty in interface BatchInserternode - The node id of the node to check.propertyName - The property name to check for
public boolean relationshipHasProperty(long relationship,
String propertyName)
BatchInserter
relationshipHasProperty in interface BatchInserterrelationship - The relationship id of the relationship to check.propertyName - The property name to check for
public void setNodeProperty(long node,
String propertyName,
Object propertyValue)
BatchInserter
setNodeProperty in interface BatchInserternode - The node id of the node whose property is to be setpropertyName - The name of the property to setpropertyValue - The value of the property to set
public void setRelationshipProperty(long relationship,
String propertyName,
Object propertyValue)
BatchInserter
setRelationshipProperty in interface BatchInserterrelationship - The node id of the relationship whose property is to
be setpropertyName - The name of the property to setpropertyValue - The value of the property to set
public void removeNodeProperty(long node,
String propertyName)
BatchInserter
removeNodeProperty in interface BatchInserternode - The id of the node from which to remove the propertypropertyName - The name of the property
public void removeRelationshipProperty(long relationship,
String propertyName)
BatchInserter
removeRelationshipProperty in interface BatchInserterrelationship - The id of the relationship from which to remove the
propertypropertyName - The name of the propertypublic long createNode(Map<String,Object> properties)
BatchInserter
createNode in interface BatchInserterproperties - a map containing properties or null if no
properties should be added.
public void createNode(long id,
Map<String,Object> properties)
BatchInserter
createNode in interface BatchInserterid - the id of the node to create.properties - map containing properties or null if no
properties should be added.
public long createRelationship(long node1,
long node2,
RelationshipType type,
Map<String,Object> properties)
BatchInserter
createRelationship in interface BatchInserternode1 - the start node.node2 - the end node.type - relationship type.properties - map containing properties or null if no
properties should be added.
public void setNodeProperties(long node,
Map<String,Object> properties)
BatchInserter
For best performance try supply all the nodes properties upon creation
of the node. This method will delete any existing properties so using it
together with BatchInserter.getNodeProperties(long) will have bad performance.
setNodeProperties in interface BatchInserternode - the id of the node.properties - map containing the properties or null to
clear all properties.
public void setRelationshipProperties(long rel,
Map<String,Object> properties)
BatchInserter
For best performance try supply all the relationship properties upon
creation of the relationship. This method will delete any existing
properties so using it together with
BatchInserter.getRelationshipProperties(long) will have bad performance.
setRelationshipProperties in interface BatchInserterrel - the id of the relationship.properties - map containing the properties or null to
clear all properties.public boolean nodeExists(long nodeId)
BatchInserter
nodeExists in interface BatchInserternodeId - the id of the node.
true if the node exists.public Map<String,Object> getNodeProperties(long nodeId)
BatchInserter
getNodeProperties in interface BatchInserternodeId - the id of the node.
public Iterable<Long> getRelationshipIds(long nodeId)
BatchInserter
getRelationshipIds in interface BatchInserternodeId - the id of the node.
public Iterable<SimpleRelationship> getRelationships(long nodeId)
BatchInserterrelationships connected
to the node with supplied id.
getRelationships in interface BatchInserternodeId - the id of the node.
public SimpleRelationship getRelationshipById(long relId)
BatchInserter
getRelationshipById in interface BatchInserterrelId - the relationship id.
public Map<String,Object> getRelationshipProperties(long relId)
BatchInserter
getRelationshipProperties in interface BatchInserterrelId - the id of the relationship.
public void shutdown()
BatchInserterAfter this method has been invoked any other method call to this batch inserter is illegal.
shutdown in interface BatchInserterpublic String toString()
toString in class Objectpublic String getStore()
BatchInserter
getStore in interface BatchInserterpublic static Map<String,String> loadProperties(String file)
public long getReferenceNode()
BatchInserter-1 if it doesn't exist.
getReferenceNode in interface BatchInserterpublic GraphDatabaseService getGraphDbService()
getGraphDbService in interface BatchInserterpublic IndexStore getIndexStore()
public IdGeneratorFactory getIdGeneratorFactory()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||