org.neo4j.kernel.impl.index
Class IndexCommand.AddRelationshipCommand

java.lang.Object
  extended by org.neo4j.kernel.impl.transaction.xaframework.XaCommand
      extended by org.neo4j.kernel.impl.index.IndexCommand
          extended by org.neo4j.kernel.impl.index.IndexCommand.AddRelationshipCommand
Enclosing class:
IndexCommand

public static class IndexCommand.AddRelationshipCommand
extends IndexCommand


Nested Class Summary
 
Nested classes/interfaces inherited from class org.neo4j.kernel.impl.index.IndexCommand
IndexCommand.AddCommand, IndexCommand.AddRelationshipCommand, IndexCommand.CreateCommand, IndexCommand.DeleteCommand, IndexCommand.RemoveCommand
 
Field Summary
 
Fields inherited from class org.neo4j.kernel.impl.index.IndexCommand
NODE, RELATIONSHIP
 
Method Summary
protected  byte endNodeNeedsLong()
           
 boolean equals(Object obj)
           
 long getEndNode()
           
 long getStartNode()
           
protected  byte startNodeNeedsLong()
           
 void writeToFile(LogBuffer buffer)
          When a command is added to a transaction (usually when it is created) it must be written to the XaLogicalLog.
 
Methods inherited from class org.neo4j.kernel.impl.index.IndexCommand
execute, getEntityId, getEntityType, getIndexNameId, getKeyId, getValue, isConsideredNormalWriteCommand, needsLong, putIntOrLong, readCommand, writeHeader
 
Methods inherited from class org.neo4j.kernel.impl.transaction.xaframework.XaCommand
isRecovered, rollback, setRecovered
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getStartNode

public long getStartNode()

getEndNode

public long getEndNode()

startNodeNeedsLong

protected byte startNodeNeedsLong()
Overrides:
startNodeNeedsLong in class IndexCommand

endNodeNeedsLong

protected byte endNodeNeedsLong()
Overrides:
endNodeNeedsLong in class IndexCommand

writeToFile

public void writeToFile(LogBuffer buffer)
                 throws IOException
Description copied from class: XaCommand
When a command is added to a transaction (usually when it is created) it must be written to the XaLogicalLog. This method should write all the data that is needed to re-create the command (see XaCommandFactory).

Write the data to the fileChannel, you can use the buffer supplied or create your own buffer since its capacity is very small (137 bytes or something). Acccess to writing commands is synchronized, only one command will be written at a time so if you need to write larger data sets the commands can share the same buffer.

Don't throw an IOException to imply something is wrong with the command. An exception should only be thrown here if there is a real IO failure. If something is wrong with this command it should have been detected when it was created.

Don't force, position or anything except normal forward write with the file channel.

Overrides:
writeToFile in class IndexCommand
Parameters:
buffer - A small byte buffer that can be used to write command data
Throws:
IOException - In case of *real* IO failure

equals

public boolean equals(Object obj)
Overrides:
equals in class IndexCommand


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.