Refine search
/** * Configure via explicit declaration the migration path we can follow * @param v1 * @param v2 * @return */ @Singleton @Inject @Provides public VersionedMigrationSet<EdgeMetadataSerialization> getVersions(final EdgeMetadataSerializationV1Impl v1, final EdgeMetadataSerializationV2Impl v2){ //migrate from v1 to v2 MigrationRelationship<EdgeMetadataSerialization> v1Tov2 = new MigrationRelationship<>( v1, v2); //keep our curent tuple, v2, v2 MigrationRelationship<EdgeMetadataSerialization> current = new MigrationRelationship<EdgeMetadataSerialization>( v2, v2 ); //now create our set of versions VersionedMigrationSet<EdgeMetadataSerialization> set = new VersionedMigrationSet<>( v1Tov2, current ); return set; }
/** * Configure via explicit declaration the migration path we can follow */ @Singleton @Inject @Provides public VersionedMigrationSet<MvccLogEntrySerializationStrategy> getVersions( final MvccLogEntrySerializationStrategyV1Impl v1, final MvccLogEntrySerializationStrategyV2Impl v2) { //we must perform a migration from v1 to v3 in order to maintain consistency MigrationRelationship<MvccLogEntrySerializationStrategy> v1Tov2 = new MigrationRelationship<>( v1, v2 ); //note that we MUST migrate to v3 before our next migration, if v4 and v5 is implemented we will need a // v3->v5 and a v4->v5 set MigrationRelationship<MvccLogEntrySerializationStrategy> current = new MigrationRelationship<>( v2, v2 ); //now create our set of versions VersionedMigrationSet<MvccLogEntrySerializationStrategy> set = new VersionedMigrationSet<>( v1Tov2, current ); return set; }
/** * Configure via explicit declaration the migration path we can follow */ @Singleton @Inject @Provides public VersionedMigrationSet<UniqueValueSerializationStrategy> getVersions( final UniqueValueSerializationStrategyV1Impl v1, final UniqueValueSerializationStrategyV2Impl v2) { //we must perform a migration from v1 to v3 in order to maintain consistency MigrationRelationship<UniqueValueSerializationStrategy> v1Tov2 = new MigrationRelationship<>( v1, v2 ); //note that we MUST migrate to v3 before our next migration, if v4 and v5 is implemented we will need a // v3->v5 and a v4->v5 set MigrationRelationship<UniqueValueSerializationStrategy> current = new MigrationRelationship<>( v2, v2 ); //now create our set of versions VersionedMigrationSet<UniqueValueSerializationStrategy> set = new VersionedMigrationSet<>( v1Tov2, current ); return set; } }
@Provides @Inject @AsyncRepair @Singleton public RxTaskScheduler getAsyncRepairScheduler( final AsyncEventsSchedulerFig asyncEventsSchedulerFig ) { final String poolName = asyncEventsSchedulerFig.getRepairPoolName(); final int threadCount = asyncEventsSchedulerFig.getMaxRepairThreads(); final ThreadPoolExecutor executor = TaskExecutorFactory .createTaskExecutor( poolName, threadCount, 0, TaskExecutorFactory.RejectionAction.DROP ); final RxTaskScheduler taskScheduler = new RxTaskSchedulerImpl( executor ); return taskScheduler; }
@Provides @Inject @CollectionExecutorScheduler @Singleton public RxTaskScheduler getRxTaskScheduler( final CollectionSchedulerFig collectionSchedulerFig ){ final String poolName = collectionSchedulerFig.getIoSchedulerName(); final int threadCount = collectionSchedulerFig.getMaxIoThreads(); final ThreadPoolExecutor executor = TaskExecutorFactory.createTaskExecutor( poolName, threadCount, 0, TaskExecutorFactory.RejectionAction.CALLERRUNS ); final RxTaskScheduler taskScheduler = new RxTaskSchedulerImpl(executor ); return taskScheduler; }
@Provides @Inject @EventExecutionScheduler @Singleton public RxTaskScheduler getSqsTaskScheduler( final AsyncEventsSchedulerFig asyncEventsSchedulerFig ) { final String poolName = asyncEventsSchedulerFig.getIoSchedulerName(); final int threadCount = asyncEventsSchedulerFig.getMaxIoThreads(); final ThreadPoolExecutor executor = TaskExecutorFactory .createTaskExecutor( poolName, threadCount, threadCount, TaskExecutorFactory.RejectionAction.CALLERRUNS ); final RxTaskScheduler taskScheduler = new RxTaskSchedulerImpl( executor ); return taskScheduler; }
@Provides @Inject @ResponseImportTasks @Singleton public RxTaskScheduler getResponseImportScheduler(final ServiceSchedulerFig serviceSchedulerFig ) { final String poolName = serviceSchedulerFig.getRepairPoolName(); final int threadCount = serviceSchedulerFig.getImportThreadPoolSize(); final ThreadPoolExecutor executor = TaskExecutorFactory .createTaskExecutor( poolName, threadCount, 0, TaskExecutorFactory.RejectionAction.CALLERRUNS ); final RxTaskScheduler taskScheduler = new RxTaskSchedulerImpl( executor ); return taskScheduler; } }
/** * Configure via explicit declaration the migration path we can follow */ @Singleton @Inject @Provides public VersionedMigrationSet<MvccEntitySerializationStrategy> getVersions( final MvccEntitySerializationStrategyV1Impl v1, final MvccEntitySerializationStrategyV2Impl v2, final MvccEntitySerializationStrategyV3Impl v3 ) { //we must perform a migration from v1 to v3 in order to maintain consistency MigrationRelationship<MvccEntitySerializationStrategy> v1Tov3 = new MigrationRelationship<>( v1, v3 ); //we must migrate from 2 to 3, this is a bridge that must happen to maintain data consistency MigrationRelationship<MvccEntitySerializationStrategy> v2Tov3 = new MigrationRelationship<>( v2, v3 ); //note that we MUST migrate to v3 before our next migration, if v4 and v5 is implemented we will need a // v3->v5 and a v4->v5 set MigrationRelationship<MvccEntitySerializationStrategy> current = new MigrationRelationship<>( v3, v3 ); //now create our set of versions VersionedMigrationSet<MvccEntitySerializationStrategy> set = new VersionedMigrationSet<>( v1Tov3, v2Tov3, current ); return set; }
@Provides @Singleton public WarningCollectorFactory createWarningCollectorFactory(WarningCollectorConfig config, TestingWarningCollectorConfig testConfig) { requireNonNull(config, "config is null"); requireNonNull(testConfig, "testConfig is null"); return () -> new TestingWarningCollector(config, testConfig); } }