Search in sources :

Example 41 with LabelTokenRecord

use of org.neo4j.kernel.impl.store.record.LabelTokenRecord in project neo4j by neo4j.

the class NeoStoreTransactionApplierTest method shouldApplyLabelTokenCommandToTheStore.

// LABEL TOKEN COMMAND
@Test
public void shouldApplyLabelTokenCommandToTheStore() throws Exception {
    // given
    final BatchTransactionApplier applier = newApplier(false);
    final LabelTokenRecord before = new LabelTokenRecord(42);
    final LabelTokenRecord after = new LabelTokenRecord(42);
    after.setInUse(true);
    after.setNameId(323);
    final Command command = new LabelTokenCommand(before, after);
    // when
    boolean result = apply(applier, command::handle, transactionToApply);
    // then
    assertFalse(result);
    verify(labelTokenStore, times(1)).updateRecord(after);
}
Also used : RelationshipTypeTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.RelationshipTypeTokenCommand) LabelTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.LabelTokenCommand) PropertyKeyTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.PropertyKeyTokenCommand) LabelTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.LabelTokenCommand) BatchTransactionApplier(org.neo4j.kernel.impl.api.BatchTransactionApplier) LabelTokenRecord(org.neo4j.kernel.impl.store.record.LabelTokenRecord) Test(org.junit.Test)

Example 42 with LabelTokenRecord

use of org.neo4j.kernel.impl.store.record.LabelTokenRecord in project neo4j by neo4j.

the class Commands method createLabelToken.

public static LabelTokenCommand createLabelToken(int id, int nameId) {
    LabelTokenRecord before = new LabelTokenRecord(id);
    LabelTokenRecord after = new LabelTokenRecord(id);
    populateTokenRecord(after, nameId);
    return new LabelTokenCommand(before, after);
}
Also used : LabelTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.LabelTokenCommand) LabelTokenRecord(org.neo4j.kernel.impl.store.record.LabelTokenRecord)

Example 43 with LabelTokenRecord

use of org.neo4j.kernel.impl.store.record.LabelTokenRecord in project neo4j by neo4j.

the class LogTruncationTest method createLabelTokenRecord.

private LabelTokenRecord createLabelTokenRecord(int id) {
    LabelTokenRecord labelTokenRecord = new LabelTokenRecord(id);
    labelTokenRecord.setInUse(true);
    labelTokenRecord.setNameId(333);
    labelTokenRecord.addNameRecord(new DynamicRecord(43));
    return labelTokenRecord;
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) LabelTokenRecord(org.neo4j.kernel.impl.store.record.LabelTokenRecord)

Aggregations

LabelTokenRecord (org.neo4j.kernel.impl.store.record.LabelTokenRecord)43 Test (org.junit.Test)26 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)23 ConsistencyReport (org.neo4j.consistency.report.ConsistencyReport)20 PropertyKeyTokenRecord (org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord)14 SchemaRuleUtil.constraintIndexRule (org.neo4j.consistency.checking.SchemaRuleUtil.constraintIndexRule)8 SchemaIndexProvider (org.neo4j.kernel.api.index.SchemaIndexProvider)8 NodePropertyDescriptor (org.neo4j.kernel.api.schema.NodePropertyDescriptor)8 IndexRule (org.neo4j.kernel.impl.store.record.IndexRule)8 IOException (java.io.IOException)7 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)7 SchemaRuleUtil.uniquenessConstraintRule (org.neo4j.consistency.checking.SchemaRuleUtil.uniquenessConstraintRule)5 ConstraintRule (org.neo4j.kernel.impl.store.record.ConstraintRule)5 InlineNodeLabels (org.neo4j.kernel.impl.store.InlineNodeLabels)4 StorageCommand (org.neo4j.storageengine.api.StorageCommand)4 NodeStore (org.neo4j.kernel.impl.store.NodeStore)3 RelationshipTypeTokenRecord (org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord)3 Command (org.neo4j.kernel.impl.transaction.command.Command)3 LabelTokenCommand (org.neo4j.kernel.impl.transaction.command.Command.LabelTokenCommand)3 Collection (java.util.Collection)2