|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.neo4j.kernel.impl.transaction.xaframework.XaTransaction
org.neo4j.kernel.impl.nioneo.xa.WriteTransaction
public class WriteTransaction
Transaction containing commands reflecting the operations
performed in the transaction.
| Method Summary | |
|---|---|
void |
createPropertyIndex(String key,
int id)
Creates a property index entry out of the given id and string. |
void |
createRelationshipType(int id,
String name)
Creates a new RelationshipType record with the given id that has the given name. |
void |
destroy()
Destroy this transaction. |
void |
doAddCommand(XaCommand command)
When a command is added to transaction it will be passed via this method. |
void |
doCommit()
Commits the transaction, loop through all commands and invoke execute(). |
protected void |
doPrepare()
Called when transaction is beeing prepared. |
void |
doRollback()
Rollbacks the transaction, loop through all commands and invoke rollback(). |
RelIdArray |
getCreatedNodes()
Returns an array view of the ids of the nodes that have been created in this transaction. |
int |
getKeyIdForProperty(PropertyData property)
Returns the index key ids that are contained within the property record with the specified id. |
Pair<Map<RelIdArray.DirectionWrapper,Iterable<RelationshipRecord>>,Long> |
getMoreRelationships(long nodeId,
long position)
|
long |
getRelationshipChainPosition(long nodeId)
|
XAResource |
getXAResource()
Returns the XAResource that represents this
connection. |
protected void |
injectCommand(XaCommand xaCommand)
Used during recovery, calls XaTransaction.doAddCommand(org.neo4j.kernel.impl.transaction.xaframework.XaCommand). |
protected void |
intercept(List<Command> commands)
|
boolean |
isNodeCreated(long nodeId)
Check if the node with the given id was created in this transaction. |
boolean |
isReadOnly()
Returns true if read only transaction, that is no
modifications will be made once the transaction commits. |
boolean |
isRelationshipCreated(long relId)
Check if the node with the given id was created in this transaction. |
String |
loadIndex(int id)
Loads the value object for the given property index record id if the record is light. |
PropertyIndexData[] |
loadPropertyIndexes(int count)
Tries to load as heavy records as many property index records as specified in the argument. |
Object |
loadPropertyValue(PropertyData propertyData)
Attempts to load the value off the store forthe given PropertyData object. |
RelationshipTypeData[] |
loadRelationshipTypes()
Loads and returns all the available RelationshipTypes that are stored. |
PropertyData |
nodeAddProperty(long nodeId,
PropertyIndex index,
Object value)
Adds a property to the given node, with the given index and value. |
PropertyData |
nodeChangeProperty(long nodeId,
PropertyData propertyData,
Object value)
Changes an existing property of the given node, with the given index to the passed value |
void |
nodeCreate(long nodeId)
Creates a node for the given id |
ArrayMap<Integer,PropertyData> |
nodeDelete(long nodeId)
Deletes a node by its id, returning its properties which are now removed. |
boolean |
nodeLoadLight(long nodeId)
Tries to load the light node with the given id, returns true on success. |
ArrayMap<Integer,PropertyData> |
nodeLoadProperties(long nodeId,
boolean light)
Loads the complete property chain for the given node and returns it as a map from property index id to property data. |
void |
nodeRemoveProperty(long nodeId,
PropertyData propertyData)
Removes the given property identified by indexKeyId of the node with the given id. |
Object |
propertyGetValueOrNull(PropertyBlock block)
|
PropertyData |
relAddProperty(long relId,
PropertyIndex index,
Object value)
Adds a property to the given relationship, with the given index and value. |
void |
relationshipCreate(long id,
int type,
long firstNodeId,
long secondNodeId)
Creates a relationship with the given id, from the nodes identified by id and of type typeId |
PropertyData |
relChangeProperty(long relId,
PropertyData propertyData,
Object value)
Changes an existing property's value of the given relationship, with the given index to the passed value |
ArrayMap<Integer,PropertyData> |
relDelete(long id)
Deletes a relationship by its id, returning its properties which are now removed. |
RelationshipRecord |
relLoadLight(long id)
Tries to load the light relationship with the given id, returns the record on success. |
ArrayMap<Integer,PropertyData> |
relLoadProperties(long relId,
boolean light)
Loads the complete property chain for the given relationship and returns it as a map from property index id to property data. |
void |
relRemoveProperty(long relId,
PropertyData propertyData)
Removes the given property identified by its index from the relationship with the given id. |
void |
setXaConnection(XaConnection connection)
|
| Methods inherited from class org.neo4j.kernel.impl.transaction.xaframework.XaTransaction |
|---|
addCommand, commit, getCommitTxId, getIdentifier, isRecovered, prepare, rollback, setCommitTxId, setRecovered |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public boolean isReadOnly()
XaTransactiontrue if read only transaction, that is no
modifications will be made once the transaction commits.
isReadOnly in class XaTransactionpublic void doAddCommand(XaCommand command)
XaTransactionXaTransaction needs to hold all the commands in memory
until it receives the doCommit or doRollback
call.
doAddCommand in class XaTransactioncommand - The command to be added to transaction
protected void doPrepare()
throws XAException
XaTransaction
doPrepare in class XaTransactionXAException - If unable to prepareprotected void intercept(List<Command> commands)
protected void injectCommand(XaCommand xaCommand)
XaTransactionXaTransaction.doAddCommand(org.neo4j.kernel.impl.transaction.xaframework.XaCommand). Injects the command
into the transaction without writing to the logical log.
injectCommand in class XaTransactionxaCommand - The command that will be injected
public void doRollback()
throws XAException
XaTransactionrollback().
doRollback in class XaTransactionXAException - If unable to rollback
public void doCommit()
throws XAException
XaTransactionexecute().
doCommit in class XaTransactionXAExceptionpublic boolean nodeLoadLight(long nodeId)
NeoStoreTransaction
nodeLoadLight in interface NeoStoreTransactionnodeId - The id of the node to load.
public RelationshipRecord relLoadLight(long id)
NeoStoreTransaction
relLoadLight in interface NeoStoreTransactionid - The id of the relationship to load.
public ArrayMap<Integer,PropertyData> nodeDelete(long nodeId)
NeoStoreTransaction
nodeDelete in interface NeoStoreTransactionnodeId - The id of the node to delete.
public ArrayMap<Integer,PropertyData> relDelete(long id)
NeoStoreTransaction
relDelete in interface NeoStoreTransactionid - The id of the relationship to delete.
public long getRelationshipChainPosition(long nodeId)
getRelationshipChainPosition in interface NeoStoreTransaction
public Pair<Map<RelIdArray.DirectionWrapper,Iterable<RelationshipRecord>>,Long> getMoreRelationships(long nodeId,
long position)
getMoreRelationships in interface NeoStoreTransaction
public void relRemoveProperty(long relId,
PropertyData propertyData)
NeoStoreTransaction
relRemoveProperty in interface NeoStoreTransactionrelId - The id of the relationship that is to have the property
removed.propertyData - The index key of the property.
public ArrayMap<Integer,PropertyData> relLoadProperties(long relId,
boolean light)
NeoStoreTransaction
relLoadProperties in interface NeoStoreTransactionrelId - The id of the relationship whose properties to load.light - If the properties should be loaded light or not.
public ArrayMap<Integer,PropertyData> nodeLoadProperties(long nodeId,
boolean light)
NeoStoreTransaction
nodeLoadProperties in interface NeoStoreTransactionnodeId - The id of the node whose properties to load.light - If the properties should be loaded light or not.
public Object propertyGetValueOrNull(PropertyBlock block)
public Object loadPropertyValue(PropertyData propertyData)
NeoStoreTransaction
loadPropertyValue in interface NeoStoreTransactionpropertyData - The property to make heavy
public void nodeRemoveProperty(long nodeId,
PropertyData propertyData)
NeoStoreTransaction
nodeRemoveProperty in interface NeoStoreTransactionnodeId - The id of the node that is to have the property removed.propertyData - The index key of the property.
public PropertyData relChangeProperty(long relId,
PropertyData propertyData,
Object value)
NeoStoreTransaction
relChangeProperty in interface NeoStoreTransactionrelId - The id of the relationship which holds the property to
change.propertyData - The index of the key of the property to change.value - The new value of the property.
public PropertyData nodeChangeProperty(long nodeId,
PropertyData propertyData,
Object value)
NeoStoreTransaction
nodeChangeProperty in interface NeoStoreTransactionnodeId - The id of the node which holds the property to change.propertyData - The index of the key of the property to change.value - The new value of the property.
public PropertyData relAddProperty(long relId,
PropertyIndex index,
Object value)
NeoStoreTransaction
relAddProperty in interface NeoStoreTransactionrelId - The id of the relationship to which to add the property.index - The index of the key of the property to add.value - The value of the property.
public PropertyData nodeAddProperty(long nodeId,
PropertyIndex index,
Object value)
NeoStoreTransaction
nodeAddProperty in interface NeoStoreTransactionnodeId - The id of the node to which to add the property.index - The index of the key of the property to add.value - The value of the property.
public void relationshipCreate(long id,
int type,
long firstNodeId,
long secondNodeId)
NeoStoreTransaction
relationshipCreate in interface NeoStoreTransactionid - The id of the relationship to create.type - The id of the relationship type this relationship will
have.firstNodeId - The id of the start node.secondNodeId - The id of the end node.public void nodeCreate(long nodeId)
NeoStoreTransaction
nodeCreate in interface NeoStoreTransactionnodeId - The id of the node to create.public String loadIndex(int id)
NeoStoreTransaction
loadIndex in interface NeoStoreTransactionid - The id of the property index record to make heavy
public PropertyIndexData[] loadPropertyIndexes(int count)
NeoStoreTransaction
loadPropertyIndexes in interface NeoStoreTransactioncount - The maximum number of property index records to load.
public void createPropertyIndex(String key,
int id)
NeoStoreTransaction
createPropertyIndex in interface NeoStoreTransactionkey - The key of the property index, as a string.id - The property index record id.
public void createRelationshipType(int id,
String name)
NeoStoreTransaction
createRelationshipType in interface NeoStoreTransactionid - The id of the new relationship type record.name - The name of the relationship type.public RelIdArray getCreatedNodes()
NeoStoreTransaction
getCreatedNodes in interface NeoStoreTransactionpublic boolean isNodeCreated(long nodeId)
NeoStoreTransaction
isNodeCreated in interface NeoStoreTransactionnodeId - The node id to check.
public boolean isRelationshipCreated(long relId)
NeoStoreTransaction
isRelationshipCreated in interface NeoStoreTransactionpublic int getKeyIdForProperty(PropertyData property)
NeoStoreTransaction
getKeyIdForProperty in interface NeoStoreTransactionproperty - The PropertyData of the property record.
public XAResource getXAResource()
NeoStoreTransactionXAResource that represents this
connection.
getXAResource in interface NeoStoreTransactionXAResource for this connectionpublic void destroy()
NeoStoreTransaction
destroy in interface NeoStoreTransactionpublic void setXaConnection(XaConnection connection)
setXaConnection in interface NeoStoreTransactionpublic RelationshipTypeData[] loadRelationshipTypes()
NeoStoreTransaction
loadRelationshipTypes in interface NeoStoreTransaction
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||