Search in sources :

Example 1 with SYSTEM

use of org.neo4j.common.Subject.SYSTEM in project neo4j by neo4j.

the class IndexingService method populateIndexesOfAllTypes.

private void populateIndexesOfAllTypes(MutableLongObjectMap<IndexDescriptor> rebuildingDescriptors, IndexMap indexMap) {
    Map<EntityType, MutableLongObjectMap<IndexDescriptor>> rebuildingDescriptorsByType = new EnumMap<>(EntityType.class);
    for (IndexDescriptor descriptor : rebuildingDescriptors) {
        rebuildingDescriptorsByType.computeIfAbsent(descriptor.schema().entityType(), type -> new LongObjectHashMap<>()).put(descriptor.getId(), descriptor);
    }
    for (Map.Entry<EntityType, MutableLongObjectMap<IndexDescriptor>> descriptorToPopulate : rebuildingDescriptorsByType.entrySet()) {
        IndexPopulationJob populationJob = newIndexPopulationJob(descriptorToPopulate.getKey(), false, SYSTEM);
        populate(descriptorToPopulate.getValue(), indexMap, populationJob);
    }
}
Also used : EntityType(org.neo4j.common.EntityType) LifecycleAdapter(org.neo4j.kernel.lifecycle.LifecycleAdapter) Arrays(java.util.Arrays) ResourceIterator(org.neo4j.graphdb.ResourceIterator) Log(org.neo4j.logging.Log) CursorContext(org.neo4j.io.pagecache.context.CursorContext) TokenNameLookup(org.neo4j.common.TokenNameLookup) IndexPopulator(org.neo4j.kernel.api.index.IndexPopulator) LongObjectProcedure(org.eclipse.collections.api.block.procedure.primitive.LongObjectProcedure) UnaryOperator(java.util.function.UnaryOperator) Config(org.neo4j.configuration.Config) Value(org.neo4j.values.storable.Value) Preconditions(org.neo4j.util.Preconditions) IndexStatisticsStore(org.neo4j.kernel.impl.api.index.stats.IndexStatisticsStore) UnderlyingStorageException(org.neo4j.exceptions.UnderlyingStorageException) IndexUpdater(org.neo4j.kernel.api.index.IndexUpdater) IndexNotFoundKernelException(org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException) IndexPopulationFailedKernelException(org.neo4j.kernel.api.exceptions.index.IndexPopulationFailedKernelException) LongHashSet(org.eclipse.collections.impl.set.mutable.primitive.LongHashSet) Map(java.util.Map) LongIterable(org.eclipse.collections.api.LongIterable) PageCacheTracer(org.neo4j.io.pagecache.tracing.PageCacheTracer) IndexProviderDescriptor(org.neo4j.internal.schema.IndexProviderDescriptor) Path(java.nio.file.Path) EnumMap(java.util.EnumMap) SYSTEM(org.neo4j.common.Subject.SYSTEM) Collection(java.util.Collection) Set(java.util.Set) IndexEntryUpdate(org.neo4j.storageengine.api.IndexEntryUpdate) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) UncheckedIOException(java.io.UncheckedIOException) List(java.util.List) EntityType(org.neo4j.common.EntityType) IndexPrototype(org.neo4j.internal.schema.IndexPrototype) FAILED(org.neo4j.internal.kernel.api.InternalIndexState.FAILED) IndexDescriptor(org.neo4j.internal.schema.IndexDescriptor) MutableBoolean(org.apache.commons.lang3.mutable.MutableBoolean) DatabaseReadOnlyChecker(org.neo4j.configuration.helpers.DatabaseReadOnlyChecker) NODE(org.neo4j.common.EntityType.NODE) Iterators.asResourceIterator(org.neo4j.internal.helpers.collection.Iterators.asResourceIterator) GraphDatabaseSettings(org.neo4j.configuration.GraphDatabaseSettings) InternalIndexState(org.neo4j.internal.kernel.api.InternalIndexState) IndexSamplingController(org.neo4j.kernel.impl.api.index.sampling.IndexSamplingController) LogProvider(org.neo4j.logging.LogProvider) HashMap(java.util.HashMap) MutableLongObjectMap(org.eclipse.collections.api.map.primitive.MutableLongObjectMap) Iterators.iterator(org.neo4j.internal.helpers.collection.Iterators.iterator) IndexProvider(org.neo4j.kernel.api.index.IndexProvider) ArrayList(java.util.ArrayList) IndexEntryConflictException(org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException) LongObjectHashMap(org.eclipse.collections.impl.map.mutable.primitive.LongObjectHashMap) ThrowingConsumer(org.neo4j.function.ThrowingConsumer) POPULATING(org.neo4j.internal.kernel.api.InternalIndexState.POPULATING) IndexPopulationFailure.failure(org.neo4j.kernel.impl.api.index.IndexPopulationFailure.failure) ONLINE(org.neo4j.internal.kernel.api.InternalIndexState.ONLINE) IndexStoreViewFactory(org.neo4j.kernel.impl.transaction.state.storeview.IndexStoreViewFactory) JobScheduler(org.neo4j.scheduler.JobScheduler) MemoryTracker(org.neo4j.memory.MemoryTracker) NodePropertyAccessor(org.neo4j.storageengine.api.NodePropertyAccessor) IndexUpdateListener(org.neo4j.storageengine.api.IndexUpdateListener) Subject(org.neo4j.common.Subject) Iterators(org.neo4j.internal.helpers.collection.Iterators) IndexSamplingMode(org.neo4j.kernel.impl.api.index.sampling.IndexSamplingMode) Iterables.asList(org.neo4j.internal.helpers.collection.Iterables.asList) IOException(java.io.IOException) IndexActivationFailedKernelException(org.neo4j.kernel.api.exceptions.index.IndexActivationFailedKernelException) RELATIONSHIP(org.neo4j.common.EntityType.RELATIONSHIP) MutableLongSet(org.eclipse.collections.api.set.primitive.MutableLongSet) TimeUnit(java.util.concurrent.TimeUnit) KernelException(org.neo4j.exceptions.KernelException) StringJoiner(java.util.StringJoiner) UniquePropertyValueValidationException(org.neo4j.kernel.api.exceptions.schema.UniquePropertyValueValidationException) SchemaState(org.neo4j.internal.schema.SchemaState) LongSet(org.eclipse.collections.api.set.primitive.LongSet) LongObjectHashMap(org.eclipse.collections.impl.map.mutable.primitive.LongObjectHashMap) MutableLongObjectMap(org.eclipse.collections.api.map.primitive.MutableLongObjectMap) IndexDescriptor(org.neo4j.internal.schema.IndexDescriptor) EnumMap(java.util.EnumMap) Map(java.util.Map) EnumMap(java.util.EnumMap) HashMap(java.util.HashMap) MutableLongObjectMap(org.eclipse.collections.api.map.primitive.MutableLongObjectMap) LongObjectHashMap(org.eclipse.collections.impl.map.mutable.primitive.LongObjectHashMap)

Aggregations

IOException (java.io.IOException)1 UncheckedIOException (java.io.UncheckedIOException)1 String.format (java.lang.String.format)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 EnumMap (java.util.EnumMap)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 StringJoiner (java.util.StringJoiner)1 TimeUnit (java.util.concurrent.TimeUnit)1 UnaryOperator (java.util.function.UnaryOperator)1 Collectors (java.util.stream.Collectors)1 MutableBoolean (org.apache.commons.lang3.mutable.MutableBoolean)1 LongIterable (org.eclipse.collections.api.LongIterable)1 LongObjectProcedure (org.eclipse.collections.api.block.procedure.primitive.LongObjectProcedure)1 MutableLongObjectMap (org.eclipse.collections.api.map.primitive.MutableLongObjectMap)1