Skip to content

Commit b1168c4

Browse files
committedDec 16, 2024··
Merge remote-tracking branch 'origin/9.0' into task/schema-postgresql
2 parents 7e15553 + f0c6111 commit b1168c4

File tree

144 files changed

+6947
-1979
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+6947
-1979
lines changed
 

‎Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphTableNames.php

-5
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,4 @@ public function contentStream(): string
5151
{
5252
return $this->tableNamePrefix . '_contentstream';
5353
}
54-
55-
public function checkpoint(): string
56-
{
57-
return $this->tableNamePrefix . '_checkpoint';
58-
}
5954
}

‎Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php

+2-63
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@
5959
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPublished;
6060
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event\WorkspaceRebaseFailed;
6161
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event\WorkspaceWasRebased;
62-
use Neos\ContentRepository\Core\Infrastructure\DbalCheckpointStorage;
6362
use Neos\ContentRepository\Core\Infrastructure\DbalSchemaDiff;
6463
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
65-
use Neos\ContentRepository\Core\Projection\CheckpointStorageStatusType;
6664
use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphProjectionInterface;
6765
use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphReadModelInterface;
6866
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTags;
@@ -73,7 +71,6 @@
7371
use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
7472
use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName;
7573
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
76-
use Neos\EventStore\Model\Event\SequenceNumber;
7774
use Neos\EventStore\Model\EventEnvelope;
7875

7976
/**
@@ -91,20 +88,13 @@ final class DoctrineDbalContentGraphProjection implements ContentGraphProjection
9188

9289
public const RELATION_DEFAULT_OFFSET = 128;
9390

94-
private DbalCheckpointStorage $checkpointStorage;
95-
9691
public function __construct(
9792
private readonly Connection $dbal,
9893
private readonly ProjectionContentGraph $projectionContentGraph,
9994
private readonly ContentGraphTableNames $tableNames,
10095
private readonly DimensionSpacePointsRepository $dimensionSpacePointsRepository,
10196
private readonly ContentGraphReadModelInterface $contentGraphReadModel
10297
) {
103-
$this->checkpointStorage = new DbalCheckpointStorage(
104-
$this->dbal,
105-
$this->tableNames->checkpoint(),
106-
self::class
107-
);
10898
}
10999

110100
public function setUp(): void
@@ -118,18 +108,10 @@ public function setUp(): void
118108
throw new \RuntimeException(sprintf('Failed to setup projection %s: %s', self::class, $e->getMessage()), 1716478255, $e);
119109
}
120110
}
121-
$this->checkpointStorage->setUp();
122111
}
123112

124113
public function status(): ProjectionStatus
125114
{
126-
$checkpointStorageStatus = $this->checkpointStorage->status();
127-
if ($checkpointStorageStatus->type === CheckpointStorageStatusType::ERROR) {
128-
return ProjectionStatus::error($checkpointStorageStatus->details);
129-
}
130-
if ($checkpointStorageStatus->type === CheckpointStorageStatusType::SETUP_REQUIRED) {
131-
return ProjectionStatus::setupRequired($checkpointStorageStatus->details);
132-
}
133115
try {
134116
$this->dbal->connect();
135117
} catch (\Throwable $e) {
@@ -147,59 +129,16 @@ public function status(): ProjectionStatus
147129
return ProjectionStatus::ok();
148130
}
149131

150-
public function reset(): void
132+
public function resetState(): void
151133
{
152134
$this->truncateDatabaseTables();
153-
154-
$this->checkpointStorage->acquireLock();
155-
$this->checkpointStorage->updateAndReleaseLock(SequenceNumber::none());
156-
}
157-
158-
public function getCheckpointStorage(): DbalCheckpointStorage
159-
{
160-
return $this->checkpointStorage;
161135
}
162136

163137
public function getState(): ContentGraphReadModelInterface
164138
{
165139
return $this->contentGraphReadModel;
166140
}
167141

168-
public function canHandle(EventInterface $event): bool
169-
{
170-
return in_array($event::class, [
171-
ContentStreamWasClosed::class,
172-
ContentStreamWasCreated::class,
173-
ContentStreamWasForked::class,
174-
ContentStreamWasRemoved::class,
175-
ContentStreamWasReopened::class,
176-
DimensionShineThroughWasAdded::class,
177-
DimensionSpacePointWasMoved::class,
178-
NodeAggregateNameWasChanged::class,
179-
NodeAggregateTypeWasChanged::class,
180-
NodeAggregateWasMoved::class,
181-
NodeAggregateWasRemoved::class,
182-
NodeAggregateWithNodeWasCreated::class,
183-
NodeGeneralizationVariantWasCreated::class,
184-
NodePeerVariantWasCreated::class,
185-
NodePropertiesWereSet::class,
186-
NodeReferencesWereSet::class,
187-
NodeSpecializationVariantWasCreated::class,
188-
RootNodeAggregateDimensionsWereUpdated::class,
189-
RootNodeAggregateWithNodeWasCreated::class,
190-
RootWorkspaceWasCreated::class,
191-
SubtreeWasTagged::class,
192-
SubtreeWasUntagged::class,
193-
WorkspaceBaseWorkspaceWasChanged::class,
194-
WorkspaceRebaseFailed::class,
195-
WorkspaceWasCreated::class,
196-
WorkspaceWasDiscarded::class,
197-
WorkspaceWasPublished::class,
198-
WorkspaceWasRebased::class,
199-
WorkspaceWasRemoved::class,
200-
]) || $event instanceof EmbedsContentStreamId;
201-
}
202-
203142
public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void
204143
{
205144
match ($event::class) {
@@ -232,7 +171,7 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void
232171
WorkspaceWasPublished::class => $this->whenWorkspaceWasPublished($event),
233172
WorkspaceWasRebased::class => $this->whenWorkspaceWasRebased($event),
234173
WorkspaceWasRemoved::class => $this->whenWorkspaceWasRemoved($event),
235-
default => $event instanceof EmbedsContentStreamId || throw new \InvalidArgumentException(sprintf('Unsupported event %s', get_debug_type($event))),
174+
default => null,
236175
};
237176
if (
238177
$event instanceof EmbedsContentStreamId

0 commit comments

Comments
 (0)
Please sign in to comment.