Skip to content

Commit

Permalink
Moved DiagnosticsManager and friends to new neo4j-diagnostics component
Browse files Browse the repository at this point in the history
  • Loading branch information
tinwelint committed Aug 10, 2018
1 parent a68a97c commit 49d3b9b
Show file tree
Hide file tree
Showing 27 changed files with 1,170 additions and 30 deletions.
695 changes: 695 additions & 0 deletions community/diagnostics/LICENSE.txt

Large diffs are not rendered by default.

326 changes: 326 additions & 0 deletions community/diagnostics/LICENSES.txt

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions community/diagnostics/NOTICE.txt
@@ -0,0 +1,49 @@
Neo4j
Copyright © 2002-2018 Neo4j Sweden AB (referred to in this notice as "Neo4j")
[http://neo4j.com]

This product includes software ("Software") developed by Neo4j.

The copyright in the bundled Neo4j graph database (including the
Software) is owned by Neo4j. The Software developed and owned
by Neo4j is licensed under the GNU GENERAL PUBLIC LICENSE Version 3
(http://www.fsf.org/licensing/licenses/gpl-3.0.html) ("GPL")
to all third parties and that license, as required by the GPL, is
included in the LICENSE.txt file.

However, if you have executed an End User Software License and Services
Agreement or an OEM Software License and Support Services Agreement, or
another commercial license agreement with Neo4j or one of its
affiliates (each, a "Commercial Agreement"), the terms of the license in
such Commercial Agreement will supersede the GPL and you may use the
software solely pursuant to the terms of the relevant Commercial
Agreement.

Full license texts are found in LICENSES.txt.


Third-party licenses
--------------------

Apache Software License, Version 2.0
Apache Commons Lang

Eclipse Distribution License - v 1.0
Eclipse Collections API
Eclipse Collections Main Library

Eclipse Public License - v 1.0
Eclipse Collections API
Eclipse Collections Main Library

Dependencies with multiple licenses
-----------------------------------

Eclipse Collections API
Eclipse Distribution License - v 1.0
Eclipse Public License - v 1.0

Eclipse Collections Main Library
Eclipse Distribution License - v 1.0
Eclipse Public License - v 1.0

57 changes: 57 additions & 0 deletions community/diagnostics/pom.xml
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.neo4j</groupId>
<artifactId>parent</artifactId>
<version>3.5.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>

<properties>
<license-text.header>headers/GPL-3-header.txt</license-text.header>
<licensing.prepend.text>licensing/notice-gpl-prefix.txt</licensing.prepend.text>
<moduleName>org.neo4j.internal.diagnostics</moduleName>
</properties>

<modelVersion>4.0.0</modelVersion>
<artifactId>neo4j-diagnostics</artifactId>
<version>3.5.0-SNAPSHOT</version>

<packaging>jar</packaging>
<name>Neo4j - Diagnostics</name>
<description>Diagnostics registration and logging.</description>
<url>http://components.neo4j.org/${project.artifactId}/${project.version}</url>

<scm>
<connection>scm:git:git://github.com/neo4j/neo4j.git</connection>
<developerConnection>scm:git:git@github.com:neo4j/neo4j.git</developerConnection>
<url>https://github.com/neo4j/neo4j</url>
</scm>

<licenses>
<license>
<name>GNU General Public License, Version 3</name>
<url>http://www.gnu.org/licenses/gpl-3.0-standalone.html</url>
<comments>The software ("Software") developed and owned by Neo4j Sweden AB (referred to in this notice as "Neo4j") is
licensed under the GNU GENERAL PUBLIC LICENSE Version 3 to all third
parties and that license is included below.

However, if you have executed an End User Software License and Services
Agreement or an OEM Software License and Support Services Agreement, or
another commercial license agreement with Neo4j or one of its
affiliates (each, a "Commercial Agreement"), the terms of the license in
such Commercial Agreement will supersede the GNU GENERAL PUBLIC LICENSE
Version 3 and you may use the Software solely pursuant to the terms of
the relevant Commercial Agreement.
</comments>
</license>
</licenses>

<dependencies>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-logging</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.info;
package org.neo4j.internal.diagnostics;

import org.neo4j.logging.Logger;

Expand Down
Expand Up @@ -17,19 +17,22 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.info;
package org.neo4j.internal.diagnostics;

import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

import org.neo4j.internal.diagnostics.DiagnosticsExtractor.VisitableDiagnostics;
import org.neo4j.helpers.collection.Visitor;
import org.neo4j.kernel.info.DiagnosticsExtractor.VisitableDiagnostics;
import org.neo4j.kernel.lifecycle.Lifecycle;
import org.neo4j.logging.Log;
import org.neo4j.logging.Logger;
import org.neo4j.logging.NullLog;

/**
* Collects and manages all {@link DiagnosticsProvider}.
*/
public class DiagnosticsManager implements Iterable<DiagnosticsProvider>, Lifecycle
{
private final List<DiagnosticsProvider> providers = new CopyOnWriteArrayList<>();
Expand Down Expand Up @@ -75,7 +78,6 @@ public void acceptDiagnosticsVisitor( Object visitor )
}
}
} );
SystemDiagnostics.registerWith( this );
}

@Override
Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.info;
package org.neo4j.internal.diagnostics;

import org.neo4j.logging.Log;

Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.info;
package org.neo4j.internal.diagnostics;

import org.neo4j.logging.Logger;

Expand Down
5 changes: 5 additions & 0 deletions community/kernel-api/pom.xml
Expand Up @@ -68,6 +68,11 @@ the relevant Commercial Agreement.
<artifactId>neo4j-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-diagnostics</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
Expand Up @@ -22,12 +22,12 @@
import java.util.Collection;
import java.util.stream.Stream;

import org.neo4j.internal.diagnostics.DiagnosticsManager;
import org.neo4j.internal.kernel.api.exceptions.TransactionFailureException;
import org.neo4j.internal.kernel.api.exceptions.schema.ConstraintValidationException;
import org.neo4j.io.pagecache.IOLimiter;
import org.neo4j.kernel.api.exceptions.schema.CreateConstraintFailureException;
import org.neo4j.kernel.impl.store.StoreId;
import org.neo4j.kernel.info.DiagnosticsManager;
import org.neo4j.storageengine.api.lock.ResourceLocker;
import org.neo4j.storageengine.api.txstate.ReadableTransactionState;
import org.neo4j.storageengine.api.txstate.TxStateVisitor;
Expand Down
Expand Up @@ -26,11 +26,11 @@
import java.util.Set;

import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.internal.diagnostics.DiagnosticsPhase;
import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.kernel.configuration.Config;
import org.neo4j.kernel.impl.transaction.log.files.LogFiles;
import org.neo4j.kernel.impl.transaction.log.files.LogFilesBuilder;
import org.neo4j.kernel.info.DiagnosticsPhase;
import org.neo4j.kernel.internal.KernelDiagnostics;
import org.neo4j.logging.BufferingLog;

Expand Down
Expand Up @@ -21,10 +21,10 @@

import java.io.IOException;

import org.neo4j.internal.diagnostics.DiagnosticsExtractor;
import org.neo4j.internal.diagnostics.DiagnosticsPhase;
import org.neo4j.kernel.impl.transaction.log.entry.LogHeader;
import org.neo4j.kernel.impl.transaction.log.files.LogFiles;
import org.neo4j.kernel.info.DiagnosticsExtractor;
import org.neo4j.kernel.info.DiagnosticsPhase;
import org.neo4j.logging.Logger;

enum DataSourceDiagnostics implements DiagnosticsExtractor<NeoStoreDataSource>
Expand Down
Expand Up @@ -19,8 +19,8 @@
*/
package org.neo4j.kernel;

import org.neo4j.internal.diagnostics.DiagnosticsManager;
import org.neo4j.kernel.impl.factory.DatabaseInfo;
import org.neo4j.kernel.info.DiagnosticsManager;
import org.neo4j.kernel.internal.KernelDiagnostics;
import org.neo4j.kernel.lifecycle.LifecycleAdapter;

Expand Down
Expand Up @@ -29,6 +29,7 @@
import java.util.function.Function;
import java.util.function.Supplier;

import org.neo4j.internal.diagnostics.DiagnosticsManager;
import org.neo4j.graphdb.DependencyResolver;
import org.neo4j.graphdb.ResourceIterator;
import org.neo4j.graphdb.factory.GraphDatabaseSettings;
Expand Down Expand Up @@ -128,7 +129,6 @@
import org.neo4j.kernel.impl.util.monitoring.LogProgressReporter;
import org.neo4j.kernel.impl.util.monitoring.ProgressReporter;
import org.neo4j.kernel.impl.util.watcher.FileSystemWatcherService;
import org.neo4j.kernel.info.DiagnosticsManager;
import org.neo4j.kernel.internal.DatabaseHealth;
import org.neo4j.kernel.internal.TransactionEventHandlers;
import org.neo4j.kernel.lifecycle.LifeSupport;
Expand Down
Expand Up @@ -19,9 +19,9 @@
*/
package org.neo4j.kernel;

import org.neo4j.internal.diagnostics.DiagnosticsExtractor;
import org.neo4j.internal.diagnostics.DiagnosticsPhase;
import org.neo4j.kernel.impl.store.NeoStores;
import org.neo4j.kernel.info.DiagnosticsExtractor;
import org.neo4j.kernel.info.DiagnosticsPhase;
import org.neo4j.logging.Logger;

public enum NeoStoresDiagnostics implements DiagnosticsExtractor<NeoStores>
Expand Down
Expand Up @@ -44,6 +44,8 @@
import org.neo4j.configuration.ConfigOptions;
import org.neo4j.configuration.ConfigValue;
import org.neo4j.configuration.LoadableConfig;
import org.neo4j.internal.diagnostics.DiagnosticsPhase;
import org.neo4j.internal.diagnostics.DiagnosticsProvider;
import org.neo4j.graphdb.config.BaseSetting;
import org.neo4j.graphdb.config.Configuration;
import org.neo4j.graphdb.config.InvalidSettingException;
Expand All @@ -53,8 +55,6 @@
import org.neo4j.helpers.collection.MapUtil;
import org.neo4j.kernel.configuration.HttpConnector.Encryption;
import org.neo4j.kernel.impl.util.CopyOnWriteHashMap;
import org.neo4j.kernel.info.DiagnosticsPhase;
import org.neo4j.kernel.info.DiagnosticsProvider;
import org.neo4j.logging.BufferingLog;
import org.neo4j.logging.Log;
import org.neo4j.logging.Logger;
Expand Down
Expand Up @@ -26,6 +26,7 @@
import java.util.List;
import java.util.function.Supplier;

import org.neo4j.internal.diagnostics.DiagnosticsManager;
import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.helpers.collection.Iterators;
import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector;
Expand Down Expand Up @@ -92,7 +93,6 @@
import org.neo4j.kernel.impl.transaction.state.storeview.NeoStoreIndexStoreView;
import org.neo4j.kernel.impl.util.DependencySatisfier;
import org.neo4j.kernel.impl.util.IdOrderingQueue;
import org.neo4j.kernel.info.DiagnosticsManager;
import org.neo4j.kernel.internal.DatabaseHealth;
import org.neo4j.kernel.lifecycle.Lifecycle;
import org.neo4j.kernel.monitoring.Monitors;
Expand Down
Expand Up @@ -26,6 +26,7 @@
import java.util.Iterator;
import java.util.function.Predicate;

import org.neo4j.internal.diagnostics.DiagnosticsManager;
import org.neo4j.graphdb.config.Setting;
import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.helpers.ArrayUtil;
Expand All @@ -52,7 +53,6 @@
import org.neo4j.kernel.impl.store.id.IdType;
import org.neo4j.kernel.impl.store.kvstore.DataInitializer;
import org.neo4j.kernel.impl.store.record.AbstractBaseRecord;
import org.neo4j.kernel.info.DiagnosticsManager;
import org.neo4j.logging.Log;
import org.neo4j.logging.LogProvider;
import org.neo4j.logging.Logger;
Expand Down
Expand Up @@ -47,13 +47,16 @@
import java.util.TimeZone;
import java.util.stream.Stream;

import org.neo4j.internal.diagnostics.DiagnosticsManager;
import org.neo4j.internal.diagnostics.DiagnosticsPhase;
import org.neo4j.internal.diagnostics.DiagnosticsProvider;
import org.neo4j.io.os.OsBeanUtil;
import org.neo4j.logging.Logger;

import static java.net.NetworkInterface.getNetworkInterfaces;
import static org.neo4j.helpers.Format.bytes;

enum SystemDiagnostics implements DiagnosticsProvider
public enum SystemDiagnostics implements DiagnosticsProvider
{
SYSTEM_MEMORY( "System memory information:" )
{
Expand Down Expand Up @@ -330,7 +333,7 @@ void dump( Logger logger )
this.message = message;
}

static void registerWith( DiagnosticsManager manager )
public static void registerWith( DiagnosticsManager manager )
{
for ( SystemDiagnostics provider : values() )
{
Expand Down
Expand Up @@ -27,12 +27,12 @@
import java.util.List;
import java.util.TimeZone;

import org.neo4j.internal.diagnostics.DiagnosticsPhase;
import org.neo4j.internal.diagnostics.DiagnosticsProvider;
import org.neo4j.helpers.Format;
import org.neo4j.kernel.impl.factory.DatabaseInfo;
import org.neo4j.kernel.impl.store.StoreId;
import org.neo4j.kernel.impl.store.StoreType;
import org.neo4j.kernel.info.DiagnosticsPhase;
import org.neo4j.kernel.info.DiagnosticsProvider;
import org.neo4j.logging.Logger;

public abstract class KernelDiagnostics implements DiagnosticsProvider
Expand Down
Expand Up @@ -24,6 +24,7 @@
import java.util.function.Function;

import org.neo4j.dbms.database.DatabaseManager;
import org.neo4j.internal.diagnostics.DiagnosticsManager;
import org.neo4j.graphdb.DependencyResolver;
import org.neo4j.helpers.collection.Iterables;
import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector;
Expand Down Expand Up @@ -79,7 +80,6 @@
import org.neo4j.kernel.impl.util.UnsatisfiedDependencyException;
import org.neo4j.kernel.impl.util.collection.CollectionsFactorySupplier;
import org.neo4j.kernel.impl.util.watcher.FileSystemWatcherService;
import org.neo4j.kernel.info.DiagnosticsManager;
import org.neo4j.kernel.internal.DatabaseHealth;
import org.neo4j.kernel.internal.TransactionEventHandlers;
import org.neo4j.kernel.monitoring.Monitors;
Expand Down
Expand Up @@ -22,6 +22,7 @@
import java.io.File;
import java.io.IOException;

import org.neo4j.internal.diagnostics.DiagnosticsManager;
import org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory;
import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.graphdb.security.URLAccessRule;
Expand Down Expand Up @@ -59,9 +60,9 @@
import org.neo4j.kernel.impl.util.collection.CollectionsFactorySupplier;
import org.neo4j.kernel.impl.util.collection.OffHeapBlockAllocator;
import org.neo4j.kernel.impl.util.collection.OffHeapCollectionsFactory;
import org.neo4j.kernel.info.DiagnosticsManager;
import org.neo4j.kernel.info.JvmChecker;
import org.neo4j.kernel.info.JvmMetadataRepository;
import org.neo4j.kernel.info.SystemDiagnostics;
import org.neo4j.kernel.internal.KernelEventHandlers;
import org.neo4j.kernel.internal.Version;
import org.neo4j.kernel.internal.locker.GlobalStoreLocker;
Expand Down Expand Up @@ -208,6 +209,7 @@ public PlatformModule( File providedStoreDir, Config config, DatabaseInfo databa

diagnosticsManager = life.add( dependencies
.satisfyDependency( new DiagnosticsManager( logging.getInternalLog( DiagnosticsManager.class ) ) ) );
SystemDiagnostics.registerWith( diagnosticsManager );

dependencies.satisfyDependency( dataSourceManager );

Expand Down

0 comments on commit 49d3b9b

Please sign in to comment.