public EntityIndex load( IndexLocationStrategy locationStrategy ) { EntityIndex index = new EsEntityIndexImpl( provider, indexCache, config, metricsFactory, locationStrategy ); index.initialize(); return index; } } );
@Override public void initializeManagementIndex(){ getManagementIndex().initialize(); } }
@Override public void initializeIndex(){ managerCache.getEntityIndex(applicationScope).initialize(); }
private void handleInitializeApplicationIndex(final AsyncEvent event, final LegacyQueueMessage message) { Preconditions.checkNotNull(message, "Queue Message cannot be null for handleInitializeApplicationIndex"); Preconditions.checkArgument(event instanceof InitializeApplicationIndexEvent, String.format("Event Type for handleInitializeApplicationIndex must be APPLICATION_INDEX, got %s", event.getClass())); final InitializeApplicationIndexEvent initializeApplicationIndexEvent = ( InitializeApplicationIndexEvent ) event; final IndexLocationStrategy indexLocationStrategy = initializeApplicationIndexEvent.getIndexLocationStrategy(); final EntityIndex index = entityIndexFactory.createEntityIndex( indexLocationStrategy ); index.initialize(); }
/** * Generate an observable for our appliation scope */ private Observable<ApplicationScope> getApplications( final Optional<EdgeScope> cursor, final Optional<ApplicationScope> appId ) { //cursor is present use it and skip until we hit that app if (cursor.isPresent()) { final EdgeScope cursorValue = cursor.get(); //we have a cursor and an application scope that was used. return allApplicationsObservable.getData().skipWhile( applicationScope -> !cursorValue.getApplicationScope().equals(applicationScope)); } //this is intentional. If else if (appId.isPresent()) { return Observable.just(appId.get()) .doOnNext(appScope -> { //make sure index is initialized on rebuild entityIndexFactory.createEntityIndex( indexLocationStrategyFactory.getIndexLocationStrategy(appScope) ).initialize(); }); } return allApplicationsObservable.getData() .doOnNext(appScope -> { //make sure index is initialized on rebuild entityIndexFactory.createEntityIndex( indexLocationStrategyFactory.getIndexLocationStrategy(appScope) ).initialize(); }); }