Github user GERey commented on a diff in the pull request:
https://github.com/apache/incubator-usergrid/pull/248#discussion_r30658328
--- Diff:
stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
---
@@ -70,60 +79,228 @@
@Inject
public ReIndexServiceImpl( final AllEntityIdsObservable
allEntityIdsObservable,
final MapManagerFactory mapManagerFactory,
- final AllApplicationsObservable
allApplicationsObservable, final IndexProcessorFig indexProcessorFig,
- final RxTaskScheduler rxTaskScheduler,
final AsyncEventService indexService ) {
+ final AllApplicationsObservable
allApplicationsObservable,
+ final IndexProcessorFig indexProcessorFig,
final AsyncEventService indexService ) {
this.allEntityIdsObservable = allEntityIdsObservable;
this.allApplicationsObservable = allApplicationsObservable;
this.indexProcessorFig = indexProcessorFig;
- this.rxTaskScheduler = rxTaskScheduler;
this.indexService = indexService;
- this.mapManager = mapManagerFactory.createMapManager(
RESUME_MAP_SCOPTE );
+ this.mapManager = mapManagerFactory.createMapManager(
RESUME_MAP_SCOPE );
}
-
@Override
- public IndexResponse rebuildIndex( final Optional<UUID> appId, final
Optional<String> collection,
- final Optional<String>
collectionName, final Optional<String> cursor,
- final Optional<Long> startTimestamp
) {
+ public ReIndexStatus rebuildIndex( final ReIndexRequestBuilder
reIndexRequestBuilder ) {
//load our last emitted Scope if a cursor is present
- if ( cursor.isPresent() ) {
- throw new UnsupportedOperationException( "Build this" );
- }
+ final Optional<EdgeScope> cursor = parseCursor(
reIndexRequestBuilder.getCursor() );
+
+
+ final CursorSeek<Edge> cursorSeek = getResumeEdge( cursor );
+
+ final Optional<ApplicationScope> appId =
reIndexRequestBuilder.getApplicationScope();
- final Observable<ApplicationScope> applicationScopes =
appId.isPresent()? Observable.just( getApplicationScope(appId.get()) ) :
allApplicationsObservable.getData();
- final String newCursor = StringUtils.sanitizeUUID(
UUIDGenerator.newTimeUUID() );
+ Preconditions.checkArgument( !(cursor.isPresent() &&
appId.isPresent()),
--- End diff --
Why not catch this in the builder?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---