use of com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord in project xp by enonic.
the class AbstractDumpReader method getBinary.
@Override
public ByteSource getBinary(final RepositoryId repositoryId, final String blobKey) {
final Segment segment = RepositorySegmentUtils.toSegment(repositoryId, DumpConstants.DUMP_BINARY_SEGMENT_LEVEL);
final DumpBlobRecord record = this.dumpBlobStore.getRecord(segment, BlobKey.from(blobKey));
if (record == null) {
throw new RepoLoadException("Cannot find referred blob id " + blobKey + " in dump");
}
return record.getBytes();
}
use of com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord in project xp by enonic.
the class FlattenedPageDumpUpgrader method upgradeVersionMeta.
private void upgradeVersionMeta(final Pre4VersionDumpEntryJson version, final FlattenedPageDataUpgrader dataUpgrader) {
final DumpBlobRecord dumpBlobRecord = dumpReader.getDumpBlobStore().getRecord(SEGMENT, BlobKey.from(version.getBlobKey()));
upgradeBlobRecord(dumpBlobRecord, dataUpgrader);
}
use of com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord in project xp by enonic.
the class AbstractDumpReader method get.
@Override
public NodeVersion get(final RepositoryId repositoryId, final NodeVersionKey nodeVersionKey) {
final Segment nodeSegment = RepositorySegmentUtils.toSegment(repositoryId, DumpConstants.DUMP_NODE_SEGMENT_LEVEL);
final DumpBlobRecord dataRecord = this.dumpBlobStore.getRecord(nodeSegment, nodeVersionKey.getNodeBlobKey());
final Segment indexConfigSegment = RepositorySegmentUtils.toSegment(repositoryId, DumpConstants.DUMP_INDEX_CONFIG_SEGMENT_LEVEL);
final DumpBlobRecord indexConfigRecord = this.dumpBlobStore.getRecord(indexConfigSegment, nodeVersionKey.getIndexConfigBlobKey());
final Segment accessControlSegment = RepositorySegmentUtils.toSegment(repositoryId, DumpConstants.DUMP_ACCESS_CONTROL_SEGMENT_LEVEL);
final DumpBlobRecord accessControlRecord = this.dumpBlobStore.getRecord(accessControlSegment, nodeVersionKey.getAccessControlBlobKey());
return this.factory.create(dataRecord.getBytes(), indexConfigRecord.getBytes(), accessControlRecord.getBytes());
}
use of com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord in project xp by enonic.
the class IndexConfigUpgrader method upgradeVersionMeta.
private VersionDumpEntryJson upgradeVersionMeta(final VersionDumpEntryJson version) {
final DumpBlobRecord nodeBlobRecord = dumpReader.getDumpBlobStore().getRecord(NODE_SEGMENT, BlobKey.from(version.getNodeBlobKey()));
final NodeVersionDataJson nodeVersionDataJson = getNode(nodeBlobRecord);
final NodeVersion nodeVersion = nodeVersionDataJson.fromJson().build();
if (ContentConstants.CONTENT_NODE_COLLECTION.equals(nodeVersion.getNodeType())) {
final BlobKey newIndexConfigBlob = upgradeIndexConfigDocument(BlobKey.from(version.getIndexConfigBlobKey()), nodeVersion);
return VersionDumpEntryJson.create(version).indexConfigBlobKey(newIndexConfigBlob.toString()).build();
}
return version;
}
use of com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord in project xp by enonic.
the class IndexConfigUpgrader method upgradeIndexConfigDocument.
private BlobKey upgradeIndexConfigDocument(final BlobKey blobKey, final NodeVersion nodeVersion) {
final DumpBlobRecord indexConfigBlobRecord = dumpReader.getDumpBlobStore().getRecord(INDEX_CONFIG_SEGMENT, blobKey);
final PatternIndexConfigDocument sourceDocument = getIndexConfigDocument(indexConfigBlobRecord);
PatternIndexConfigDocument upgradedDocument = this.upgradeLanguageIndexConfig(sourceDocument, nodeVersion);
upgradedDocument = this.upgradePageIndexConfig(upgradedDocument, nodeVersion);
return !upgradedDocument.equals(sourceDocument) ? storeIndexConfigBlob(upgradedDocument) : blobKey;
}
Aggregations