|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.neo4j.kernel.impl.transaction.xaframework.XaCommand
org.neo4j.kernel.impl.index.IndexDefineCommand
public class IndexDefineCommand
A command which have to be first in the transaction. It will map index names and keys to ids so that all other commands in that transaction only refer to ids instead of names. This reduced the number of bytes needed for commands roughly 50% for transaction with more than a couple of commands in it, depending on the size of the value. After this command has been created it will act as a factory for other commands so that it can spit out correct index name and key ids.
| Constructor Summary | |
|---|---|
IndexDefineCommand()
|
|
IndexDefineCommand(Map<String,Byte> indexNames,
Map<String,Byte> keys)
|
|
| Method Summary | |
|---|---|
IndexCommand |
add(String indexName,
Class<?> entityType,
long entityId,
String key,
Object value)
|
IndexCommand |
addRelationship(String indexName,
Class<?> entityType,
long entityId,
String key,
Object value,
long startNode,
long endNode)
|
IndexCommand |
create(String indexName,
Class<?> entityType,
Map<String,String> config)
|
IndexCommand |
delete(String indexName,
Class<?> entityType)
|
static Class<? extends PropertyContainer> |
entityType(byte id)
|
static byte |
entityTypeId(Class<?> entityType)
|
boolean |
equals(Object obj)
|
void |
execute()
Executes the command and makes it persistent. |
String |
getIndexName(byte id)
|
String |
getKey(byte id)
|
IndexCommand |
remove(String indexName,
Class<?> entityType,
long entityId,
String key,
Object value)
|
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.transaction.xaframework.XaCommand |
|---|
isRecovered, rollback, setRecovered |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IndexDefineCommand()
public IndexDefineCommand(Map<String,Byte> indexNames,
Map<String,Byte> keys)
| Method Detail |
|---|
public IndexCommand create(String indexName,
Class<?> entityType,
Map<String,String> config)
public IndexCommand add(String indexName,
Class<?> entityType,
long entityId,
String key,
Object value)
public IndexCommand addRelationship(String indexName,
Class<?> entityType,
long entityId,
String key,
Object value,
long startNode,
long endNode)
public IndexCommand remove(String indexName,
Class<?> entityType,
long entityId,
String key,
Object value)
public IndexCommand delete(String indexName,
Class<?> entityType)
public String getIndexName(byte id)
public String getKey(byte id)
public static byte entityTypeId(Class<?> entityType)
public static Class<? extends PropertyContainer> entityType(byte id)
public void execute()
XaCommand
execute in class XaCommand
public void writeToFile(LogBuffer buffer)
throws IOException
XaCommandXaLogicalLog. 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.
writeToFile in class XaCommandbuffer - A small byte buffer that can be used to write command data
IOException - In case of *real* IO failurepublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||