From 925b732397249874172fe1f07267775b63c02856 Mon Sep 17 00:00:00 2001 From: fickludd Date: Thu, 17 May 2018 15:25:21 +0200 Subject: [PATCH] Remove RebuildingIndexDescriptor --- .../impl/api/index/IndexingService.java | 11 +++-- .../api/index/RebuildingIndexDescriptor.java | 40 ------------------- 2 files changed, 5 insertions(+), 46 deletions(-) delete mode 100644 community/kernel/src/main/java/org/neo4j/kernel/impl/api/index/RebuildingIndexDescriptor.java diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/index/IndexingService.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/index/IndexingService.java index fbb1e8401cafb..38727300df76f 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/index/IndexingService.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/index/IndexingService.java @@ -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 rebuildingDescriptors = new LongObjectHashMap<>(); + final MutableLongObjectMap rebuildingDescriptors = new LongObjectHashMap<>(); indexMapRef.modify( indexMap -> { Map> indexStates = new EnumMap<>( InternalIndexState.class ); @@ -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 @@ -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 ); @@ -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; @@ -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 ); } ); diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/index/RebuildingIndexDescriptor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/index/RebuildingIndexDescriptor.java deleted file mode 100644 index a7914b4d37c30..0000000000000 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/index/RebuildingIndexDescriptor.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2002-2018 "Neo4j," - * Neo4j Sweden AB [http://neo4j.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.kernel.impl.api.index; - -import org.neo4j.kernel.api.schema.index.StoreIndexDescriptor; - -/** - * Small class for holding a bunch of information about an index that we need to rebuild during recovery. - */ -public class RebuildingIndexDescriptor -{ - private final StoreIndexDescriptor schemaIndexDescriptor; - - RebuildingIndexDescriptor( StoreIndexDescriptor schemaIndexDescriptor ) - { - this.schemaIndexDescriptor = schemaIndexDescriptor; - } - - public StoreIndexDescriptor getIndexDescriptor() - { - return schemaIndexDescriptor; - } -}