Search in sources :

Example 1 with CommitsLoadResult

use of com.enonic.xp.dump.CommitsLoadResult in project xp by enonic.

the class AbstractDumpReader method loadCommits.

@Override
public CommitsLoadResult loadCommits(final RepositoryId repositoryId, final LineProcessor<EntryLoadResult> processor) {
    final PathRef tarFile = filePaths.commitMetaPath(repositoryId);
    listener.loadingCommits(repositoryId);
    final CommitsLoadResult.Builder builder = CommitsLoadResult.create();
    if (!exists(tarFile)) {
        return builder.build();
    }
    final EntriesLoadResult result = doLoadEntries(processor, tarFile);
    return builder.successful(result.getSuccessful()).errors(result.getErrors().stream().map(error -> LoadError.error(error.getMessage())).collect(Collectors.toList())).build();
}
Also used : GZIPInputStream(java.util.zip.GZIPInputStream) DumpBlobStore(com.enonic.xp.repo.impl.dump.blobstore.DumpBlobStore) TarArchiveInputStream(org.apache.commons.compress.archivers.tar.TarArchiveInputStream) FilePaths(com.enonic.xp.repo.impl.dump.FilePaths) RepositoryIds(com.enonic.xp.repository.RepositoryIds) BranchDumpResult(com.enonic.xp.dump.BranchDumpResult) Segment(com.enonic.xp.blob.Segment) BlobKey(com.enonic.xp.blob.BlobKey) Branch(com.enonic.xp.branch.Branch) RepoLoadException(com.enonic.xp.repo.impl.dump.RepoLoadException) RepositoryId(com.enonic.xp.repository.RepositoryId) TarArchiveEntry(org.apache.commons.compress.archivers.tar.TarArchiveEntry) RepoDumpResult(com.enonic.xp.dump.RepoDumpResult) DumpMetaJsonSerializer(com.enonic.xp.repo.impl.dump.serializer.json.DumpMetaJsonSerializer) ByteSource(com.google.common.io.ByteSource) DumpConstants(com.enonic.xp.repo.impl.dump.DumpConstants) CommitsLoadResult(com.enonic.xp.dump.CommitsLoadResult) ImmutableSet(com.google.common.collect.ImmutableSet) RepositorySegmentUtils(com.enonic.xp.repository.RepositorySegmentUtils) NodeVersionKey(com.enonic.xp.blob.NodeVersionKey) IOException(java.io.IOException) SystemLoadListener(com.enonic.xp.dump.SystemLoadListener) Branches(com.enonic.xp.branch.Branches) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) UncheckedIOException(java.io.UncheckedIOException) Objects(java.util.Objects) LineProcessor(com.google.common.io.LineProcessor) SystemDumpResult(com.enonic.xp.dump.SystemDumpResult) LoadError(com.enonic.xp.dump.LoadError) Stream(java.util.stream.Stream) DumpMeta(com.enonic.xp.repo.impl.dump.model.DumpMeta) NodeVersion(com.enonic.xp.node.NodeVersion) VersionsLoadResult(com.enonic.xp.dump.VersionsLoadResult) PathRef(com.enonic.xp.repo.impl.dump.PathRef) DumpBlobRecord(com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord) NullSystemLoadListener(com.enonic.xp.repo.impl.dump.NullSystemLoadListener) BranchLoadResult(com.enonic.xp.dump.BranchLoadResult) RepoDumpException(com.enonic.xp.repo.impl.dump.RepoDumpException) InputStream(java.io.InputStream) PathRef(com.enonic.xp.repo.impl.dump.PathRef) CommitsLoadResult(com.enonic.xp.dump.CommitsLoadResult)

Aggregations

BlobKey (com.enonic.xp.blob.BlobKey)1 NodeVersionKey (com.enonic.xp.blob.NodeVersionKey)1 Segment (com.enonic.xp.blob.Segment)1 Branch (com.enonic.xp.branch.Branch)1 Branches (com.enonic.xp.branch.Branches)1 BranchDumpResult (com.enonic.xp.dump.BranchDumpResult)1 BranchLoadResult (com.enonic.xp.dump.BranchLoadResult)1 CommitsLoadResult (com.enonic.xp.dump.CommitsLoadResult)1 LoadError (com.enonic.xp.dump.LoadError)1 RepoDumpResult (com.enonic.xp.dump.RepoDumpResult)1 SystemDumpResult (com.enonic.xp.dump.SystemDumpResult)1 SystemLoadListener (com.enonic.xp.dump.SystemLoadListener)1 VersionsLoadResult (com.enonic.xp.dump.VersionsLoadResult)1 NodeVersion (com.enonic.xp.node.NodeVersion)1 DumpConstants (com.enonic.xp.repo.impl.dump.DumpConstants)1 FilePaths (com.enonic.xp.repo.impl.dump.FilePaths)1 NullSystemLoadListener (com.enonic.xp.repo.impl.dump.NullSystemLoadListener)1 PathRef (com.enonic.xp.repo.impl.dump.PathRef)1 RepoDumpException (com.enonic.xp.repo.impl.dump.RepoDumpException)1 RepoLoadException (com.enonic.xp.repo.impl.dump.RepoLoadException)1