Skip to content

Commit

Permalink
FEATURE: Overhaul ContentCacheFlusher
Browse files Browse the repository at this point in the history
  • Loading branch information
dlubitz committed Aug 27, 2024
1 parent c40e88b commit 251fc1b
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception as DBALException;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature\NodeMove;
use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature\NodeRemoval;
use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature\NodeVariation;
Expand Down Expand Up @@ -43,6 +42,8 @@
use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTags;
use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasTagged;
use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasUntagged;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasDiscarded;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPartiallyDiscarded;
use Neos\ContentRepository\Core\Infrastructure\DbalCheckpointStorage;
use Neos\ContentRepository\Core\Infrastructure\DbalSchemaDiff;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
Expand All @@ -58,8 +59,6 @@
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\EventStore\Model\Event\SequenceNumber;
use Neos\EventStore\Model\EventEnvelope;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasDiscarded;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPartiallyDiscarded;

/**
* @implements ProjectionInterface<ContentGraphFinder>
Expand Down Expand Up @@ -930,8 +929,7 @@ private function getRelationPositionAfterRecalculation(

usort(
$hierarchyRelations,
static fn (HierarchyRelation $relationA, HierarchyRelation $relationB): int
=> $relationA->position <=> $relationB->position
static fn (HierarchyRelation $relationA, HierarchyRelation $relationB): int => $relationA->position <=> $relationB->position
);

foreach ($hierarchyRelations as $relation) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<?php

declare(strict_types=1);

namespace Neos\Neos\Fusion\Cache;

use Neos\Media\Domain\Model\AssetInterface;
use Neos\Media\Domain\Model\AssetVariantInterface;
use Neos\Neos\AssetUsage\Dto\AssetUsageFilter;
use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate;
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds;
use Neos\Neos\AssetUsage\GlobalAssetUsageService;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Flow\Persistence\PersistenceManagerInterface;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate;
use Neos\ContentRepository\Core\ContentRepository;
use Neos\Media\Domain\Model\AssetInterface;
use Neos\Media\Domain\Model\AssetVariantInterface;
use Neos\Neos\AssetUsage\Dto\AssetUsageFilter;
use Neos\Neos\AssetUsage\GlobalAssetUsageService;

class AssetChangeHandlerForCacheFlushing
{
Expand Down
9 changes: 5 additions & 4 deletions Neos.Neos/Classes/Fusion/Cache/FlushNodeAggregateRequest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php

declare(strict_types=1);

namespace Neos\Neos\Fusion\Cache;

use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;

final readonly class FlushNodeAggregateRequest
{
Expand Down
8 changes: 3 additions & 5 deletions Neos.Neos/Classes/Fusion/Cache/FlushWorkspaceRequest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?php

declare(strict_types=1);

namespace Neos\Neos\Fusion\Cache;

use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;

final readonly class FlushWorkspaceRequest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Neos\Neos\Fusion\Cache;

/*
Expand All @@ -17,14 +19,14 @@
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId;
use Neos\ContentRepository\Core\Feature\NodeMove\Event\NodeAggregateWasMoved;
use Neos\ContentRepository\Core\Feature\NodeRemoval\Event\NodeAggregateWasRemoved;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasDiscarded;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPartiallyDiscarded;
use Neos\ContentRepository\Core\Projection\CatchUpHookInterface;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\EventStore\Model\EventEnvelope;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasDiscarded;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPartiallyDiscarded;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate;

/**
* Also contains a pragmatic performance booster for some "batch" operations, where the cache flushing
Expand Down
3 changes: 1 addition & 2 deletions Neos.Neos/Classes/Fusion/Cache/NodeCacheEntryIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@

namespace Neos\Neos\Fusion\Cache;

use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\Flow\Annotations as Flow;
use Neos\Cache\CacheAwareInterface;
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
use Neos\Flow\Annotations as Flow;

/**
* The cache entry identifier data transfer object for nodes
Expand Down
3 changes: 1 addition & 2 deletions Neos.Neos/Classes/Fusion/Helper/CachingHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
use Neos\ContentRepository\Core\Projection\ContentGraph\Nodes;
use Neos\ContentRepository\Core\Projection\Workspace\Workspace;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Eel\ProtectedContextAwareInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Neos\Fusion\Cache\NodeCacheEntryIdentifier;
use Neos\Neos\Fusion\Cache\CacheTag;
use Neos\Neos\Fusion\Cache\CacheTagSet;
use Neos\Neos\Fusion\Cache\CacheTagWorkspaceName;
use Neos\Neos\Fusion\Cache\NodeCacheEntryIdentifier;

/**
* Caching helper to make cache tag generation easier.
Expand Down
10 changes: 5 additions & 5 deletions Neos.Neos/Classes/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
use Neos\Flow\Mvc\Routing\RouterCachingService;
use Neos\Flow\Package\Package as BasePackage;
use Neos\Flow\Persistence\Doctrine\PersistenceManager;
use Neos\Flow\Persistence\PersistenceManagerInterface;
use Neos\Flow\Security\Authentication\AuthenticationProviderManager;
use Neos\Fusion\Core\Cache\ContentCache;
use Neos\Media\Domain\Model\AssetInterface;
use Neos\Media\Domain\Service\AssetService;
use Neos\Neos\AssetUsage\GlobalAssetUsageService;
use Neos\Neos\Controller\Backend\ContentController;
use Neos\Neos\Domain\Model\Site;
use Neos\Neos\Domain\Service\SiteService;
use Neos\Neos\Fusion\Cache\AssetChangeHandlerForCacheFlushing;
use Neos\Neos\Routing\Cache\RouteCacheFlusher;
use Neos\Fusion\Core\Cache\ContentCache;
use Neos\Neos\Service\EditorContentStreamZookeeper;
use Neos\Media\Domain\Model\AssetInterface;
use Neos\Neos\AssetUsage\GlobalAssetUsageService;
use Neos\Flow\Persistence\PersistenceManagerInterface;
use Neos\Neos\Fusion\Cache\AssetChangeHandlerForCacheFlushing;

/**
* The Neos Package
Expand Down

0 comments on commit 251fc1b

Please sign in to comment.