Search in sources :

Example 56 with PropertyBlock

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

the class PropertyRecordCheckTest method shouldReportArrayRecordNotInUse.

@Test
public void shouldReportArrayRecordNotInUse() throws Exception {
    // given
    PropertyRecord property = inUse(new PropertyRecord(42));
    PropertyKeyTokenRecord key = add(inUse(new PropertyKeyTokenRecord(6)));
    DynamicRecord value = add(notInUse(array(new DynamicRecord(1001))));
    PropertyBlock block = propertyBlock(key, value);
    property.addPropertyBlock(block);
    // when
    ConsistencyReport.PropertyConsistencyReport report = check(property);
    // then
    verify(report).arrayNotInUse(block, value);
    verifyNoMoreInteractions(report);
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) PropertyBlock(org.neo4j.kernel.impl.store.record.PropertyBlock) PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Example 57 with PropertyBlock

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

the class PropertyRecordCheckTest method shouldReportEmptyArrayRecord.

@Test
public void shouldReportEmptyArrayRecord() throws Exception {
    // given
    PropertyRecord property = inUse(new PropertyRecord(42));
    PropertyKeyTokenRecord key = add(inUse(new PropertyKeyTokenRecord(6)));
    DynamicRecord value = add(inUse(array(new DynamicRecord(1001))));
    PropertyBlock block = propertyBlock(key, value);
    property.addPropertyBlock(block);
    // when
    ConsistencyReport.PropertyConsistencyReport report = check(property);
    // then
    verify(report).arrayEmpty(block, value);
    verifyNoMoreInteractions(report);
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) PropertyBlock(org.neo4j.kernel.impl.store.record.PropertyBlock) PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Example 58 with PropertyBlock

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

the class PropertyRecordCheckTest method shouldReportEmptyStringRecord.

@Test
public void shouldReportEmptyStringRecord() throws Exception {
    // given
    PropertyRecord property = inUse(new PropertyRecord(42));
    PropertyKeyTokenRecord key = add(inUse(new PropertyKeyTokenRecord(6)));
    DynamicRecord value = add(inUse(string(new DynamicRecord(1001))));
    PropertyBlock block = propertyBlock(key, value);
    property.addPropertyBlock(block);
    // when
    ConsistencyReport.PropertyConsistencyReport report = check(property);
    // then
    verify(report).stringEmpty(block, value);
    verifyNoMoreInteractions(report);
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) PropertyBlock(org.neo4j.kernel.impl.store.record.PropertyBlock) PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Example 59 with PropertyBlock

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

the class PropertyRecordCheckTest method shouldReportStringRecordNotInUse.

@Test
public void shouldReportStringRecordNotInUse() throws Exception {
    // given
    PropertyRecord property = inUse(new PropertyRecord(42));
    PropertyKeyTokenRecord key = add(inUse(new PropertyKeyTokenRecord(6)));
    DynamicRecord value = add(notInUse(string(new DynamicRecord(1001))));
    PropertyBlock block = propertyBlock(key, value);
    property.addPropertyBlock(block);
    // when
    ConsistencyReport.PropertyConsistencyReport report = check(property);
    // then
    verify(report).stringNotInUse(block, value);
    verifyNoMoreInteractions(report);
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) PropertyBlock(org.neo4j.kernel.impl.store.record.PropertyBlock) PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Example 60 with PropertyBlock

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

the class RecordCheckTestBase method propertyBlock.

public static PropertyBlock propertyBlock(PropertyKeyTokenRecord key, PropertyType type, long value) {
    PropertyBlock block = new PropertyBlock();
    block.setSingleBlock(key.getId() | (((long) type.intValue()) << 24) | (value << 28));
    return block;
}
Also used : PropertyBlock(org.neo4j.kernel.impl.store.record.PropertyBlock)

Aggregations

PropertyBlock (org.neo4j.kernel.impl.store.record.PropertyBlock)90 PropertyRecord (org.neo4j.kernel.impl.store.record.PropertyRecord)57 Test (org.junit.Test)21 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)16 ConsistencyReport (org.neo4j.consistency.report.ConsistencyReport)9 IOException (java.io.IOException)8 InterruptedIOException (java.io.InterruptedIOException)8 Pair (org.neo4j.helpers.collection.Pair)8 DefinedProperty (org.neo4j.kernel.api.properties.DefinedProperty)8 ArrayMap (org.neo4j.kernel.impl.util.ArrayMap)8 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)6 PropertyKeyTokenRecord (org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord)6 GraphStoreFixture (org.neo4j.consistency.checking.GraphStoreFixture)5 IdGenerator (org.neo4j.consistency.checking.GraphStoreFixture.IdGenerator)5 TransactionDataBuilder (org.neo4j.consistency.checking.GraphStoreFixture.TransactionDataBuilder)5 ConsistencySummaryStatistics (org.neo4j.consistency.report.ConsistencySummaryStatistics)5 PrimitiveRecord (org.neo4j.kernel.impl.store.record.PrimitiveRecord)4 ChainCheck (org.neo4j.consistency.checking.ChainCheck)3 RecordAccessStub (org.neo4j.consistency.store.RecordAccessStub)3 DynamicRecordAllocator (org.neo4j.kernel.impl.store.DynamicRecordAllocator)3