Skip to content

Update 2.0 Branch #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 72 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
242fa57
Update dependent job name
msmygit Nov 21, 2024
040d39f
Merge pull request #30 from datastax/2.0-beta
clun Nov 30, 2024
086aa17
Merge pull request #31 from datastax/2.0-beta
clun Nov 30, 2024
f0c9d0a
reducing to 1838474 warnings
clun Nov 30, 2024
de15941
less warnings
clun Nov 30, 2024
edda748
Add a getTable sample + options
clun Dec 2, 2024
521379a
javadoc
clun Dec 2, 2024
8889da7
Fixing Build
clun Dec 2, 2024
4da67b0
add sample
clun Dec 2, 2024
3ed6293
sample
clun Dec 2, 2024
43931f9
update list tables
clun Dec 3, 2024
4fbb79b
update list tables
clun Dec 3, 2024
163f010
Add Sample + simple syntax for creste index
clun Dec 3, 2024
395f50f
list indexes
clun Dec 3, 2024
b6206e6
Allow operations from the on other keyspace
clun Dec 3, 2024
b0a0eca
update examples
clun Dec 3, 2024
6bc862b
Fix #32: remove accidental debug System.out.println()
tatu-at-datastax Dec 3, 2024
ab80aec
update examples
clun Dec 4, 2024
3f8361e
Merge pull request #34 from tatu-at-datastax/main
clun Dec 4, 2024
98e9de3
update examples
clun Dec 4, 2024
e789bfa
update examples
clun Dec 4, 2024
e39a405
update examples
clun Dec 4, 2024
7e1039b
add samples
clun Dec 4, 2024
38d60ba
Mapping Row=> Bean and deserialization
clun Dec 5, 2024
2386880
Mapping Row=> Bean and deserialization
clun Dec 5, 2024
de5bf9a
double typing cursor and specialization
clun Dec 5, 2024
91ba89c
double typing cursor and specialization
clun Dec 5, 2024
0fa781c
double typing cursor and specialization
clun Dec 5, 2024
acaf500
double typing cursor and specialization
clun Dec 5, 2024
241b110
samples for updateOne
clun Dec 5, 2024
ce35c3c
samples for updateOne
clun Dec 5, 2024
143a3a4
update
clun Dec 6, 2024
6a1eef6
Samples for DataAPIVector
clun Dec 6, 2024
49557db
javadocs, javadoc, javadoc
clun Dec 7, 2024
b366490
javadocs, javadoc, javadoc
clun Dec 7, 2024
c08267d
javadocs, javadoc, javadoc...46 to go
clun Dec 7, 2024
05af2bc
javadocs, javadoc, javadoc...28 to go
clun Dec 8, 2024
97c8ce0
Fix all warnings, javadocs and compiling issue
clun Dec 9, 2024
a5dfb11
fixes
clun Dec 9, 2024
b6db3d5
[maven-release-plugin] prepare release 2.0.0-PREVIEW
clun Dec 9, 2024
9e4539c
[maven-release-plugin] prepare for next development iteration
clun Dec 9, 2024
eac62bc
[maven-release-plugin] rollback the release of 2.0.0-PREVIEW
clun Dec 9, 2024
8a52aca
removing samples and tools from the build
clun Dec 9, 2024
e0d900e
[maven-release-plugin] prepare release 2.0.0-PREVIEW
clun Dec 9, 2024
b433672
[maven-release-plugin] prepare for next development iteration
clun Dec 9, 2024
e2f3482
Split the controls to avoid NPE
clun Dec 9, 2024
02716eb
fixing #35 and aligning version
clun Dec 9, 2024
ecd471f
Remove Sort from deleteOne
clun Dec 10, 2024
15c5e86
Adding controls on serializations
clun Dec 10, 2024
78c7aea
update samples
clun Dec 10, 2024
5233a1c
Adjust the Java dist version to 17 by default
msmygit Jan 6, 2025
0cd195a
test
clun Jan 28, 2025
76fcffd
tmp update cursor and document dot notation
clun Jan 29, 2025
fb1791a
Changing collection to cursor, iprove distinct, fix getSortVector, ad…
clun Jan 30, 2025
762fb0c
remove secret
clun Jan 30, 2025
4dd9849
fix error on update
clun Jan 30, 2025
f606652
fix error on update
clun Jan 30, 2025
fda3b58
ok
clun Feb 11, 2025
52c3cef
update
clun Feb 11, 2025
6dd92a4
[maven-release-plugin] prepare release 2.0.0-PREVIEW1
clun Feb 11, 2025
46a7129
[maven-release-plugin] prepare for next development iteration
clun Feb 11, 2025
266b0a5
push the json loader to the repo
clun Mar 5, 2025
856867a
removing CRTP
clun Mar 7, 2025
d91d707
FindAndRerank
clun Mar 11, 2025
9548ffc
FindAndRerank
clun Mar 11, 2025
1daf15c
FindAndRerank
clun Mar 11, 2025
e32fb25
FindAndRerank
clun Mar 14, 2025
49d5c2e
FindAndRerank
clun Mar 14, 2025
cd00bbb
FindAndRerank
clun Mar 14, 2025
e2f2668
Update find and Rerank, start reworking the tests
clun Mar 27, 2025
c575a1f
test for BYOV
clun Mar 28, 2025
f6c8288
more test
clun Mar 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
javadocs, javadoc, javadoc
  • Loading branch information
clun committed Dec 7, 2024
commit 49557dba0049b5fcd288e8a3983fc690d729ee53
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public class AstraDBAdmin {
}

/**
* Initialization with an authentication token and target environment, Use this constructor for testing purpose.

* Initialization with an authentication token and target environment,
* Use this constructor for testing purpose.
* @param options
* options for client
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public class AstraDBDatabaseAdmin extends AbstractCommandRunner<AdminOptions> im
*
* @param db
* target database
* @param adminOptions
* options to use for the admin operations like timeouts
*/
public AstraDBDatabaseAdmin(com.datastax.astra.client.databases.Database db, AdminOptions adminOptions) {
Assert.notNull(db, "database");
Expand Down Expand Up @@ -173,6 +175,7 @@ public com.datastax.astra.client.databases.Database getDatabase(String keyspace,
return new com.datastax.astra.client.databases.Database(getApiEndpoint(), db.getOptions());
}

/** {@inheritDoc} */
@Override
public Set<String> listKeyspaceNames() {
log.debug("listKeyspaceNames");
Expand All @@ -189,12 +192,14 @@ public FindEmbeddingProvidersResult findEmbeddingProviders() {
return new FindEmbeddingProvidersResult(admin.findEmbeddingProviders().getEmbeddingProviders());
}

/** {@inheritDoc} */
@Override
public void createKeyspace(String keyspace, boolean updateDBKeyspace) {
log.debug("createKeyspace");
devopsDbClient.database(databaseId.toString()).keyspaces().create(keyspace);
}

/** {@inheritDoc} */
@Override
public void dropKeyspace(String keyspace) {
log.debug("dropKeyspace");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,6 @@
* creation, retrieval, updating, and deletion of namespaces. By leveraging the extended command runner capabilities,
* it facilitates a streamlined and efficient approach to data management within the specified context.
* </p>
* <p>&nbsp;</p>
* <p>Example usage:</p>
* <pre>
* {@code
*
* // Initialization of the client
* DataApiClient client1 = DataApiClients.create("http://<>endpoint>", "<token>", new HttpClientOptions());
*
* // Example operation: Create a new namespace
* DataApiNamespace newNamespace = client.createNamespace("exampleNamespace");
*
* // Example operation: Fetch a namespace
* DataApiNamespace fetchedNamespace = client.getNamespace("exampleNamespace");
*
* // Example operation: Delete a namespace
* client.deleteNamespace("exampleNamespace");
* }
* </pre>
*/
public interface DatabaseAdmin {

Expand Down Expand Up @@ -209,29 +191,45 @@ default void dropKeyspace(String keyspace) {
dropKeyspace(keyspace, null);
}

void dropKeyspace(String keyspace, BaseOptions<?> options);

/**
* Asynchronously drops (deletes) the specified keyspace from the database. This operation is idempotent, meaning
* it will not produce an error if the keyspace does not exist. Performing this operation asynchronously ensures
* that the calling thread remains responsive, and can be particularly useful for applications that require high
* availability and cannot afford to block on potentially long-running operations. Just like its synchronous counterpart,
* this method should be used with caution as dropping a keyspace will remove all associated data, collections,
* or tables, and this action is irreversible.
* Drops (deletes) the specified keyspace from the database. This operation is idempotent; it will not
* produce an error if the keyspace does not exist. This method is useful for cleaning up data or removing
* entire keyspaces as part of database maintenance or restructuring. Caution should be exercised when using
* this method, as dropping a keyspace will remove all the data, collections, or tables contained within it,
* and this action cannot be undone.
*
* <p>Example usage:</p>
* <pre>
* {@code
* // Assume 'client' is an instance of your data API client
* String keyspace = "asyncTargetKeyspace";
* String keyspace = "targetKeyspace";
*
* // Asynchronously drop the namespace
* client.dropKeyspaceAsync(keyspace);
* // Drop the keyspace
* client.dropKeyspace(keyspace);
*
* // The keyspace 'asyncTargetKeyspace' is now being deleted in the background, along with all its contained data
* // The keyspace 'targetKeyspace' is now deleted, along with all its contained data
* }
* </pre>
*
* This example demonstrates how to safely drop a keyspace by name. The operation ensures that even if the
* keyspace does not exist, the method call will not interrupt the flow of the application, thereby allowing
* for flexible and error-tolerant code design.
*
* @param keyspace The name of the keyspace to be dropped. This parameter specifies the target keyspace
* that should be deleted. The operation will proceed silently and without error even if the
* keyspace does not exist, ensuring consistent behavior.
* @param options The options to use for the operation.
*/
void dropKeyspace(String keyspace, BaseOptions<?> options);

/**
* Asynchronously drops (deletes) the specified keyspace from the database. This operation is idempotent, meaning
* it will not produce an error if the keyspace does not exist. Performing this operation asynchronously ensures
* that the calling thread remains responsive, and can be particularly useful for applications that require high
* availability and cannot afford to block on potentially long-running operations. Just like its synchronous counterpart,
* this method should be used with caution as dropping a keyspace will remove all associated data, collections,
* or tables, and this action is irreversible.
*
* This example illustrates the non-blocking nature of dropping a keyspace. It demonstrates the method's utility in
* maintaining application responsiveness, even when performing potentially long-running database operations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ public CollectionDefinition defaultId(CollectionDefaultIdTypes type) {
* @return self reference
*/
public CollectionDefinition vectorDimension(int size) {
if (getVector() == null) {
vector = new VectorOptions();
}
getVector().dimension(size);
return this;
}
Expand All @@ -185,6 +188,9 @@ public CollectionDefinition vectorDimension(int size) {
* @return self reference
*/
public CollectionDefinition vectorSimilarity(@NonNull SimilarityMetric metric) {
if (getVector() == null) {
vector = new VectorOptions();
}
getVector().metric(metric.getValue());
return this;
}
Expand Down Expand Up @@ -265,6 +271,9 @@ public CollectionDefinition vectorize(String provider, String modeName, String s
embeddingService.authentication(Map.of("providerKey", sharedSecretKey));
// <--- Since 1.3.1 the suffix is not needed anymore
}
if (getVector() == null) {
vector = new VectorOptions();
}
getVector().service(embeddingService);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*/
@Setter
@Accessors(fluent = true, chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class Caller {

Expand All @@ -41,6 +40,12 @@ public class Caller {
/** caller version. */
String version;

/**
* Default constructor.
*/
public Caller() {
}

/**
* Gets name
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,24 @@ public <T> Collection<T> createCollection(String collectionName,
if (createCollectionOptions != null) {
if (createCollectionOptions.getDataAPIClientOptions() != null) {
collectionOptions.dataAPIClientOptions(createCollectionOptions.getDataAPIClientOptions());
DataAPIClientOptions options = createCollectionOptions.getDataAPIClientOptions();
// Merging db Headers
Map<String, String> dbHeaders = new HashMap<>();
dbHeaders.putAll(this.options.getDataAPIClientOptions().getDatabaseAdditionalHeaders());
dbHeaders.putAll(options.getDatabaseAdditionalHeaders());
options.databaseAdditionalHeaders(dbHeaders);
// Merging admin Headers
Map<String, String> adminHeaders = new HashMap<>();
adminHeaders.putAll(this.options.getDataAPIClientOptions().getAdminAdditionalHeaders());
adminHeaders.putAll(options.getAdminAdditionalHeaders());
options.adminAdditionalHeaders(adminHeaders);
collectionOptions.dataAPIClientOptions(createCollectionOptions.getDataAPIClientOptions());
// Merging listeners
Map<String, CommandObserver> listeners = new HashMap<>();
listeners.putAll(this.options.getDataAPIClientOptions().getObservers());
listeners.putAll(options.getObservers());
options.observers(listeners);

}
if (createCollectionOptions.getToken() != null) {
collectionOptions.token(createCollectionOptions.getToken());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import com.datastax.astra.client.tables.commands.options.TableUpdateOneOptions;
import com.datastax.astra.client.tables.commands.results.TableInsertManyResult;
import com.datastax.astra.client.tables.commands.results.TableInsertOneResult;
import com.datastax.astra.client.tables.commands.results.TableUpdateResult;
import com.datastax.astra.client.tables.cursor.TableCursor;
import com.datastax.astra.client.tables.definition.TableDefinition;
import com.datastax.astra.client.tables.definition.TableDescriptor;
Expand All @@ -59,7 +58,6 @@
import com.datastax.astra.client.tables.exceptions.TooManyRowsToCountException;
import com.datastax.astra.internal.api.DataAPIData;
import com.datastax.astra.internal.api.DataAPIResponse;
import com.datastax.astra.internal.api.DataAPIStatus;
import com.datastax.astra.internal.command.AbstractCommandRunner;
import com.datastax.astra.internal.command.CommandObserver;
import com.datastax.astra.internal.serdes.DataAPISerializer;
Expand All @@ -68,7 +66,6 @@
import com.datastax.astra.internal.utils.Assert;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.hc.core5.http.NotImplementedException;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,27 @@
* #L%
*/

public class AlterTableRenameColumns implements AlterTableOperation{
/**
* Represents an operation to rename columns in a database table.
* This class implements the {@link AlterTableOperation} interface,
* providing the functionality to return the operation name as "rename".
*
* <p>This operation is typically used to rename one or more columns in a table
* during schema alterations.</p>
*/
public class AlterTableRenameColumns implements AlterTableOperation {

/**
* Default constructor.
*/
public AlterTableRenameColumns() {
}

/**
* Returns the name of the operation, which is "rename".
*
* @return a {@link String} representing the name of this operation.
*/
@Override
public String getOperationName() {
return "rename";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* List Options for a FindOne command.
*/
@Getter @Setter
@NoArgsConstructor
@Accessors(fluent = true, chain = true)
public class TableFindOptions extends BaseOptions<TableFindOptions> {

Expand Down Expand Up @@ -71,6 +70,11 @@ public class TableFindOptions extends BaseOptions<TableFindOptions> {
*/
String pageState;

/**
* Default constructor.
*/
public TableFindOptions() {}

/**
* Add a skip clause in the find block
*
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy