Exemple #1
0
  Config(
      AbstractGraphDatabase graphDb,
      StoreId storeId,
      Map<String, String> inputParams,
      KernelPanicEventGenerator kpe,
      TxModule txModule,
      LockManager lockManager,
      LockReleaser lockReleaser,
      IdGeneratorFactory idGeneratorFactory,
      TxEventSyncHookFactory txSyncHookFactory,
      RelationshipTypeCreator relTypeCreator,
      TxIdGenerator txIdGenerator,
      LastCommittedTxIdSetter lastCommittedTxIdSetter,
      FileSystemAbstraction fileSystem) {
    this.kpe = kpe;
    this.storeDir = graphDb.getStoreDir();
    this.inputParams = inputParams;
    this.ephemeral = graphDb.isEphemeral();
    // Get the default params and override with the user supplied values
    this.params = getDefaultParams();
    this.params.putAll(inputParams);

    this.idGeneratorFactory = idGeneratorFactory;
    this.relTypeCreator = relTypeCreator;
    this.txIdGenerator = txIdGenerator;
    this.txModule = txModule;
    this.lockManager = lockManager;
    this.lockReleaser = lockReleaser;
    this.idGeneratorModule = new IdGeneratorModule(new IdGenerator());
    this.readOnly = Boolean.parseBoolean((String) params.get(READ_ONLY));
    this.backupSlave = Boolean.parseBoolean((String) params.get(BACKUP_SLAVE));
    this.syncHookFactory = txSyncHookFactory;
    this.persistenceModule = new PersistenceModule();
    this.cacheManager = new AdaptiveCacheManager();
    this.params.put(FileSystemAbstraction.class, fileSystem);
    graphDbModule =
        new GraphDbModule(
            graphDb,
            cacheManager,
            lockManager,
            txModule.getTxManager(),
            idGeneratorModule.getIdGenerator(),
            readOnly);
    indexStore = new IndexStore(storeDir, fileSystem);
    params.put(IndexStore.class, indexStore);

    if (storeId != null) params.put(StoreId.class, storeId);
    params.put(IdGeneratorFactory.class, idGeneratorFactory);
    params.put(TxIdGenerator.class, txIdGenerator);
    params.put(TransactionManager.class, txModule.getTxManager());
    params.put(LastCommittedTxIdSetter.class, lastCommittedTxIdSetter);
    params.put(GraphDbModule.class, graphDbModule);
    params.put(TxHook.class, txModule.getTxHook());
    params.put(StringLogger.class, graphDb.getMessageLog());
    params.put(
        DiagnosticsManager.class,
        this.diagnostics = new DiagnosticsManager(graphDb.getMessageLog()));
    diagnostics.appendProvider(this);
  }
Exemple #2
0
 @Override
 public String extract(String providerId) {
   StringBuffer result = new StringBuffer();
   diagnostics.extract(providerId, StringLogger.wrap(result));
   return result.toString();
 }
Exemple #3
0
 @Override
 public String dumpAll() {
   StringBuffer result = new StringBuffer();
   diagnostics.dumpAll(StringLogger.wrap(result));
   return result.toString();
 }
Exemple #4
0
 @Override
 public void dumpToLog(String providerId) {
   diagnostics.dump(providerId);
 }
Exemple #5
0
 @Override
 public void dumpToLog() {
   diagnostics.dumpAll();
 }
 public void registerDiagnosticsWith(DiagnosticsManager manager) {
   manager.registerAll(Diagnostics.class, this);
 }
 static void register(
     DiagnosticsManager manager, InternalAbstractGraphDatabase graphdb, NeoStoreXaDataSource ds) {
   manager.prependProvider(new Versions(graphdb.getClass(), ds));
   ds.registerDiagnosticsWith(manager);
   manager.appendProvider(new StoreFiles(graphdb.getStoreDir()));
 }