Ejemplo n.º 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);
  }
Ejemplo n.º 2
0
 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()));
 }