public class ObjectStoreUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ObjectStoreUtils.DeletionRecord |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NUM_RETRIES |
static long |
RETRY_BACKOFF_MAX_MS |
static long |
RETRY_BACKOFF_MIN_MS |
Constructor and Description |
---|
ObjectStoreUtils() |
Modifier and Type | Method and Description |
---|---|
static long |
backOffMs(int attempts) |
static Set<String> |
backupObjectListNames(ObjectStoreUtilsContext ctx,
String clusterId)
Gets the names of all the backup object lists from the object store
|
static void |
deleteVersions(ObjectStoreUtilsContext ctx,
List<TierObjectStore.KeyAndVersion> objectsToDelete)
Calls object store client to delete versioned objects and retries when a retryable exception is thrown
|
static TierObjectStoreResponse |
getObject(ObjectStoreUtilsContext ctx,
TierObjectStore.ObjectStoreMetadata metadata,
TierObjectStore.FileType fileType)
Calls the object storage client to get the specified object.
|
static Map<String,List<VersionInformation>> |
listObject(ObjectStoreUtilsContext ctx,
String keyPrefix,
Boolean getVersionInfo)
Calls object store client to list the blobs under a given key prefix.
|
static void |
putBuf(ObjectStoreUtilsContext ctx,
String key,
Map<String,String> metadata,
ByteBuffer buf)
Calls the object store client to put a buffer to the object store bucket.
|
static Map<String,List<VersionInformation>> |
verifyObjectNotLive(ObjectStoreUtilsContext ctx,
TopicIdPartition topicIdPartition,
UUID objectId)
Verifies that the blobs uploaded under a given segment UUID are not live at the object store.
|
public static final int DEFAULT_NUM_RETRIES
public static final long RETRY_BACKOFF_MAX_MS
public static final long RETRY_BACKOFF_MIN_MS
public static Map<String,List<VersionInformation>> verifyObjectNotLive(ObjectStoreUtilsContext ctx, TopicIdPartition topicIdPartition, UUID objectId) throws InterruptedException
ctx
- object store utils contexttopicIdPartition
- TopicIdPartition to which the blob belongedobjectId
- UUID for the segment in concernInterruptedException
public static Set<String> backupObjectListNames(ObjectStoreUtilsContext ctx, String clusterId) throws InterruptedException
ctx
- object store utils contextclusterId
- id for the cluster, used to form the key path for object listsInterruptedException
public static Map<String,List<VersionInformation>> listObject(ObjectStoreUtilsContext ctx, String keyPrefix, Boolean getVersionInfo) throws InterruptedException
ctx
- object store utils contextkeyPrefix
- prefix for the key to be listedgetVersionInfo
- boolean to indicate if version information is to be fetched as wellInterruptedException
public static void putBuf(ObjectStoreUtilsContext ctx, String key, Map<String,String> metadata, ByteBuffer buf) throws InterruptedException
ctx
- object store utils contextkey
- key to put the buffer undermetadata
- mapping of properties to be associated with the uploaded bufferbuf
- buffer to uploadInterruptedException
public static TierObjectStoreResponse getObject(ObjectStoreUtilsContext ctx, TierObjectStore.ObjectStoreMetadata metadata, TierObjectStore.FileType fileType) throws InterruptedException
ctx
- object store utils contextmetadata
- tier object store metadata for the object to fetchfileType
- filetype of the objectInterruptedException
public static void deleteVersions(ObjectStoreUtilsContext ctx, List<TierObjectStore.KeyAndVersion> objectsToDelete) throws InterruptedException
ctx
- object store utils contextobjectsToDelete
- list of objects to be deleted, identified by object key and version ids.InterruptedException
public static long backOffMs(int attempts)