Skip to content

Commit

Permalink
Remove RebuildingIndexDescriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
fickludd authored and ragadeeshu committed May 21, 2018
1 parent ea0ed74 commit 925b732
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 46 deletions.
Expand Up @@ -248,7 +248,7 @@ public void start()
// do it at one point after recovery... i.e. here // do it at one point after recovery... i.e. here
indexMapRef.indexMapSnapshot().forEachIndexProxy( indexProxyOperation( "refresh", IndexProxy::refresh ) ); indexMapRef.indexMapSnapshot().forEachIndexProxy( indexProxyOperation( "refresh", IndexProxy::refresh ) );


final MutableLongObjectMap<RebuildingIndexDescriptor> rebuildingDescriptors = new LongObjectHashMap<>(); final MutableLongObjectMap<StoreIndexDescriptor> rebuildingDescriptors = new LongObjectHashMap<>();
indexMapRef.modify( indexMap -> indexMapRef.modify( indexMap ->
{ {
Map<InternalIndexState, List<IndexLogRecord>> indexStates = new EnumMap<>( InternalIndexState.class ); Map<InternalIndexState, List<IndexLogRecord>> indexStates = new EnumMap<>( InternalIndexState.class );
Expand All @@ -268,8 +268,7 @@ public void start()
break; break;
case POPULATING: case POPULATING:
// Remember for rebuilding // Remember for rebuilding
rebuildingDescriptors.put( indexId, rebuildingDescriptors.put( indexId, descriptor );
new RebuildingIndexDescriptor( descriptor ) );
break; break;
case FAILED: case FAILED:
// Don't do anything, the user needs to drop the index and re-create // Don't do anything, the user needs to drop the index and re-create
Expand All @@ -289,7 +288,7 @@ public void start()
IndexPopulationJob populationJob = newIndexPopulationJob(); IndexPopulationJob populationJob = newIndexPopulationJob();
rebuildingDescriptors.forEachKeyValue( ( indexId, descriptor ) -> rebuildingDescriptors.forEachKeyValue( ( indexId, descriptor ) ->
{ {
IndexProxy proxy = indexProxyCreator.createPopulatingIndexProxy( descriptor.getIndexDescriptor(), IndexProxy proxy = indexProxyCreator.createPopulatingIndexProxy( descriptor,
false, // never pass through a tentative online state during recovery false, // never pass through a tentative online state during recovery
monitor, monitor,
populationJob ); populationJob );
Expand All @@ -310,7 +309,7 @@ public void start()
// This is why we now go and wait for those indexes to be fully populated. // This is why we now go and wait for those indexes to be fully populated.
rebuildingDescriptors.forEachKeyValue( ( indexId, descriptor ) -> rebuildingDescriptors.forEachKeyValue( ( indexId, descriptor ) ->
{ {
if ( descriptor.getIndexDescriptor().type() != IndexDescriptor.Type.UNIQUE ) if ( descriptor.type() != IndexDescriptor.Type.UNIQUE )
{ {
// It's not a uniqueness constraint, so don't wait for it to be rebuilt // It's not a uniqueness constraint, so don't wait for it to be rebuilt
return; return;
Expand All @@ -327,7 +326,7 @@ public void start()
"What? This index was seen during recovery just now, why isn't it available now?", e ); "What? This index was seen during recovery just now, why isn't it available now?", e );
} }


monitor.awaitingPopulationOfRecoveredIndex( descriptor.getIndexDescriptor() ); monitor.awaitingPopulationOfRecoveredIndex( descriptor );
awaitOnline( proxy ); awaitOnline( proxy );
} ); } );


Expand Down

This file was deleted.

0 comments on commit 925b732

Please sign in to comment.