}
TaskArtifactStateRepository createTaskArtifactStateRepository(Instantiator instantiator, TaskArtifactStateCacheAccess cacheAccess, StartParameter startParameter, FileSnapshotter fileSnapshotter) {
FileCollectionSnapshotter fileCollectionSnapshotter = new DefaultFileCollectionSnapshotter(fileSnapshotter, cacheAccess);
FileCollectionSnapshotter outputFilesSnapshotter = new OutputFilesCollectionSnapshotter(fileCollectionSnapshotter, new RandomLongIdGenerator(), cacheAccess);
SerializerRegistry<FileCollectionSnapshot> serializerRegistry = new DefaultSerializerRegistry<FileCollectionSnapshot>();
fileCollectionSnapshotter.registerSerializers(serializerRegistry);
outputFilesSnapshotter.registerSerializers(serializerRegistry);
TaskHistoryRepository taskHistoryRepository = new CacheBackedTaskHistoryRepository(cacheAccess,
new CacheBackedFileSnapshotRepository(cacheAccess,
serializerRegistry.build(),
new RandomLongIdGenerator()));
return new ShortCircuitTaskArtifactStateRepository(
startParameter,
instantiator,
new DefaultTaskArtifactStateRepository(