Search in sources :

Example 1 with Clock

use of java.time.Clock in project neo4j by neo4j.

the class DelayedBufferTest method shouldHandleTheWholeWorkloadShebang.

@Test
public void shouldHandleTheWholeWorkloadShebang() throws Throwable {
    // GIVEN
    final int size = 1_000;
    final long bufferTime = 3;
    VerifyingConsumer consumer = new VerifyingConsumer(size);
    final Clock clock = Clocks.systemClock();
    Supplier<Long> chunkThreshold = clock::millis;
    Predicate<Long> safeThreshold = time -> clock.millis() - bufferTime >= time;
    final DelayedBuffer<Long> buffer = new DelayedBuffer<>(chunkThreshold, safeThreshold, 10, consumer);
    MaintenanceThread maintenance = new MaintenanceThread(buffer, 5);
    Race adders = new Race();
    final int numberOfAdders = 20;
    final byte[] offeredIds = new byte[size];
    for (int i = 0; i < numberOfAdders; i++) {
        final int finalI = i;
        adders.addContestant(new Runnable() {

            @Override
            public void run() {
                for (int j = 0; j < size; j++) {
                    if (j % numberOfAdders == finalI) {
                        buffer.offer(j);
                        offeredIds[j] = 1;
                        parkNanos(MILLISECONDS.toNanos(current().nextInt(2)));
                    }
                }
            }
        });
    }
    // WHEN (multi-threadded) offering of ids
    adders.go();
    // ... ensuring the test is sane itself (did we really offer all these IDs?)
    for (int i = 0; i < size; i++) {
        assertEquals("ID " + i, (byte) 1, offeredIds[i]);
    }
    maintenance.halt();
    buffer.close();
    // THEN
    consumer.assertHaveOnlySeenRange(0, size - 1);
}
Also used : Suppliers.singleton(org.neo4j.function.Suppliers.singleton) ThreadLocalRandom.current(java.util.concurrent.ThreadLocalRandom.current) Predicate(java.util.function.Predicate) Predicates(org.neo4j.function.Predicates) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Test(org.junit.Test) LockSupport.parkNanos(java.util.concurrent.locks.LockSupport.parkNanos) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) Supplier(java.util.function.Supplier) LockSupport(java.util.concurrent.locks.LockSupport) Consumer(java.util.function.Consumer) AtomicLong(java.util.concurrent.atomic.AtomicLong) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Utils.safeCastLongToInt(org.neo4j.unsafe.impl.batchimport.Utils.safeCastLongToInt) Assert.assertFalse(org.junit.Assert.assertFalse) Clock(java.time.Clock) Assert.fail(org.junit.Assert.fail) Clocks(org.neo4j.time.Clocks) Race(org.neo4j.test.Race) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) Clock(java.time.Clock) Race(org.neo4j.test.Race) AtomicLong(java.util.concurrent.atomic.AtomicLong) Test(org.junit.Test)

Example 2 with Clock

use of java.time.Clock in project neo4j by neo4j.

the class RotationTimerFactoryTest method testTimer.

@Test
public void testTimer() throws Exception {
    // GIVEN
    Clock fixedClock = Clock.fixed(Instant.ofEpochMilli(10000), ZoneOffset.UTC);
    // WHEN
    RotationTimerFactory timerFactory = new RotationTimerFactory(fixedClock, 1000);
    RotationTimerFactory.RotationTimer timer = timerFactory.createTimer();
    RotationTimerFactory.RotationTimer anotherTimer = timerFactory.createTimer();
    // THEN
    Assert.assertFalse(timer.isTimedOut());
    Assert.assertEquals(0, timer.getElapsedTimeMillis());
    Assert.assertNotSame("Factory should construct different timers", timer, anotherTimer);
    // WHEN
    FakeClock fakeClock = Clocks.fakeClock();
    RotationTimerFactory fakeTimerFactory = new RotationTimerFactory(fakeClock, 1000);
    RotationTimerFactory.RotationTimer fakeTimer = fakeTimerFactory.createTimer();
    fakeClock.forward(1001, TimeUnit.MILLISECONDS);
    Assert.assertTrue(fakeTimer.isTimedOut());
    Assert.assertEquals(1001, fakeTimer.getElapsedTimeMillis());
}
Also used : FakeClock(org.neo4j.time.FakeClock) FakeClock(org.neo4j.time.FakeClock) Clock(java.time.Clock) Test(org.junit.Test)

Example 3 with Clock

use of java.time.Clock in project neo4j by neo4j.

the class AvailabilityGuardTest method givenAccessGuardWithConditionWhenShutdownThenInstantlyDenyAccess.

@Test
public void givenAccessGuardWithConditionWhenShutdownThenInstantlyDenyAccess() throws Exception {
    // Given
    Clock clock = Mockito.mock(Clock.class);
    final AvailabilityGuard availabilityGuard = new AvailabilityGuard(clock, NullLog.getInstance());
    availabilityGuard.require(REQUIREMENT_1);
    // When
    availabilityGuard.shutdown();
    // Then
    assertFalse(availabilityGuard.isAvailable(1000));
    verifyZeroInteractions(clock);
}
Also used : Clock(java.time.Clock) Test(org.junit.Test)

Example 4 with Clock

use of java.time.Clock in project neo4j by neo4j.

the class BoltKernelExtension method newInstance.

@Override
public Lifecycle newInstance(KernelContext context, Dependencies dependencies) throws Throwable {
    Config config = dependencies.config();
    GraphDatabaseService gdb = dependencies.db();
    GraphDatabaseAPI api = (GraphDatabaseAPI) gdb;
    LogService logService = dependencies.logService();
    Clock clock = dependencies.clock();
    Log log = logService.getInternalLog(WorkerFactory.class);
    LifeSupport life = new LifeSupport();
    JobScheduler scheduler = dependencies.scheduler();
    InternalLoggerFactory.setDefaultFactory(new Netty4LoggerFactory(logService.getInternalLogProvider()));
    Authentication authentication = authentication(dependencies.authManager(), dependencies.userManagerSupplier());
    BoltFactory boltFactory = life.add(new BoltFactoryImpl(api, dependencies.usageData(), logService, dependencies.txBridge(), authentication, dependencies.sessionTracker(), config));
    WorkerFactory workerFactory = createWorkerFactory(boltFactory, scheduler, dependencies, logService, clock);
    List<ProtocolInitializer> connectors = config.enabledBoltConnectors().stream().map((connConfig) -> {
        ListenSocketAddress listenAddress = config.get(connConfig.listen_address);
        AdvertisedSocketAddress advertisedAddress = config.get(connConfig.advertised_address);
        SslContext sslCtx;
        boolean requireEncryption;
        final BoltConnector.EncryptionLevel encryptionLevel = config.get(connConfig.encryption_level);
        switch(encryptionLevel) {
            case REQUIRED:
                // Encrypted connections are mandatory, a self-signed certificate may be generated.
                requireEncryption = true;
                sslCtx = createSslContext(config, log, advertisedAddress);
                break;
            case OPTIONAL:
                // Encrypted connections are optional, a self-signed certificate may be generated.
                requireEncryption = false;
                sslCtx = createSslContext(config, log, advertisedAddress);
                break;
            case DISABLED:
                // Encryption is turned off, no self-signed certificate will be generated.
                requireEncryption = false;
                sslCtx = null;
                break;
            default:
                // In the unlikely event that we happen to fall through to the default option here,
                // there is a mismatch between the BoltConnector.EncryptionLevel enum and the options
                // handled in this switch statement. In this case, we'll log a warning and default to
                // disabling encryption, since this mirrors the functionality introduced in 3.0.
                log.warn(format("Unhandled encryption level %s - assuming DISABLED.", encryptionLevel.name()));
                requireEncryption = false;
                sslCtx = null;
                break;
        }
        final Map<Long, BiFunction<Channel, Boolean, BoltProtocol>> versions = newVersions(logService, workerFactory);
        return new SocketTransport(listenAddress, sslCtx, requireEncryption, logService.getInternalLogProvider(), versions);
    }).collect(toList());
    if (connectors.size() > 0 && !config.get(GraphDatabaseSettings.disconnected)) {
        life.add(new NettyServer(scheduler.threadFactory(boltNetworkIO), connectors));
        log.info("Bolt Server extension loaded.");
        for (ProtocolInitializer connector : connectors) {
            logService.getUserLog(WorkerFactory.class).info("Bolt enabled on %s.", connector.address());
        }
    }
    return life;
}
Also used : Service(org.neo4j.helpers.Service) UsageData(org.neo4j.udc.UsageData) Log(org.neo4j.logging.Log) Authentication(org.neo4j.bolt.security.auth.Authentication) BiFunction(java.util.function.BiFunction) OperatorCreationException(org.bouncycastle.operator.OperatorCreationException) KernelContext(org.neo4j.kernel.impl.spi.KernelContext) SocketTransport(org.neo4j.bolt.transport.SocketTransport) BoltProtocol(org.neo4j.bolt.transport.BoltProtocol) LifeSupport(org.neo4j.kernel.lifecycle.LifeSupport) KeyStoreFactory(org.neo4j.bolt.security.ssl.KeyStoreFactory) AdvertisedSocketAddress(org.neo4j.helpers.AdvertisedSocketAddress) GeneralSecurityException(java.security.GeneralSecurityException) ProtocolInitializer(org.neo4j.bolt.transport.NettyServer.ProtocolInitializer) Map(java.util.Map) KeyStoreInformation(org.neo4j.bolt.security.ssl.KeyStoreInformation) Groups.boltNetworkIO(org.neo4j.kernel.impl.util.JobScheduler.Groups.boltNetworkIO) BoltConnectionDescriptor(org.neo4j.bolt.v1.runtime.BoltConnectionDescriptor) BoltFactory(org.neo4j.bolt.v1.runtime.BoltFactory) BoltConnector(org.neo4j.kernel.configuration.BoltConnector) ThreadToStatementContextBridge(org.neo4j.kernel.impl.core.ThreadToStatementContextBridge) LogService(org.neo4j.kernel.impl.logging.LogService) String.format(java.lang.String.format) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) Netty4LoggerFactory(org.neo4j.bolt.transport.Netty4LoggerFactory) Settings.derivedSetting(org.neo4j.kernel.configuration.Settings.derivedSetting) List(java.util.List) Description(org.neo4j.configuration.Description) BoltFactoryImpl(org.neo4j.bolt.v1.runtime.BoltFactoryImpl) KernelExtensionFactory(org.neo4j.kernel.extension.KernelExtensionFactory) WorkerFactory(org.neo4j.bolt.v1.runtime.WorkerFactory) BasicAuthentication(org.neo4j.bolt.security.auth.BasicAuthentication) GraphDatabaseSettings(org.neo4j.graphdb.factory.GraphDatabaseSettings) Settings.pathSetting(org.neo4j.kernel.configuration.Settings.pathSetting) Internal(org.neo4j.configuration.Internal) Monitors(org.neo4j.kernel.monitoring.Monitors) HashMap(java.util.HashMap) JobScheduler(org.neo4j.kernel.impl.util.JobScheduler) Configuration(org.neo4j.graphdb.config.Configuration) ListenSocketAddress(org.neo4j.helpers.ListenSocketAddress) BoltProtocolV1(org.neo4j.bolt.v1.transport.BoltProtocolV1) Certificates(org.neo4j.bolt.security.ssl.Certificates) GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) NettyServer(org.neo4j.bolt.transport.NettyServer) ThreadedWorkerFactory(org.neo4j.bolt.v1.runtime.concurrent.ThreadedWorkerFactory) Lifecycle(org.neo4j.kernel.lifecycle.Lifecycle) Config(org.neo4j.kernel.configuration.Config) SslContext(io.netty.handler.ssl.SslContext) BoltConnectionTracker(org.neo4j.kernel.api.bolt.BoltConnectionTracker) Setting(org.neo4j.graphdb.config.Setting) IOException(java.io.IOException) PATH(org.neo4j.kernel.configuration.Settings.PATH) File(java.io.File) Channel(io.netty.channel.Channel) UserManagerSupplier(org.neo4j.kernel.api.security.UserManagerSupplier) BoltWorker(org.neo4j.bolt.v1.runtime.BoltWorker) Collectors.toList(java.util.stream.Collectors.toList) SslContextBuilder(io.netty.handler.ssl.SslContextBuilder) Clock(java.time.Clock) InternalLoggerFactory(io.netty.util.internal.logging.InternalLoggerFactory) MonitoredWorkerFactory(org.neo4j.bolt.v1.runtime.MonitoredWorkerFactory) AuthManager(org.neo4j.kernel.api.security.AuthManager) Config(org.neo4j.kernel.configuration.Config) AdvertisedSocketAddress(org.neo4j.helpers.AdvertisedSocketAddress) Clock(java.time.Clock) BoltFactory(org.neo4j.bolt.v1.runtime.BoltFactory) WorkerFactory(org.neo4j.bolt.v1.runtime.WorkerFactory) ThreadedWorkerFactory(org.neo4j.bolt.v1.runtime.concurrent.ThreadedWorkerFactory) MonitoredWorkerFactory(org.neo4j.bolt.v1.runtime.MonitoredWorkerFactory) NettyServer(org.neo4j.bolt.transport.NettyServer) BoltFactoryImpl(org.neo4j.bolt.v1.runtime.BoltFactoryImpl) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) LifeSupport(org.neo4j.kernel.lifecycle.LifeSupport) SslContext(io.netty.handler.ssl.SslContext) ProtocolInitializer(org.neo4j.bolt.transport.NettyServer.ProtocolInitializer) JobScheduler(org.neo4j.kernel.impl.util.JobScheduler) GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) Log(org.neo4j.logging.Log) SocketTransport(org.neo4j.bolt.transport.SocketTransport) Channel(io.netty.channel.Channel) BoltProtocol(org.neo4j.bolt.transport.BoltProtocol) Authentication(org.neo4j.bolt.security.auth.Authentication) BasicAuthentication(org.neo4j.bolt.security.auth.BasicAuthentication) ListenSocketAddress(org.neo4j.helpers.ListenSocketAddress) Netty4LoggerFactory(org.neo4j.bolt.transport.Netty4LoggerFactory) Map(java.util.Map) HashMap(java.util.HashMap) LogService(org.neo4j.kernel.impl.logging.LogService)

Example 5 with Clock

use of java.time.Clock in project neo4j by neo4j.

the class NeoStoreDataSource method buildTransactionLogs.

private NeoStoreTransactionLogModule buildTransactionLogs(File storeDir, Config config, LogProvider logProvider, JobScheduler scheduler, FileSystemAbstraction fileSystemAbstraction, StorageEngine storageEngine, LogEntryReader<ReadableClosablePositionAwareChannel> logEntryReader, SynchronizedArrayIdOrderingQueue legacyIndexTransactionOrdering, TransactionIdStore transactionIdStore, LogVersionRepository logVersionRepository) {
    TransactionMetadataCache transactionMetadataCache = new TransactionMetadataCache(100_000);
    LogHeaderCache logHeaderCache = new LogHeaderCache(1000);
    final PhysicalLogFiles logFiles = new PhysicalLogFiles(storeDir, PhysicalLogFile.DEFAULT_NAME, fileSystemAbstraction);
    final PhysicalLogFile logFile = life.add(new PhysicalLogFile(fileSystemAbstraction, logFiles, config.get(GraphDatabaseSettings.logical_log_rotation_threshold), transactionIdStore::getLastCommittedTransactionId, logVersionRepository, physicalLogMonitor, logHeaderCache));
    final PhysicalLogFileInformation.LogVersionToTimestamp logInformation = version -> {
        LogPosition position = LogPosition.start(version);
        try (ReadableLogChannel channel = logFile.getReader(position)) {
            LogEntry entry;
            while ((entry = logEntryReader.readLogEntry(channel)) != null) {
                if (entry instanceof LogEntryStart) {
                    return entry.<LogEntryStart>as().getTimeWritten();
                }
            }
        }
        return -1;
    };
    final LogFileInformation logFileInformation = new PhysicalLogFileInformation(logFiles, logHeaderCache, transactionIdStore::getLastCommittedTransactionId, logInformation);
    if (config.get(GraphDatabaseFacadeFactory.Configuration.ephemeral)) {
        config = config.withDefaults(stringMap(GraphDatabaseSettings.keep_logical_logs.name(), "1 files"));
    }
    String pruningConf = config.get(GraphDatabaseSettings.keep_logical_logs);
    LogPruneStrategy logPruneStrategy = fromConfigValue(fs, logFileInformation, logFiles, pruningConf);
    final LogPruning logPruning = new LogPruningImpl(logPruneStrategy, logProvider);
    final LogRotation logRotation = new LogRotationImpl(monitors.newMonitor(LogRotation.Monitor.class), logFile, databaseHealth);
    final TransactionAppender appender = life.add(new BatchingTransactionAppender(logFile, logRotation, transactionMetadataCache, transactionIdStore, legacyIndexTransactionOrdering, databaseHealth));
    final LogicalTransactionStore logicalTransactionStore = new PhysicalLogicalTransactionStore(logFile, transactionMetadataCache, logEntryReader);
    int txThreshold = config.get(GraphDatabaseSettings.check_point_interval_tx);
    final CountCommittedTransactionThreshold countCommittedTransactionThreshold = new CountCommittedTransactionThreshold(txThreshold);
    long timeMillisThreshold = config.get(GraphDatabaseSettings.check_point_interval_time);
    TimeCheckPointThreshold timeCheckPointThreshold = new TimeCheckPointThreshold(timeMillisThreshold, clock);
    CheckPointThreshold threshold = CheckPointThresholds.or(countCommittedTransactionThreshold, timeCheckPointThreshold);
    final CheckPointerImpl checkPointer = new CheckPointerImpl(transactionIdStore, threshold, storageEngine, logPruning, appender, databaseHealth, logProvider, tracers.checkPointTracer, ioLimiter, storeCopyCheckPointMutex);
    long recurringPeriod = Math.min(timeMillisThreshold, TimeUnit.SECONDS.toMillis(10));
    CheckPointScheduler checkPointScheduler = new CheckPointScheduler(checkPointer, scheduler, recurringPeriod, databaseHealth);
    life.add(checkPointer);
    life.add(checkPointScheduler);
    return new NeoStoreTransactionLogModule(logicalTransactionStore, logFileInformation, logFiles, logFile, logRotation, checkPointer, appender, legacyIndexTransactionOrdering);
}
Also used : LegacyIndexStore(org.neo4j.kernel.impl.index.LegacyIndexStore) StoreId(org.neo4j.kernel.impl.store.StoreId) ResourceIterator(org.neo4j.graphdb.ResourceIterator) Lifecycles(org.neo4j.kernel.lifecycle.Lifecycles) RelationshipTypeTokenHolder(org.neo4j.kernel.impl.core.RelationshipTypeTokenHolder) SystemNanoClock(org.neo4j.time.SystemNanoClock) AccessCapability(org.neo4j.kernel.impl.factory.AccessCapability) SchemaWriteGuard(org.neo4j.kernel.impl.api.SchemaWriteGuard) CheckPointThresholds(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointThresholds) VersionAwareLogEntryReader(org.neo4j.kernel.impl.transaction.log.entry.VersionAwareLogEntryReader) RecordStorageEngine(org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine) LogHeader(org.neo4j.kernel.impl.transaction.log.entry.LogHeader) SchemaIndexProvider(org.neo4j.kernel.api.index.SchemaIndexProvider) Map(java.util.Map) IndexProviders(org.neo4j.kernel.spi.legacyindex.IndexProviders) TokenNameLookup(org.neo4j.kernel.api.TokenNameLookup) KernelSchemaStateStore(org.neo4j.kernel.impl.api.KernelSchemaStateStore) RecordFormatPropertyConfigurator(org.neo4j.kernel.impl.store.format.RecordFormatPropertyConfigurator) TransactionMonitor(org.neo4j.kernel.impl.transaction.TransactionMonitor) DefaultRecoverySPI(org.neo4j.kernel.recovery.DefaultRecoverySPI) HighestSelectionStrategy(org.neo4j.kernel.extension.dependency.HighestSelectionStrategy) TransactionEventHandlers(org.neo4j.kernel.internal.TransactionEventHandlers) IdReuseEligibility(org.neo4j.kernel.impl.store.id.IdReuseEligibility) LogEntryStart(org.neo4j.kernel.impl.transaction.log.entry.LogEntryStart) StartupStatisticsProvider(org.neo4j.kernel.impl.core.StartupStatisticsProvider) StateHandlingStatementOperations(org.neo4j.kernel.impl.api.StateHandlingStatementOperations) PropertyAccessor(org.neo4j.kernel.api.index.PropertyAccessor) PositionToRecoverFrom(org.neo4j.kernel.recovery.PositionToRecoverFrom) SimpleTriggerInfo(org.neo4j.kernel.impl.transaction.log.checkpoint.SimpleTriggerInfo) LockSupport(java.util.concurrent.locks.LockSupport) SchemaStateConcern(org.neo4j.kernel.impl.api.SchemaStateConcern) UpdateableSchemaState(org.neo4j.kernel.impl.api.UpdateableSchemaState) Kernel(org.neo4j.kernel.impl.api.Kernel) TransactionCommitProcess(org.neo4j.kernel.impl.api.TransactionCommitProcess) Logger(org.neo4j.logging.Logger) LabelScanStoreProvider(org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider) LogEntry(org.neo4j.kernel.impl.transaction.log.entry.LogEntry) GraphDatabaseSettings(org.neo4j.graphdb.factory.GraphDatabaseSettings) Tracers(org.neo4j.kernel.monitoring.tracing.Tracers) SynchronizedArrayIdOrderingQueue(org.neo4j.kernel.impl.util.SynchronizedArrayIdOrderingQueue) Guard(org.neo4j.kernel.guard.Guard) IndexingService(org.neo4j.kernel.impl.api.index.IndexingService) IndexImplementation(org.neo4j.kernel.spi.legacyindex.IndexImplementation) Exceptions(org.neo4j.helpers.Exceptions) ConstraintSemantics(org.neo4j.kernel.impl.constraints.ConstraintSemantics) RecordFormatSelector(org.neo4j.kernel.impl.store.format.RecordFormatSelector) TimeCheckPointThreshold(org.neo4j.kernel.impl.transaction.log.checkpoint.TimeCheckPointThreshold) LabelScanStore(org.neo4j.kernel.api.labelscan.LabelScanStore) JobScheduler(org.neo4j.kernel.impl.util.JobScheduler) Supplier(java.util.function.Supplier) ReadableClosablePositionAwareChannel(org.neo4j.kernel.impl.transaction.log.ReadableClosablePositionAwareChannel) LogPosition(org.neo4j.kernel.impl.transaction.log.LogPosition) PropertyKeyTokenHolder(org.neo4j.kernel.impl.core.PropertyKeyTokenHolder) CountCommittedTransactionThreshold(org.neo4j.kernel.impl.transaction.log.checkpoint.CountCommittedTransactionThreshold) GuardingStatementOperations(org.neo4j.kernel.impl.api.GuardingStatementOperations) DeleteStoresFromOtherLabelScanStoreProviders(org.neo4j.kernel.extension.dependency.DeleteStoresFromOtherLabelScanStoreProviders) Lifecycle(org.neo4j.kernel.lifecycle.Lifecycle) LogEntryReader(org.neo4j.kernel.impl.transaction.log.entry.LogEntryReader) TransactionMetadataCache(org.neo4j.kernel.impl.transaction.log.TransactionMetadataCache) IOException(java.io.IOException) LatestCheckPointFinder(org.neo4j.kernel.recovery.LatestCheckPointFinder) File(java.io.File) StackingQueryRegistrationOperations(org.neo4j.kernel.impl.api.StackingQueryRegistrationOperations) CheckPointScheduler(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointScheduler) LockingStatementOperations(org.neo4j.kernel.impl.api.LockingStatementOperations) Procedures(org.neo4j.kernel.impl.proc.Procedures) IndexConfigStore(org.neo4j.kernel.impl.index.IndexConfigStore) KernelTransactionsSnapshot(org.neo4j.kernel.impl.api.KernelTransactionsSnapshot) LogPruneStrategyFactory.fromConfigValue(org.neo4j.kernel.impl.transaction.log.pruning.LogPruneStrategyFactory.fromConfigValue) StoreCopyCheckPointMutex(org.neo4j.kernel.impl.transaction.log.checkpoint.StoreCopyCheckPointMutex) ReentrantLockService(org.neo4j.kernel.impl.locking.ReentrantLockService) DatabaseMigrator(org.neo4j.kernel.impl.storemigration.DatabaseMigrator) LifecycleAdapter(org.neo4j.kernel.lifecycle.LifecycleAdapter) LogPruneStrategy(org.neo4j.kernel.impl.transaction.log.pruning.LogPruneStrategy) Log(org.neo4j.logging.Log) StoreFileMetadata(org.neo4j.storageengine.api.StoreFileMetadata) IdGeneratorFactory(org.neo4j.kernel.impl.store.id.IdGeneratorFactory) GraphDatabaseFacadeFactory(org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory) CheckPointThreshold(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointThreshold) IdTypeConfigurationProvider(org.neo4j.kernel.impl.store.id.configuration.IdTypeConfigurationProvider) BatchingTransactionAppender(org.neo4j.kernel.impl.transaction.log.BatchingTransactionAppender) Dependencies(org.neo4j.kernel.impl.util.Dependencies) LifeSupport(org.neo4j.kernel.lifecycle.LifeSupport) KernelAPI(org.neo4j.kernel.api.KernelAPI) PhysicalLogFileInformation(org.neo4j.kernel.impl.transaction.log.PhysicalLogFileInformation) DiagnosticsExtractor(org.neo4j.kernel.info.DiagnosticsExtractor) ConstraintEnforcingEntityOperations(org.neo4j.kernel.impl.api.ConstraintEnforcingEntityOperations) NeoStoreFileListing(org.neo4j.kernel.impl.transaction.state.NeoStoreFileListing) LogRotation(org.neo4j.kernel.impl.transaction.log.rotation.LogRotation) StatementOperationContainer(org.neo4j.kernel.impl.api.StatementOperationContainer) DataIntegrityValidatingStatementOperations(org.neo4j.kernel.impl.api.DataIntegrityValidatingStatementOperations) QueryRegistrationOperations(org.neo4j.kernel.impl.api.operations.QueryRegistrationOperations) CheckPointerImpl(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointerImpl) ReadableLogChannel(org.neo4j.kernel.impl.transaction.log.ReadableLogChannel) StatementLocksFactory(org.neo4j.kernel.impl.locking.StatementLocksFactory) PageCache(org.neo4j.io.pagecache.PageCache) Recovery(org.neo4j.kernel.recovery.Recovery) StorageEngine(org.neo4j.storageengine.api.StorageEngine) LogVersionRepository(org.neo4j.kernel.impl.transaction.log.LogVersionRepository) LogService(org.neo4j.kernel.impl.logging.LogService) KernelException(org.neo4j.kernel.api.exceptions.KernelException) PhysicalLogFile(org.neo4j.kernel.impl.transaction.log.PhysicalLogFile) StoreReadLayer(org.neo4j.storageengine.api.StoreReadLayer) LoggingLogFileMonitor(org.neo4j.kernel.impl.transaction.log.LoggingLogFileMonitor) NamedLabelScanStoreSelectionStrategy(org.neo4j.kernel.extension.dependency.NamedLabelScanStoreSelectionStrategy) MetaDataStore(org.neo4j.kernel.impl.store.MetaDataStore) StatementOperationParts(org.neo4j.kernel.impl.api.StatementOperationParts) LegacyIndexProviderLookup(org.neo4j.kernel.impl.api.LegacyIndexProviderLookup) DependencyResolver(org.neo4j.graphdb.DependencyResolver) LogHeaderCache(org.neo4j.kernel.impl.transaction.log.LogHeaderCache) KernelTransactions(org.neo4j.kernel.impl.api.KernelTransactions) TransactionHeaderInformationFactory(org.neo4j.kernel.impl.transaction.TransactionHeaderInformationFactory) PhysicalLogicalTransactionStore(org.neo4j.kernel.impl.transaction.log.PhysicalLogicalTransactionStore) TransactionAppender(org.neo4j.kernel.impl.transaction.log.TransactionAppender) TransactionIdStore(org.neo4j.kernel.impl.transaction.log.TransactionIdStore) LogicalTransactionStore(org.neo4j.kernel.impl.transaction.log.LogicalTransactionStore) Monitors(org.neo4j.kernel.monitoring.Monitors) LogProvider(org.neo4j.logging.LogProvider) HashMap(java.util.HashMap) DiagnosticsManager(org.neo4j.kernel.info.DiagnosticsManager) IOLimiter(org.neo4j.io.pagecache.IOLimiter) RecordFormats(org.neo4j.kernel.impl.store.format.RecordFormats) ConstraintIndexCreator(org.neo4j.kernel.impl.api.state.ConstraintIndexCreator) StoreMigrator(org.neo4j.kernel.impl.storemigration.participant.StoreMigrator) LogFileInformation(org.neo4j.kernel.impl.transaction.log.LogFileInformation) LogRotationImpl(org.neo4j.kernel.impl.transaction.log.rotation.LogRotationImpl) DiagnosticsPhase(org.neo4j.kernel.info.DiagnosticsPhase) LogPruningImpl(org.neo4j.kernel.impl.transaction.log.pruning.LogPruningImpl) LogPruning(org.neo4j.kernel.impl.transaction.log.pruning.LogPruning) MapUtil.stringMap(org.neo4j.helpers.collection.MapUtil.stringMap) PhysicalLogFiles(org.neo4j.kernel.impl.transaction.log.PhysicalLogFiles) AutoIndexing(org.neo4j.kernel.api.legacyindex.AutoIndexing) Config(org.neo4j.kernel.configuration.Config) LockService(org.neo4j.kernel.impl.locking.LockService) Setting(org.neo4j.graphdb.config.Setting) LabelTokenHolder(org.neo4j.kernel.impl.core.LabelTokenHolder) VisibleMigrationProgressMonitor(org.neo4j.kernel.impl.storemigration.monitoring.VisibleMigrationProgressMonitor) TimeUnit(java.util.concurrent.TimeUnit) DatabaseHealth(org.neo4j.kernel.internal.DatabaseHealth) CommitProcessFactory(org.neo4j.kernel.impl.api.CommitProcessFactory) Clock(java.time.Clock) FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) TransactionHooks(org.neo4j.kernel.impl.api.TransactionHooks) LogPruneStrategy(org.neo4j.kernel.impl.transaction.log.pruning.LogPruneStrategy) CheckPointerImpl(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointerImpl) TimeCheckPointThreshold(org.neo4j.kernel.impl.transaction.log.checkpoint.TimeCheckPointThreshold) BatchingTransactionAppender(org.neo4j.kernel.impl.transaction.log.BatchingTransactionAppender) PhysicalLogicalTransactionStore(org.neo4j.kernel.impl.transaction.log.PhysicalLogicalTransactionStore) LogicalTransactionStore(org.neo4j.kernel.impl.transaction.log.LogicalTransactionStore) PhysicalLogFiles(org.neo4j.kernel.impl.transaction.log.PhysicalLogFiles) LogPruning(org.neo4j.kernel.impl.transaction.log.pruning.LogPruning) TransactionMonitor(org.neo4j.kernel.impl.transaction.TransactionMonitor) LoggingLogFileMonitor(org.neo4j.kernel.impl.transaction.log.LoggingLogFileMonitor) VisibleMigrationProgressMonitor(org.neo4j.kernel.impl.storemigration.monitoring.VisibleMigrationProgressMonitor) TimeCheckPointThreshold(org.neo4j.kernel.impl.transaction.log.checkpoint.TimeCheckPointThreshold) CheckPointThreshold(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointThreshold) LogEntry(org.neo4j.kernel.impl.transaction.log.entry.LogEntry) LogRotationImpl(org.neo4j.kernel.impl.transaction.log.rotation.LogRotationImpl) LogPosition(org.neo4j.kernel.impl.transaction.log.LogPosition) LogEntryStart(org.neo4j.kernel.impl.transaction.log.entry.LogEntryStart) PhysicalLogicalTransactionStore(org.neo4j.kernel.impl.transaction.log.PhysicalLogicalTransactionStore) ReadableLogChannel(org.neo4j.kernel.impl.transaction.log.ReadableLogChannel) CountCommittedTransactionThreshold(org.neo4j.kernel.impl.transaction.log.checkpoint.CountCommittedTransactionThreshold) LogPruningImpl(org.neo4j.kernel.impl.transaction.log.pruning.LogPruningImpl) BatchingTransactionAppender(org.neo4j.kernel.impl.transaction.log.BatchingTransactionAppender) TransactionAppender(org.neo4j.kernel.impl.transaction.log.TransactionAppender) TransactionMetadataCache(org.neo4j.kernel.impl.transaction.log.TransactionMetadataCache) CheckPointScheduler(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointScheduler) PhysicalLogFileInformation(org.neo4j.kernel.impl.transaction.log.PhysicalLogFileInformation) LogFileInformation(org.neo4j.kernel.impl.transaction.log.LogFileInformation) LogRotation(org.neo4j.kernel.impl.transaction.log.rotation.LogRotation) LogHeaderCache(org.neo4j.kernel.impl.transaction.log.LogHeaderCache) PhysicalLogFile(org.neo4j.kernel.impl.transaction.log.PhysicalLogFile) PhysicalLogFileInformation(org.neo4j.kernel.impl.transaction.log.PhysicalLogFileInformation)

Aggregations

Clock (java.time.Clock)209 Test (org.junit.Test)62 Instant (java.time.Instant)51 Test (org.testng.annotations.Test)43 LocalTime (java.time.LocalTime)15 ZonedDateTime (java.time.ZonedDateTime)12 LocalDateTime (java.time.LocalDateTime)11 ZoneId (java.time.ZoneId)11 LocalDate (java.time.LocalDate)10 OffsetDateTime (java.time.OffsetDateTime)8 Test (org.junit.jupiter.api.Test)7 HandlerTest (com.yahoo.vespa.config.server.http.HandlerTest)6 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)6 IOException (java.io.IOException)6 SessionTest (com.yahoo.vespa.config.server.session.SessionTest)5 OffsetTime (java.time.OffsetTime)5 ZoneOffset (java.time.ZoneOffset)5 Chronology (java.time.chrono.Chronology)5 IsoChronology (java.time.chrono.IsoChronology)5 Date (java.util.Date)4