public static synchronized FSWriteLock getWriteLock(FSFS owner) throws SVNException { String uuid = owner.getUUID(); FSWriteLock lock = (FSWriteLock) ourThreadLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner); ourThreadLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
public Map compoundMetaProperties(long revision) throws SVNException { Map metaProps = new HashMap(); Map revProps = getRevisionProperties(revision); String author = (String) revProps.get(SVNRevisionProperty.AUTHOR); String date = (String) revProps.get(SVNRevisionProperty.DATE); String uuid = getUUID(); String rev = String.valueOf(revision); metaProps.put(SVNProperty.LAST_AUTHOR, author); metaProps.put(SVNProperty.COMMITTED_DATE, date); metaProps.put(SVNProperty.COMMITTED_REVISION, rev); metaProps.put(SVNProperty.UUID, uuid); return metaProps; }
public static synchronized FSWriteLock getWriteLockForDB(FSFS owner) throws SVNException { String uuid = owner.getUUID(); FSWriteLock lock = (FSWriteLock) ourThreadDBLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getWriteLockFile(), DB_LOCK, false); ourThreadDBLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
public static synchronized FSWriteLock getDBLogsLock(FSFS owner, boolean exclusive) throws SVNException { String uuid = owner.getUUID(); FSWriteLock lock = (FSWriteLock) ourThreadLogLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getDBLogsLockFile(), LOGS_LOCK, !exclusive); ourThreadLogLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
public static synchronized FSWriteLock getDBLogsLock(FSFS owner, boolean exclusive) throws SVNException { String uuid = owner.getUUID(); FSWriteLock lock = (FSWriteLock) ourThreadLogLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getDBLogsLockFile(), LOGS_LOCK, !exclusive); ourThreadLogLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
public static synchronized FSWriteLock getDBLogsLock(FSFS owner, boolean exclusive) throws SVNException { String uuid = owner.getUUID(); FSWriteLock lock = (FSWriteLock) ourThreadLogLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getDBLogsLockFile(), LOGS_LOCK, !exclusive); ourThreadLogLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
public static synchronized FSWriteLock getWriteLockForDB(FSFS owner) throws SVNException { String uuid = owner.getUUID(); FSWriteLock lock = (FSWriteLock) ourThreadDBLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getWriteLockFile(), DB_LOCK, false); ourThreadDBLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
public static synchronized FSWriteLock getWriteLockForDB(FSFS owner) throws SVNException { String uuid = owner.getUUID(); FSWriteLock lock = (FSWriteLock) ourThreadDBLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getWriteLockFile(), DB_LOCK, false); ourThreadDBLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
public static synchronized FSWriteLock getWriteLockForCurrentTxn(String token, FSFS owner) throws SVNException { if (token == null || token.length() == 0){ SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.FS_NO_LOCK_TOKEN, "Incorrect lock token for current transaction"), SVNLogType.FSFS); } String uuid = owner.getUUID() + token; FSWriteLock lock = (FSWriteLock) ourThreadDBLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getTransactionCurrentLockFile(), DB_LOCK, false); ourThreadDBLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
public static synchronized FSWriteLock getWriteLockForTxn(String txnID, FSFS owner) throws SVNException { if (txnID == null || txnID.length() == 0){ SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.FS_NO_LOCK_TOKEN, "Incorrect txn id while locking"), SVNLogType.FSFS); } String uuid = owner.getUUID() + txnID; FSWriteLock lock = (FSWriteLock) ourThreadDBLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getTransactionProtoRevLockFile(txnID), DB_LOCK, false); ourThreadDBLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
public static synchronized FSWriteLock getWriteLockForTxn(String txnID, FSFS owner) throws SVNException { if (txnID == null || txnID.length() == 0){ SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.FS_NO_LOCK_TOKEN, "Incorrect txn id while locking"), SVNLogType.FSFS); } String uuid = owner.getUUID() + txnID; FSWriteLock lock = (FSWriteLock) ourThreadDBLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getTransactionProtoRevLockFile(txnID), DB_LOCK, false); ourThreadDBLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
public static synchronized FSWriteLock getWriteLockForTxn(String txnID, FSFS owner) throws SVNException { if (txnID == null || txnID.length() == 0){ SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.FS_NO_LOCK_TOKEN, "Incorrect txn id while locking"), SVNLogType.FSFS); } String uuid = owner.getUUID() + txnID; FSWriteLock lock = (FSWriteLock) ourThreadDBLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getTransactionProtoRevLockFile(txnID), DB_LOCK, false); ourThreadDBLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
public static synchronized FSWriteLock getWriteLockForCurrentTxn(String token, FSFS owner) throws SVNException { if (token == null || token.length() == 0){ SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.FS_NO_LOCK_TOKEN, "Incorrect lock token for current transaction"), SVNLogType.FSFS); } String uuid = owner.getUUID() + token; FSWriteLock lock = (FSWriteLock) ourThreadDBLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getTransactionCurrentLockFile(), DB_LOCK, false); ourThreadDBLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
/** * Returns the uuid of the repository. * * @param repositoryRoot a repository root directory path * @return an uuid * @throws SVNException no repository is found at * <code>repositoryRoot</code> */ public String doGetUUID(File repositoryRoot) throws SVNException { FSFS fsfs = null; try { fsfs = SVNAdminHelper.openRepository(repositoryRoot, true); return fsfs.getUUID(); } finally { SVNAdminHelper.closeRepository(fsfs); } }
public static synchronized FSWriteLock getWriteLockForCurrentTxn(String token, FSFS owner) throws SVNException { if (token == null || token.length() == 0){ SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.FS_NO_LOCK_TOKEN, "Incorrect lock token for current transaction"), SVNLogType.FSFS); } String uuid = owner.getUUID() + token; FSWriteLock lock = (FSWriteLock) ourThreadDBLocksCache.get(uuid); if (lock == null) { lock = new FSWriteLock(uuid, owner.getTransactionCurrentLockFile(), DB_LOCK, false); ourThreadDBLocksCache.put(uuid, lock); } lock.myReferencesCount++; return lock; }
/** * Returns the uuid of the repository. * * @param repositoryRoot a repository root directory path * @return an uuid * @throws SVNException no repository is found at * <code>repositoryRoot</code> */ public String doGetUUID(File repositoryRoot) throws SVNException { FSFS fsfs = null; try { fsfs = SVNAdminHelper.openRepository(repositoryRoot, true); return fsfs.getUUID(); } finally { SVNAdminHelper.closeRepository(fsfs); } }
/** * Returns the uuid of the repository. * * @param repositoryRoot a repository root directory path * @return an uuid * @throws SVNException no repository is found at * <code>repositoryRoot</code> */ public String doGetUUID(File repositoryRoot) throws SVNException { FSFS fsfs = null; try { fsfs = SVNAdminHelper.openRepository(repositoryRoot, true); return fsfs.getUUID(); } finally { SVNAdminHelper.closeRepository(fsfs); } }
public SVNProperties compoundMetaProperties(long revision) throws SVNException { SVNProperties metaProperties = new SVNProperties(); SVNProperties revProps = getRevisionProperties(revision); String uuid = getUUID(); String rev = String.valueOf(revision); metaProperties.put(SVNProperty.LAST_AUTHOR, revProps.getStringValue(SVNRevisionProperty.AUTHOR)); metaProperties.put(SVNProperty.COMMITTED_DATE, revProps.getStringValue(SVNRevisionProperty.DATE)); metaProperties.put(SVNProperty.COMMITTED_REVISION, rev); metaProperties.put(SVNProperty.UUID, uuid); return metaProperties; }
public SVNProperties compoundMetaProperties(long revision) throws SVNException { SVNProperties metaProperties = new SVNProperties(); SVNProperties revProps = getRevisionProperties(revision); String uuid = getUUID(); String rev = String.valueOf(revision); metaProperties.put(SVNProperty.LAST_AUTHOR, revProps.getStringValue(SVNRevisionProperty.AUTHOR)); metaProperties.put(SVNProperty.COMMITTED_DATE, revProps.getStringValue(SVNRevisionProperty.DATE)); metaProperties.put(SVNProperty.COMMITTED_REVISION, rev); metaProperties.put(SVNProperty.UUID, uuid); return metaProperties; }
public SVNProperties compoundMetaProperties(long revision) throws SVNException { SVNProperties metaProperties = new SVNProperties(); SVNProperties revProps = getRevisionProperties(revision); String uuid = getUUID(); String rev = String.valueOf(revision); metaProperties.put(SVNProperty.LAST_AUTHOR, revProps.getStringValue(SVNRevisionProperty.AUTHOR)); metaProperties.put(SVNProperty.COMMITTED_DATE, revProps.getStringValue(SVNRevisionProperty.DATE)); metaProperties.put(SVNProperty.COMMITTED_REVISION, rev); metaProperties.put(SVNProperty.UUID, uuid); return metaProperties; }