Search in sources :

Example 1 with ForcedSecondaryUnitRecordFormats

use of org.neo4j.kernel.impl.store.format.ForcedSecondaryUnitRecordFormats in project neo4j by neo4j.

the class BatchingNeoStoresTest method shouldDecideToAllocateDoubleRelationshipRecordUnitsOnLargeAmountOfRelationshipsOnSupportedFormat.

@Test
void shouldDecideToAllocateDoubleRelationshipRecordUnitsOnLargeAmountOfRelationshipsOnSupportedFormat() throws Exception {
    // given
    RecordFormats formats = new ForcedSecondaryUnitRecordFormats(LATEST_RECORD_FORMATS);
    try (BatchingNeoStores stores = BatchingNeoStores.batchingNeoStoresWithExternalPageCache(fileSystem, pageCache, PageCacheTracer.NULL, databaseLayout, formats, Configuration.DEFAULT, NullLogService.getInstance(), EMPTY, Config.defaults(), INSTANCE)) {
        stores.createNew();
        Input.Estimates estimates = Input.knownEstimates(0, DOUBLE_RELATIONSHIP_RECORD_UNIT_THRESHOLD << 1, 0, 0, 0, 0, 0);
        // when
        boolean doubleUnits = stores.determineDoubleRelationshipRecordUnits(estimates);
        // then
        assertTrue(doubleUnits);
    }
}
Also used : Input(org.neo4j.internal.batchimport.input.Input) ForcedSecondaryUnitRecordFormats(org.neo4j.kernel.impl.store.format.ForcedSecondaryUnitRecordFormats) RecordFormats(org.neo4j.kernel.impl.store.format.RecordFormats) ForcedSecondaryUnitRecordFormats(org.neo4j.kernel.impl.store.format.ForcedSecondaryUnitRecordFormats) Test(org.junit.jupiter.api.Test)

Example 2 with ForcedSecondaryUnitRecordFormats

use of org.neo4j.kernel.impl.store.format.ForcedSecondaryUnitRecordFormats in project neo4j by neo4j.

the class BatchingNeoStoresTest method shouldNotDecideToAllocateDoubleRelationshipRecordUnitsonLowAmountOfRelationshipsOnSupportedFormat.

@Test
void shouldNotDecideToAllocateDoubleRelationshipRecordUnitsonLowAmountOfRelationshipsOnSupportedFormat() throws Exception {
    // given
    RecordFormats formats = new ForcedSecondaryUnitRecordFormats(LATEST_RECORD_FORMATS);
    try (BatchingNeoStores stores = BatchingNeoStores.batchingNeoStoresWithExternalPageCache(fileSystem, pageCache, PageCacheTracer.NULL, databaseLayout, formats, Configuration.DEFAULT, NullLogService.getInstance(), EMPTY, Config.defaults(), INSTANCE)) {
        stores.createNew();
        Input.Estimates estimates = Input.knownEstimates(0, DOUBLE_RELATIONSHIP_RECORD_UNIT_THRESHOLD >> 1, 0, 0, 0, 0, 0);
        // when
        boolean doubleUnits = stores.determineDoubleRelationshipRecordUnits(estimates);
        // then
        assertFalse(doubleUnits);
    }
}
Also used : Input(org.neo4j.internal.batchimport.input.Input) ForcedSecondaryUnitRecordFormats(org.neo4j.kernel.impl.store.format.ForcedSecondaryUnitRecordFormats) RecordFormats(org.neo4j.kernel.impl.store.format.RecordFormats) ForcedSecondaryUnitRecordFormats(org.neo4j.kernel.impl.store.format.ForcedSecondaryUnitRecordFormats) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 Input (org.neo4j.internal.batchimport.input.Input)2 ForcedSecondaryUnitRecordFormats (org.neo4j.kernel.impl.store.format.ForcedSecondaryUnitRecordFormats)2 RecordFormats (org.neo4j.kernel.impl.store.format.RecordFormats)2