use of org.neo4j.logging.Log in project neo4j by neo4j.
the class GlobalModule method createPageCache.
protected PageCache createPageCache(FileSystemAbstraction fileSystem, Config config, LogService logging, Tracers tracers, JobScheduler jobScheduler, SystemNanoClock clock, MemoryPools memoryPools) {
Log pageCacheLog = logging.getInternalLog(PageCache.class);
ConfiguringPageCacheFactory pageCacheFactory = new ConfiguringPageCacheFactory(fileSystem, config, tracers.getPageCacheTracer(), pageCacheLog, jobScheduler, clock, memoryPools);
PageCache pageCache = pageCacheFactory.getOrCreatePageCache();
if (config.get(GraphDatabaseInternalSettings.dump_configuration)) {
pageCacheFactory.dumpConfiguration();
}
return pageCache;
}
use of org.neo4j.logging.Log in project neo4j by neo4j.
the class GlobalModule method createFileSystemWatcherService.
private FileSystemWatcherService createFileSystemWatcherService(FileSystemAbstraction fileSystem, LogService logging, JobScheduler jobScheduler, Config config) {
if (!config.get(filewatcher_enabled)) {
Log log = logging.getInternalLog(getClass());
log.info("File watcher disabled by configuration.");
return FileSystemWatcherService.EMPTY_WATCHER;
}
try {
return new DefaultFileSystemWatcherService(jobScheduler, fileSystem.fileWatcher());
} catch (Exception e) {
Log log = logging.getInternalLog(getClass());
log.warn("Can not create file watcher for current file system. File monitoring capabilities for store files will be disabled.", e);
return FileSystemWatcherService.EMPTY_WATCHER;
}
}
use of org.neo4j.logging.Log in project neo4j by neo4j.
the class TransactionRangeDiagnosticsTest method shouldLogCorrectTransactionLogDiagnosticsForNoTransactionLogs.
@Test
void shouldLogCorrectTransactionLogDiagnosticsForNoTransactionLogs() throws IOException {
// GIVEN
Database database = databaseWithLogFilesContainingLowestTxId(noLogs());
AssertableLogProvider logProvider = new AssertableLogProvider();
Log logger = logProvider.getLog(getClass());
// WHEN
new TransactionRangeDiagnostics(database).dump(logger::info);
// THEN
assertThat(logProvider).containsMessages("Transaction log files stored on file store:").containsMessages(" - no transactions found").containsMessages(" - no checkpoints found");
}
use of org.neo4j.logging.Log in project neo4j by neo4j.
the class TransactionRangeDiagnosticsTest method shouldLogCorrectTransactionLogDiagnosticsForTransactionsAndCheckpointLogs.
@Test
void shouldLogCorrectTransactionLogDiagnosticsForTransactionsAndCheckpointLogs() throws Exception {
// GIVEN
long txLogLowVersion = 2;
long txLogHighVersion = 10;
long checkpointLogLowVersion = 0;
long checkpointLogHighVersion = 3;
StoreId storeId = new StoreId(12345);
LogPosition checkpointLogPosition = new LogPosition(checkpointLogHighVersion, 34);
Database database = databaseWithLogFilesContainingLowestTxId(logs(transactionLogsWithTransaction(txLogLowVersion, txLogHighVersion, 42), checkpointLogsWithLastCheckpoint(checkpointLogLowVersion, checkpointLogHighVersion, new CheckpointInfo(new LogEntryDetachedCheckpoint(KernelVersion.LATEST, checkpointLogPosition, 1234, storeId, "testing"), checkpointLogPosition))));
AssertableLogProvider logProvider = new AssertableLogProvider();
Log logger = logProvider.getLog(getClass());
// WHEN
new TransactionRangeDiagnostics(database).dump(logger::info);
// THEN
assertThat(logProvider).containsMessages("existing transaction log versions " + txLogLowVersion + "-" + txLogHighVersion).containsMessages("existing checkpoint log versions " + checkpointLogLowVersion + "-" + checkpointLogHighVersion);
}
use of org.neo4j.logging.Log in project neo4j by neo4j.
the class PageCachedNumberArrayFactoryTest method shouldLogAllocationOnLongArray.
@Test
void shouldLogAllocationOnLongArray() {
// given
Log log = mock(Log.class);
Path dir = directory.directory("cache");
PageCachedNumberArrayFactory factory = new PageCachedNumberArrayFactory(pageCache, NULL, dir, log, DEFAULT_DATABASE_NAME);
// when
factory.newLongArray(1_000, -1, 0, INSTANCE).close();
// then
verify(log).info(ArgumentMatchers.contains("Using page-cache backed caching"));
}
Aggregations