Skip to content

Commit

Permalink
KV and OS Compression and Metadata (#1034)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf committed Nov 8, 2023
1 parent 1c63c16 commit 4ab3e28
Show file tree
Hide file tree
Showing 23 changed files with 731 additions and 396 deletions.
4 changes: 0 additions & 4 deletions src/main/java/io/nats/client/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ enum Status {

/**
* Gets a context for working with an Object Store.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param bucketName the bucket name
* @return an ObjectStore instance.
* @throws IOException various IO exception such as timeout or interruption
Expand All @@ -677,7 +676,6 @@ enum Status {

/**
* Gets a context for working with an Object Store.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param bucketName the bucket name
* @param options ObjectStore options.
* @return an ObjectStore instance.
Expand All @@ -687,15 +685,13 @@ enum Status {

/**
* Gets a context for managing Object Stores
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @return an ObjectStoreManagement instance.
* @throws IOException various IO exception such as timeout or interruption
*/
ObjectStoreManagement objectStoreManagement() throws IOException;

/**
* Gets a context for managing Object Stores
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param options ObjectStore options.
* @return a ObjectStoreManagement instance.
* @throws IOException various IO exception such as timeout or interruption
Expand Down
17 changes: 0 additions & 17 deletions src/main/java/io/nats/client/ObjectStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,17 @@

/**
* Object Store Management context for creation and access to key value buckets.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
*/
public interface ObjectStore {

/**
* Get the name of the object store's bucket.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @return the name
*/
String getBucketName();

/**
* Place the contents of the input stream into a new object.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param meta the metadata for the object
* @param inputStream the source input stream
* @return the ObjectInfo for the saved object
Expand All @@ -50,7 +47,6 @@ public interface ObjectStore {

/**
* Place the contents of the input stream into a new object.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param objectName the name of the object
* @param inputStream the source input stream
* @return the ObjectInfo for the saved object
Expand All @@ -62,7 +58,6 @@ public interface ObjectStore {

/**
* Place the bytes into a new object.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param objectName the name of the object
* @param input the bytes to store
* @return the ObjectInfo for the saved object
Expand All @@ -74,7 +69,6 @@ public interface ObjectStore {

/**
* Place the contents of the file into a new object using the file name as the object name.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param file the file to read
* @return the ObjectInfo for the saved object
* @throws IOException covers various communication issues with the NATS server such as timeout or interruption
Expand All @@ -85,7 +79,6 @@ public interface ObjectStore {

/**
* Get an object by name from the store, reading it into the output stream, if the object exists.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param objectName The name of the object
* @param outputStream the destination stream.
* @return the ObjectInfo for the object name or throw an exception if it does not exist or is deleted.
Expand All @@ -98,7 +91,6 @@ public interface ObjectStore {

/**
* Get the info for an object if the object exists / is not deleted.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param objectName The name of the object
* @return the ObjectInfo for the object name or throw an exception if it does not exist.
* @throws IOException covers various communication issues with the NATS server such as timeout or interruption
Expand All @@ -108,7 +100,6 @@ public interface ObjectStore {

/**
* Get the info for an object if the object exists, optionally including deleted.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param objectName The name of the object
* @param includingDeleted whether to return info for deleted objects
* @return the ObjectInfo for the object name or throw an exception if it does not exist.
Expand All @@ -119,7 +110,6 @@ public interface ObjectStore {

/**
* Update the metadata of name, description or headers. All other changes are ignored.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param objectName The name of the object
* @param meta the metadata with the new or unchanged name, description and headers.
* @return the ObjectInfo after update
Expand All @@ -130,7 +120,6 @@ public interface ObjectStore {

/**
* Delete the object by name. A No-op if the object is already deleted.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param objectName The name of the object
* @return the ObjectInfo after delete or throw an exception if it does not exist.
* @throws IOException covers various communication issues with the NATS server such as timeout or interruption
Expand All @@ -140,7 +129,6 @@ public interface ObjectStore {

/**
* Add a link to another object. A link cannot be for another link.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param objectName The name of the object
* @param toInfo the info object of the object to link to
* @return the ObjectInfo for the link as saved or throws an exception
Expand All @@ -151,7 +139,6 @@ public interface ObjectStore {

/**
* Add a link to another object store (bucket).
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param objectName The name of the object
* @param toStore the store object to link to
* @return the ObjectInfo for the link as saved or throws an exception
Expand All @@ -162,7 +149,6 @@ public interface ObjectStore {

/**
* Close (seal) the bucket to changes. The store (bucket) will be read only.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @return the status object
* @throws IOException covers various communication issues with the NATS server such as timeout or interruption
* @throws JetStreamApiException the request had an error related to the data
Expand All @@ -171,7 +157,6 @@ public interface ObjectStore {

/**
* Get a list of all object [infos] in the store.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @return the list of objects
* @throws IOException covers various communication issues with the NATS server such as timeout or interruption
* @throws JetStreamApiException the request had an error related to the data
Expand All @@ -181,7 +166,6 @@ public interface ObjectStore {

/**
* Create a watch on the store (bucket).
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @param watcher the implementation to receive changes.
* @param watchOptions the watch options to apply. If multiple conflicting options are supplied, the last options wins.
* @return the NatsObjectStoreWatchSubscription
Expand All @@ -193,7 +177,6 @@ public interface ObjectStore {

/**
* Get the ObjectStoreStatus object.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
* @return the status object
* @throws IOException covers various communication issues with the NATS server such as timeout or interruption
* @throws JetStreamApiException the request had an error related to the data the request had an error related to the data
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/io/nats/client/ObjectStoreManagement.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@

/**
* Object Store Management context for creation and access to object stores.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
*/
public interface ObjectStoreManagement {

/**
* Create an object store.
* THIS IS A BETA FEATURE AND SUBJECT TO CHANGE
* @param config the object store configuration
* @return bucket info
* @throws IOException covers various communication issues with the NATS
Expand All @@ -39,7 +37,6 @@ public interface ObjectStoreManagement {

/**
* Get the list of object stores bucket names
* THIS IS A BETA FEATURE AND SUBJECT TO CHANGE
* @return list of object stores bucket names
* @throws IOException covers various communication issues with the NATS
* server such as timeout or interruption
Expand All @@ -49,7 +46,6 @@ public interface ObjectStoreManagement {

/**
* Gets the status for an existing object store bucket.
* THIS IS A BETA FEATURE AND SUBJECT TO CHANGE
* @param bucketName the object store bucket name to get info for
* @return the bucket status object
* @throws IOException covers various communication issues with the NATS
Expand All @@ -60,7 +56,6 @@ public interface ObjectStoreManagement {

/**
* Gets the status for all object store buckets.
* THIS IS A BETA FEATURE AND SUBJECT TO CHANGE
* @return list of statuses
* @throws IOException covers various communication issues with the NATS
* server such as timeout or interruption
Expand All @@ -70,7 +65,6 @@ public interface ObjectStoreManagement {

/**
* Deletes an existing object store. Will throw a JetStreamApiException if the delete fails.
* THIS IS A BETA FEATURE AND SUBJECT TO CHANGE
* @param bucketName the object store bucket name to delete
* @throws IOException covers various communication issues with the NATS
* server such as timeout or interruption
Expand Down
1 change: 0 additions & 1 deletion src/main/java/io/nats/client/ObjectStoreOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
/**
* The ObjectStoreOptions class specifies the general options for ObjectStore.
* Options are created using the {@link ObjectStoreOptions.Builder Builder}.
* OBJECT STORE IMPLEMENTATION IS EXPERIMENTAL AND SUBJECT TO CHANGE.
*/
public class ObjectStoreOptions extends FeatureOptions {

Expand Down
Loading

0 comments on commit 4ab3e28

Please sign in to comment.