//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void forward(org.neo4j.kernel.impl.index.IndexDefineCommand definitions, java.util.Map<String,TransactionApplier> appliers) throws java.io.IOException private void Forward(IndexDefineCommand definitions, IDictionary <string, TransactionApplier> appliers) { foreach (CommandVisitor applier in appliers.Values) { applier.VisitIndexDefineCommand(definitions); } }
// Methods for adding commands private IndexDefineCommand Definitions() { if (_defineCommand == null) { _defineCommand = new IndexDefineCommand(); } return(_defineCommand); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public boolean visitIndexDefineCommand(org.neo4j.kernel.impl.index.IndexDefineCommand command) throws java.io.IOException public override bool VisitIndexDefineCommand(IndexDefineCommand command) { this._defineCommand = command; Forward(command, _applierByNodeIndex); Forward(command, _applierByRelationshipIndex); Forward(command, ApplierByProvider); return(false); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private Command visitIndexDefineCommand(org.neo4j.storageengine.api.ReadableChannel channel) throws java.io.IOException private Command VisitIndexDefineCommand(ReadableChannel channel) { ReadIndexCommandHeader(channel); MutableObjectIntMap <string> indexNames = ReadMap(channel); MutableObjectIntMap <string> keys = ReadMap(channel); IndexDefineCommand command = new IndexDefineCommand(); command.Init(indexNames, keys); return(command); }
private void InitializeInstanceFields() { _writer = new LogEntryWriter(_inMemoryChannel); NeoStoreRecord after = new NeoStoreRecord(); after.NextProp = 42; _permutations[typeof(Command.NeoStoreCommand)] = new Command[] { new Command.NeoStoreCommand(new NeoStoreRecord(), after) }; _permutations[typeof(Command.NodeCommand)] = new Command[] { new Command.NodeCommand(new NodeRecord(12L, false, 13L, 13L), new NodeRecord(0, false, 0, 0)) }; _permutations[typeof(Command.RelationshipCommand)] = new Command[] { new Command.RelationshipCommand(new RelationshipRecord(1L), new RelationshipRecord(1L, 2L, 3L, 4)) }; _permutations[typeof(Command.PropertyCommand)] = new Command[] { new Command.PropertyCommand(new PropertyRecord(1, new NodeRecord(12L, false, 13L, 13)), new PropertyRecord(1, new NodeRecord(12L, false, 13L, 13))) }; _permutations[typeof(Command.RelationshipGroupCommand)] = new Command[] { new Command.LabelTokenCommand(new LabelTokenRecord(1), CreateLabelTokenRecord(1)) }; _permutations[typeof(Command.SchemaRuleCommand)] = new Command[] { new Command.SchemaRuleCommand(singletonList(dynamicRecord(1L, false, true, -1L, 1, "hello".GetBytes())), singletonList(dynamicRecord(1L, true, true, -1L, 1, "hello".GetBytes())), TestIndexDescriptorFactory.forLabel(3, 4).withId(1)) }; _permutations[typeof(Command.RelationshipTypeTokenCommand)] = new Command[] { new Command.RelationshipTypeTokenCommand(new RelationshipTypeTokenRecord(1), CreateRelationshipTypeTokenRecord(1)) }; _permutations[typeof(Command.PropertyKeyTokenCommand)] = new Command[] { new Command.PropertyKeyTokenCommand(new PropertyKeyTokenRecord(1), CreatePropertyKeyTokenRecord(1)) }; _permutations[typeof(Command.LabelTokenCommand)] = new Command[] { new Command.LabelTokenCommand(new LabelTokenRecord(1), CreateLabelTokenRecord(1)) }; // Index commands IndexCommand.AddRelationshipCommand addRelationshipCommand = new IndexCommand.AddRelationshipCommand(); addRelationshipCommand.Init(1, 1L, 12345, "some value", 1, 1); _permutations[typeof(IndexCommand.AddRelationshipCommand)] = new Command[] { addRelationshipCommand }; IndexCommand.CreateCommand createCommand = new IndexCommand.CreateCommand(); createCommand.Init(1, IndexEntityType.Relationship.id(), MapUtil.stringMap("string1", "string 2")); _permutations[typeof(IndexCommand.CreateCommand)] = new Command[] { createCommand }; IndexCommand.AddNodeCommand addCommand = new IndexCommand.AddNodeCommand(); addCommand.Init(1234, 122L, 2, "value"); _permutations[typeof(IndexCommand.AddNodeCommand)] = new Command[] { addCommand }; IndexCommand.DeleteCommand deleteCommand = new IndexCommand.DeleteCommand(); deleteCommand.Init(1, IndexEntityType.Relationship.id()); _permutations[typeof(IndexCommand.DeleteCommand)] = new Command[] { deleteCommand }; IndexCommand.RemoveCommand removeCommand = new IndexCommand.RemoveCommand(); removeCommand.Init(1, IndexEntityType.Node.id(), 126, (sbyte)3, "the value"); _permutations[typeof(IndexCommand.RemoveCommand)] = new Command[] { removeCommand }; IndexDefineCommand indexDefineCommand = new IndexDefineCommand(); indexDefineCommand.Init(ObjectIntHashMap.newWithKeysValues("string1", 45, "key1", 2), ObjectIntHashMap.newWithKeysValues("string", 2)); _permutations[typeof(IndexDefineCommand)] = new Command[] { indexDefineCommand }; // Counts commands _permutations[typeof(Command.NodeCountsCommand)] = new Command[] { new Command.NodeCountsCommand(42, 11) }; _permutations[typeof(Command.RelationshipCountsCommand)] = new Command[] { new Command.RelationshipCountsCommand(17, 2, 13, -2) }; }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void removalOfRelationshipIndexDoesNotClearNodeCommandsForNodeIndexWithSameName() public virtual void RemovalOfRelationshipIndexDoesNotClearNodeCommandsForNodeIndexWithSameName() { ExplicitIndexTransactionStateImpl state = NewExplicitIndexTxState(); state.AddNode("index", 1, "key", "value"); state.AddRelationship("index", 1, "key", "value", 11, 11); state.DeleteIndex(IndexEntityType.Relationship, "index"); IndexDefineCommand indexDefinedCommand = new IndexDefineCommand(); indexDefinedCommand.GetOrAssignIndexNameId("index"); indexDefinedCommand.GetOrAssignKeyId("key"); IndexCommand.DeleteCommand delete = new IndexCommand.DeleteCommand(); delete.Init(1, IndexEntityType.Relationship.id()); ISet <Command> expectedCommands = new HashSet <Command>(Arrays.asList(indexDefinedCommand, delete, AddNode(1, 1, 1, "value"))); assertEquals(expectedCommands, ExtractCommands(state)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void tracksRelationshipCommands() public virtual void TracksRelationshipCommands() { ExplicitIndexTransactionStateImpl state = NewExplicitIndexTxState(); state.RemoveRelationship("index1", 1, "key1", "value1"); state.AddRelationship("index1", 1, "key2", "value2", 11, 11); state.RemoveRelationship("index1", 2, "key1", "value3"); state.AddRelationship("index1", 3, "key2", "value4", 22, 22); state.AddRelationship("index2", 4, "key1", "value5", 33, 33); IndexDefineCommand indexDefinedCommand = new IndexDefineCommand(); indexDefinedCommand.GetOrAssignIndexNameId("index1"); indexDefinedCommand.GetOrAssignIndexNameId("index2"); indexDefinedCommand.GetOrAssignKeyId("key1"); indexDefinedCommand.GetOrAssignKeyId("key2"); ISet <Command> expectedCommands = new HashSet <Command>(Arrays.asList(indexDefinedCommand, RemoveRelationship(1, 1, 1, "value1"), AddRelationship(1, 1, 2, "value2", 11, 11), RemoveRelationship(1, 2, 1, "value3"), AddRelationship(1, 3, 2, "value4", 22, 22), AddRelationship(2, 4, 1, "value5", 33, 33))); assertEquals(expectedCommands, ExtractCommands(state)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void relationshipIndexDeletionRemovesCommands() public virtual void RelationshipIndexDeletionRemovesCommands() { ExplicitIndexTransactionStateImpl state = NewExplicitIndexTxState(); state.RemoveRelationship("index", 1, "key", "value1"); state.AddRelationship("index", 2, "key", "value2", 11, 11); state.AddRelationship("index", 3, "key", "value3", 22, 22); state.DeleteIndex(IndexEntityType.Relationship, "index"); IndexDefineCommand indexDefinedCommand = new IndexDefineCommand(); indexDefinedCommand.GetOrAssignIndexNameId("index"); indexDefinedCommand.GetOrAssignKeyId("key"); IndexCommand.DeleteCommand delete = new IndexCommand.DeleteCommand(); delete.Init(1, IndexEntityType.Relationship.id()); ISet <Command> expectedCommands = new HashSet <Command>(Arrays.asList(indexDefinedCommand, delete)); assertEquals(expectedCommands, ExtractCommands(state)); }
public override bool VisitIndexDefineCommand(IndexDefineCommand indexDefineCommand) { _definitions = indexDefineCommand; return(false); }