public boolean equals(Object obj) { if (obj == null || obj.getClass() != FSRepresentation.class) { return false; } FSRepresentation rep = (FSRepresentation) obj; return myRevision == rep.getRevision() && myOffset == rep.getOffset(); }
public FSFile openAndSeekRepresentation(FSRepresentation rep) throws SVNException { if (!rep.isTxn()) { return openAndSeekRevision(rep.getRevision(), rep.getOffset()); } return openAndSeekTransaction(rep); }
public FSFile openAndSeekRepresentation(FSRepresentation rep) throws SVNException { if (!rep.isTxn()) { return openAndSeekRevision(rep.getRevision(), rep.getOffset()); } return openAndSeekTransaction(rep); }
public FSFile openAndSeekRepresentation(FSRepresentation rep) throws SVNException { if (!rep.isTxn()) { return openAndSeekRevision(rep.getRevision(), rep.getItemIndex()); } return openAndSeekTransaction(rep); }
public FSRepresentation(FSRepresentation representation) { myRevision = representation.getRevision(); myOffset = representation.getOffset(); mySize = representation.getSize(); myExpandedSize = representation.getExpandedSize(); myHexDigest = representation.getHexDigest(); myTxnId = representation.myTxnId; }
public FSFile openAndSeekRepresentation(FSRepresentation rep) throws SVNException { if (!rep.isTxn()) { return openAndSeekRevision(rep.getRevision(), rep.getOffset()); } return openAndSeekTransaction(rep); }
private void checkRepresentation(FSFS fsfs, FSRepresentation representation, Object hint) throws SVNException { if (fsfs.isUseLogAddressing()) { final long startRevision = fsfs.getPackedBaseRevision(representation.getRevision()); if (hint != null) { //TODO: this can speedup algorithm somehow } FSFile revFile = null; if (revFile == null || true) { revFile = fsfs.getPackOrRevisionFSFile(representation.getRevision()); } hint = revFile;//TODO: this can speedup algorithm somehow final long offset = fsfs.lookupOffsetInIndex(revFile, representation.getRevision(), representation.getItemIndex()); final FSP2LEntry entry = lookupP2LEntry(revFile, representation.getRevision(), offset); if (entry == null || entry.getType().getCode() < FSP2LProtoIndex.ItemType.FILE_REP.getCode() || entry.getType().getCode() > FSP2LProtoIndex.ItemType.DIR_PROPS.getCode()) { SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "No representation found at offset {0} for item %s in revision {1}", new Object[]{new Long(offset), new Long(representation.getItemIndex())}); SVNErrorManager.error(errorMessage, SVNLogType.FSFS); } } else { //TODO createRepresentationState(); this assigns the "hint" } }
public void insert(final FSRepresentation representation, boolean rejectDup) throws SVNException { if (representation.getSHA1HexDigest() == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_CHECKSUM_KIND, "Only SHA1 checksums can be used as keys in the rep_cache table.\n"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRepresentation oldRep = getRepresentationByHash(representation.getSHA1HexDigest()); if (oldRep != null) { if (rejectDup && (oldRep.getRevision() != representation.getRevision() || oldRep.getOffset() != representation.getOffset() || oldRep.getSize() != representation.getSize() || oldRep.getExpandedSize() != representation.getExpandedSize())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Representation key for checksum ''{0}'' exists in " + "filesystem ''{1}'' with a different value ({2},{3},{4},{5}) than what we were about to store ({6},{7},{8},{9})", new Object[] { representation.getSHA1HexDigest(), myFSFS.getRepositoryRoot(), String.valueOf(oldRep.getRevision()), String.valueOf(oldRep.getOffset()), String.valueOf(oldRep.getSize()), String.valueOf(oldRep.getExpandedSize()), String.valueOf(representation.getRevision()), String.valueOf(representation.getOffset()), String.valueOf(representation.getSize()), String.valueOf(representation.getExpandedSize()) }); SVNErrorManager.error(err, SVNLogType.FSFS); } return; } try { myTable.insert(new Object[] { representation.getSHA1HexDigest(), new Long(representation.getRevision()), new Long(representation.getOffset()), new Long(representation.getSize()), new Long(representation.getExpandedSize()) }); } catch (SqlJetException e) { SVNErrorManager.error(convertError(e), SVNLogType.FSFS); } }
public void insert(final FSRepresentation representation, boolean rejectDup) throws SVNException { if (representation.getSHA1HexDigest() == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_CHECKSUM_KIND, "Only SHA1 checksums can be used as keys in the rep_cache table.\n"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRepresentation oldRep = getRepresentationByHash(representation.getSHA1HexDigest()); if (oldRep != null) { if (rejectDup && (oldRep.getRevision() != representation.getRevision() || oldRep.getItemIndex() != representation.getItemIndex() || oldRep.getSize() != representation.getSize() || oldRep.getExpandedSize() != representation.getExpandedSize())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Representation key for checksum ''{0}'' exists in " + "filesystem ''{1}'' with a different value ({2},{3},{4},{5}) than what we were about to store ({6},{7},{8},{9})", new Object[] { representation.getSHA1HexDigest(), myFSFS.getRepositoryRoot(), String.valueOf(oldRep.getRevision()), String.valueOf(oldRep.getItemIndex()), String.valueOf(oldRep.getSize()), String.valueOf(oldRep.getExpandedSize()), String.valueOf(representation.getRevision()), String.valueOf(representation.getItemIndex()), String.valueOf(representation.getSize()), String.valueOf(representation.getExpandedSize()) }); SVNErrorManager.error(err, SVNLogType.FSFS); } return; } try { myTable.insert(new Object[] { representation.getSHA1HexDigest(), new Long(representation.getRevision()), new Long(representation.getItemIndex()), new Long(representation.getSize()), new Long(representation.getExpandedSize()) }); } catch (SqlJetException e) { SVNErrorManager.error(convertError(e), SVNLogType.FSFS); } }
public void insert(final FSRepresentation representation, boolean rejectDup) throws SVNException { if (representation.getSHA1HexDigest() == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_CHECKSUM_KIND, "Only SHA1 checksums can be used as keys in the rep_cache table.\n"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRepresentation oldRep = getRepresentationByHash(representation.getSHA1HexDigest()); if (oldRep != null) { if (rejectDup && (oldRep.getRevision() != representation.getRevision() || oldRep.getOffset() != representation.getOffset() || oldRep.getSize() != representation.getSize() || oldRep.getExpandedSize() != representation.getExpandedSize())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Representation key for checksum ''{0}'' exists in " + "filesystem ''{1}'' with a different value ({2},{3},{4},{5}) than what we were about to store ({6},{7},{8},{9})", new Object[] { representation.getSHA1HexDigest(), myFSFS.getRepositoryRoot(), String.valueOf(oldRep.getRevision()), String.valueOf(oldRep.getOffset()), String.valueOf(oldRep.getSize()), String.valueOf(oldRep.getExpandedSize()), String.valueOf(representation.getRevision()), String.valueOf(representation.getOffset()), String.valueOf(representation.getSize()), String.valueOf(representation.getExpandedSize()) }); SVNErrorManager.error(err, SVNLogType.FSFS); } return; } try { myTable.insert(new Object[] { representation.getSHA1HexDigest(), new Long(representation.getRevision()), new Long(representation.getOffset()), new Long(representation.getSize()), new Long(representation.getExpandedSize()) }); } catch (SqlJetException e) { SVNErrorManager.error(convertError(e), SVNLogType.FSFS); } }
if (FSRepository.isInvalidRevision(rep.getRevision())) { rep.setTxnId(txnId); if (isData) {
revNode.setType(nodeKind); FSRevisionNode.parseRepresentationHeader(textRep, revNode, null, true, false); if (revNode.getTextRepresentation().getRevision() != rev) { return;
revNode.setType(nodeKind); FSRevisionNode.parseRepresentationHeader(textRep, revNode, null, true, false); if (revNode.getTextRepresentation().getRevision() != rev) { return;
revNode.setType(nodeKind); FSRevisionNode.parseRepresentationHeader(textRep, revNode, null, true, false); if (revNode.getTextRepresentation().getRevision() != rev) { return;
header = FSRepresentation.REP_DELTA + " " + baseRep.getRevision() + " " + baseRep.getOffset() + " " + baseRep.getSize() + "\n"; } else { header = FSRepresentation.REP_DELTA + "\n";
IFSRepresentationCacheManager reposCacheManager = getOwner().getRepositoryCacheManager(); if (reposCacheManager != null && revNode.getTextRepresentation() != null && revNode.getType() == SVNNodeKind.FILE && revNode.getTextRepresentation().getRevision() == revision) { reposCacheManager.insert(revNode.getTextRepresentation(), false);
header = FSRepresentation.REP_DELTA + " " + baseRep.getRevision() + " " + baseRep.getItemIndex() + " " + baseRep.getSize() + "\n"; } else { header = FSRepresentation.REP_DELTA + "\n";
revNode.getTextRepresentation().getRevision() == revision) { representations.add(revNode.getTextRepresentation());
header = FSRepresentation.REP_DELTA + " " + baseRep.getRevision() + " " + baseRep.getOffset() + " " + baseRep.getSize() + "\n"; } else { header = FSRepresentation.REP_DELTA + "\n";
header = FSRepresentation.REP_DELTA + " " + baseRep.getRevision() + " " + baseRep.getOffset() + " " + baseRep.getSize() + "\n"; } else { header = FSRepresentation.REP_DELTA + "\n";