Class InMemoryBucketEntry
- java.lang.Object
-
- com.google.cloud.hadoop.gcsio.testing.InMemoryBucketEntry
-
public class InMemoryBucketEntry extends Object
InMemoryBucketEntry represents a GCS bucket in-memory by containing mappings to objects in the bucket alongside bucket-level metadata including storage location, storage class, etc. It is intended to be used only internally by the InMemoryGoogleCloudStorage class.
-
-
Constructor Summary
Constructors Constructor Description InMemoryBucketEntry(String bucketName, long creationTimeMillis, long modificationTimeMillis, CreateBucketOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(InMemoryObjectEntry obj)Inserts an InMemoryObjectEntry representingobjectName; replaces any existing object.InMemoryObjectEntryget(String objectName)Retrieves a previously insertedInMemoryObjectEntry, or null if it doesn't exist.GoogleCloudStorageItemInfogetInfo()Gets theGoogleCloudStorageItemInfoassociated with this BucketEntry; the 'size' of a bucket is always 0.Set<String>getObjectNames()Returns the Set containing all objectNames previously inserted into this bucket.InMemoryObjectEntryremove(String objectName)Removes a previously inserted InMemoryObjectEntry and returns it; returns null if it didn't exist.intsize()Returns the number of objects in this bucket.
-
-
-
Constructor Detail
-
InMemoryBucketEntry
public InMemoryBucketEntry(String bucketName, long creationTimeMillis, long modificationTimeMillis, CreateBucketOptions options)
- Parameters:
bucketName- The name representing the bucketName portion of a GCS path, e.g.gs://<bucketName>/<objectName>.
-
-
Method Detail
-
add
public void add(InMemoryObjectEntry obj)
Inserts an InMemoryObjectEntry representingobjectName; replaces any existing object.
-
get
public InMemoryObjectEntry get(String objectName)
Retrieves a previously insertedInMemoryObjectEntry, or null if it doesn't exist.
-
remove
public InMemoryObjectEntry remove(String objectName)
Removes a previously inserted InMemoryObjectEntry and returns it; returns null if it didn't exist.
-
getInfo
public GoogleCloudStorageItemInfo getInfo()
Gets theGoogleCloudStorageItemInfoassociated with this BucketEntry; the 'size' of a bucket is always 0.
-
getObjectNames
public Set<String> getObjectNames()
Returns the Set containing all objectNames previously inserted into this bucket.
-
size
public int size()
Returns the number of objects in this bucket.
-
-