public class CoopLockRecordsDao extends Object
CoopLockRecords class (persisted in gs://<BUCKET>/_lock/all.lock
file).
Main function of this class is to perform atomic acuisiton and release of a lock for resources
specified in CoopLockRecord class.
| Modifier and Type | Field and Description |
|---|---|
static String |
LOCK_DIRECTORY |
static String |
LOCK_PATH |
| Constructor and Description |
|---|
CoopLockRecordsDao(GoogleCloudStorageImpl gcs) |
| Modifier and Type | Method and Description |
|---|---|
static com.google.gson.Gson |
createGson() |
Set<CoopLockRecord> |
getLockedOperations(String bucketName) |
void |
lockPaths(String operationId,
Instant operationInstant,
CoopLockOperationType operationType,
StorageResourceId... resources) |
void |
relockOperation(String bucketName,
CoopLockRecord operationRecord) |
void |
unlockPaths(String operationId,
StorageResourceId... resources) |
public static final String LOCK_DIRECTORY
public static final String LOCK_PATH
public CoopLockRecordsDao(GoogleCloudStorageImpl gcs)
public Set<CoopLockRecord> getLockedOperations(String bucketName) throws IOException
IOExceptionpublic void relockOperation(String bucketName, CoopLockRecord operationRecord) throws IOException
IOExceptionpublic void lockPaths(String operationId, Instant operationInstant, CoopLockOperationType operationType, StorageResourceId... resources) throws IOException
IOExceptionpublic void unlockPaths(String operationId, StorageResourceId... resources) throws IOException
IOExceptionpublic static com.google.gson.Gson createGson()
Copyright © 2022. All rights reserved.