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
indexMapRef.indexMapSnapshot().forEachIndexProxy( indexProxyOperation( "refresh", IndexProxy::refresh ) );

final MutableLongObjectMap<RebuildingIndexDescriptor> rebuildingDescriptors = new LongObjectHashMap<>();
final MutableLongObjectMap<StoreIndexDescriptor> rebuildingDescriptors = new LongObjectHashMap<>();
indexMapRef.modify( indexMap ->
{
Map<InternalIndexState, List<IndexLogRecord>> indexStates = new EnumMap<>( InternalIndexState.class );
Expand All @@ -268,8 +268,7 @@ public void start()
break;
case POPULATING:
// Remember for rebuilding
rebuildingDescriptors.put( indexId,
new RebuildingIndexDescriptor( descriptor ) );
rebuildingDescriptors.put( indexId, descriptor );
break;
case FAILED:
// 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();
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
monitor,
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.
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
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 );
}

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

Expand Down

This file was deleted.

0 comments on commit 925b732

Please sign in to comment.