Example #1
0
            public override Lifecycle NewInstance(KernelContext context, SchemaIndexHaIT.IndexProviderDependencies deps)
            {
                PageCache pageCache             = deps.PageCache();
                File      databaseDirectory     = context.Directory();
                DefaultFileSystemAbstraction fs = FileSystemRule.get();

                IndexProvider.Monitor monitor   = IndexProvider.Monitor_Fields.EMPTY;
                Config          config          = deps.Config();
                OperationalMode operationalMode = context.DatabaseInfo().OperationalMode;
                RecoveryCleanupWorkCollector recoveryCleanupWorkCollector = deps.RecoveryCleanupWorkCollector();

                FusionIndexProvider fusionIndexProvider = NativeLuceneFusionIndexProviderFactory20.create(pageCache, databaseDirectory, fs, monitor, config, operationalMode, recoveryCleanupWorkCollector);

                if (InjectLatchPredicate.test(deps.Db()))
                {
                    ControlledIndexProvider provider = new ControlledIndexProvider(fusionIndexProvider);
                    PerDbIndexProvider[deps.Db()] = provider;
                    return(provider);
                }
                else
                {
                    return(fusionIndexProvider);
                }
            }
Example #2
0
        private static bool IsCausalClusterInstance(KernelContext kernelContext)
        {
            OperationalMode thisMode = kernelContext.DatabaseInfo().OperationalMode;

            return(OperationalMode.core.Equals(thisMode) || OperationalMode.read_replica.Equals(thisMode));
        }
Example #3
0
 public override Lifecycle newInstance(KernelContext context, LuceneIndexProviderFactory.Dependencies dependencies)
 {
     return(new LuceneIndexProvider(_outerInstance.fs.get(), _outerInstance.directoryFactory, defaultDirectoryStructure(context.Directory()), IndexProvider.Monitor_Fields.EMPTY, dependencies.Config, context.DatabaseInfo().OperationalMode));
 }
Example #4
0
 public override Lifecycle NewInstance(KernelContext context, Dependencies dependencies)
 {
     return(new LuceneKernelExtension(context.Directory(), dependencies.Config, dependencies.getIndexStore, dependencies.FileSystem(), dependencies.IndexProviders, context.DatabaseInfo().OperationalMode));
 }