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
Adding controls on serializations
  • Loading branch information
clun committed Dec 10, 2024
commit 15c5e8607dd4e039ef1775444b569f881c73cbd2
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ public long getTimeout(TimeoutOptions timeoutOptions, CommandType type) {
*/
public long getRequestTimeout(TimeoutOptions timeoutOptions, CommandType type) {
return switch (type) {
case DATABASE_ADMIN -> timeoutOptions.getDatabaseAdminTimeoutMillis();
case KEYSPACE_ADMIN -> timeoutOptions.getKeyspaceAdminTimeoutMillis();
case TABLE_ADMIN -> timeoutOptions.getTableAdminTimeoutMillis();
case DATABASE_ADMIN -> timeoutOptions.getDatabaseAdminTimeoutMillis();
case KEYSPACE_ADMIN -> timeoutOptions.getKeyspaceAdminTimeoutMillis();
case TABLE_ADMIN -> timeoutOptions.getTableAdminTimeoutMillis();
case COLLECTION_ADMIN -> timeoutOptions.getCollectionAdminTimeoutMillis();
default -> timeoutOptions.getRequestTimeoutMillis();
case GENERAL_METHOD -> timeoutOptions.getGeneralMethodTimeoutMillis();
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* #L%
*/

import com.datastax.astra.client.core.commands.CommandType;
import com.datastax.astra.client.tables.definition.columns.ColumnDefinition;
import com.datastax.astra.client.tables.definition.columns.ColumnDefinitionList;
import com.datastax.astra.client.tables.definition.columns.ColumnDefinitionMap;
Expand All @@ -31,6 +32,8 @@

import java.util.LinkedHashMap;

import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;

/**
* Represents an operation to add columns to an existing table in a database schema.
* This class implements the {@link AlterTableOperation} interface, providing functionality
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,26 @@
* #L%
*/

import com.datastax.astra.client.core.commands.CommandType;
import com.datastax.astra.client.core.options.BaseOptions;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;

/**
* List Options for a FindOne command.
*/
@Getter @Setter
@Accessors(fluent = true, chain = true)
public class CountRowsOptions extends BaseOptions<CountRowsOptions> {

/**
* Default constructor.
*/
public CountRowsOptions() {
}
/**
* Default constructor.
*/
public CountRowsOptions() {
super(null, CommandType.GENERAL_METHOD, DEFAULT_TABLE_SERIALIZER, null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
* #L%
*/

import com.datastax.astra.client.core.commands.CommandType;
import com.datastax.astra.client.core.options.BaseOptions;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;

/**
* List Options for a FindOne command.
*/
Expand All @@ -34,8 +37,9 @@
public class EstimatedCountRowsOptions extends BaseOptions<EstimatedCountRowsOptions> {

/**
* Default constructor.
*/
* Default constructor.
*/
public EstimatedCountRowsOptions() {
super(null, CommandType.GENERAL_METHOD, DEFAULT_TABLE_SERIALIZER, null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
* #L%
*/

import com.datastax.astra.client.core.commands.CommandType;
import com.datastax.astra.client.core.options.BaseOptions;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;

/**
* Options to delete many documents.
*/
Expand All @@ -37,5 +40,6 @@ public class TableDeleteManyOptions extends BaseOptions<TableDeleteManyOptions>
* Default constructor.
*/
public TableDeleteManyOptions() {
super(null, CommandType.GENERAL_METHOD, DEFAULT_TABLE_SERIALIZER, null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
* #L%
*/

import com.datastax.astra.client.core.commands.CommandType;
import com.datastax.astra.client.core.options.BaseOptions;
import com.datastax.astra.client.core.query.Sort;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;

/**
* Options to delete One document.
*/
Expand All @@ -37,6 +40,8 @@ public class TableDeleteOneOptions extends BaseOptions<TableDeleteOneOptions> {
/**
* Default constructor.
*/
public TableDeleteOneOptions() {}
public TableDeleteOneOptions() {
super(null, CommandType.GENERAL_METHOD, DEFAULT_TABLE_SERIALIZER, null);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
* #L%
*/

import com.datastax.astra.client.core.commands.CommandType;
import com.datastax.astra.client.core.options.BaseOptions;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;

/**
* Options to delete many documents.
*/
Expand All @@ -37,5 +40,6 @@ public class TableDistinctOptions extends BaseOptions<TableDistinctOptions> {
* Default constructor.
*/
public TableDistinctOptions() {
super(null, CommandType.GENERAL_METHOD, DEFAULT_TABLE_SERIALIZER, null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* #L%
*/

import com.datastax.astra.client.core.commands.CommandType;
import com.datastax.astra.client.core.options.BaseOptions;
import com.datastax.astra.client.core.query.Projection;
import com.datastax.astra.client.core.query.Sort;
Expand All @@ -28,6 +29,8 @@
import lombok.Setter;
import lombok.experimental.Accessors;

import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;

/**
* List Options for a FindOne command.
*/
Expand Down Expand Up @@ -58,7 +61,9 @@ public class TableFindOneOptions extends BaseOptions<TableFindOneOptions> {
/**
* Default constructor.
*/
public TableFindOneOptions() {}
public TableFindOneOptions() {
super(null, CommandType.GENERAL_METHOD, DEFAULT_TABLE_SERIALIZER, null);
}

/**
* Adding this on top of sort(Sort[] s) to allow for a more fluent API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* #L%
*/

import com.datastax.astra.client.core.commands.CommandType;
import com.datastax.astra.client.core.options.BaseOptions;
import com.datastax.astra.client.core.query.Projection;
import com.datastax.astra.client.core.query.Sort;
Expand All @@ -28,6 +29,8 @@
import lombok.Setter;
import lombok.experimental.Accessors;

import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;

/**
* List Options for a FindOne command.
*/
Expand Down Expand Up @@ -73,7 +76,9 @@ public class TableFindOptions extends BaseOptions<TableFindOptions> {
/**
* Default constructor.
*/
public TableFindOptions() {}
public TableFindOptions() {
super(null, CommandType.GENERAL_METHOD, DEFAULT_TABLE_SERIALIZER, null);
}

/**
* Add a skip clause in the find block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
* #L%
*/

import com.datastax.astra.client.core.commands.CommandType;
import com.datastax.astra.client.core.options.DataAPIClientOptions;
import com.datastax.astra.client.core.options.BaseOptions;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;

/**
* Options for InsertMany
*/
Expand Down Expand Up @@ -62,6 +65,8 @@ public class TableInsertManyOptions extends BaseOptions<TableInsertManyOptions>
/**
* Default constructor.
*/
public TableInsertManyOptions() {}
public TableInsertManyOptions() {
super(null, CommandType.GENERAL_METHOD, DEFAULT_TABLE_SERIALIZER, null);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
* #L%
*/

import com.datastax.astra.client.core.commands.CommandType;
import com.datastax.astra.client.core.options.BaseOptions;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;

/**
* Options for InsertOne
*/
Expand All @@ -37,5 +40,6 @@ public class TableInsertOneOptions extends BaseOptions<TableInsertOneOptions> {
* Default constructor.
*/
public TableInsertOneOptions() {
super(null, CommandType.GENERAL_METHOD, DEFAULT_TABLE_SERIALIZER, null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
* #L%
*/

import com.datastax.astra.client.core.commands.CommandType;
import com.datastax.astra.client.core.options.BaseOptions;
import com.datastax.astra.client.core.query.Sort;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import static com.datastax.astra.client.tables.Table.DEFAULT_TABLE_SERIALIZER;

/**
* Options for the updateOne operation

Expand All @@ -39,5 +42,6 @@ public class TableUpdateOneOptions extends BaseOptions<TableUpdateOneOptions> {
* Default constructor.
*/
public TableUpdateOneOptions() {
super(null, CommandType.GENERAL_METHOD, DEFAULT_TABLE_SERIALIZER, null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public AbstractCommandRunner(String apiEndpoint, OPTIONS options) {
public DataAPIResponse runCommand(Command command, BaseOptions<?> overridingOptions) {

log.debug("Running command: " + AnsiUtils.green("{}"), command.getName());

// Initializing options with the Collection/Table/Database level options
DataAPIClientOptions options = this.options.getDataAPIClientOptions();

Expand All @@ -191,16 +192,27 @@ public DataAPIResponse runCommand(Command command, BaseOptions<?> overridingOpti
RetryHttpClient requestHttpClient = httpClient;

// Should we override the client to use a different one
long requestTimeout = this.options.getRequestTimeout();
if (overridingOptions != null && overridingOptions.getDataAPIClientOptions() != null) {
DataAPIClientOptions overClientOptions = overridingOptions.getDataAPIClientOptions();
HttpClientOptions overHttpClientOptions = overClientOptions.getHttpClientOptions();
TimeoutOptions overTimeoutOptions = overClientOptions.getTimeoutOptions();
// User provided specific parameters for the client
if (overHttpClientOptions != null || overTimeoutOptions != null) {
log.debug("Overriding Http Client:");
// overTimeoutOptions used only for connection timeout
requestHttpClient = new RetryHttpClient(
overHttpClientOptions != null ? overHttpClientOptions : options.getHttpClientOptions(),
overTimeoutOptions != null ? overTimeoutOptions : options.getTimeoutOptions());
}

// =======================
// === Timeouts ===
// =======================
if (overTimeoutOptions != null) {
requestTimeout = overridingOptions.getRequestTimeout();
log.debug("Overriding Timeouts to {}", requestTimeout);
}
}

// ==================
Expand Down Expand Up @@ -244,16 +256,7 @@ public DataAPIResponse runCommand(Command command, BaseOptions<?> overridingOpti
serializer = overridingOptions.getSerializer();
}

// =======================
// === Timeouts ===
// =======================

long requestTimeout = this.options.getRequestTimeout();
if (overridingOptions != null
&& overridingOptions.getDataAPIClientOptions() != null
&& overridingOptions.getDataAPIClientOptions().getTimeoutOptions() != null) {
requestTimeout = overridingOptions.getRequestTimeout();
}

// Initializing the Execution infos (could be pushed to 3rd parties)
ExecutionInfos.DataApiExecutionInfoBuilder executionInfo =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.datastax.astra.client.tables.commands.options.CreateTableOptions;
import com.datastax.astra.client.tables.commands.options.CreateVectorIndexOptions;
import com.datastax.astra.client.tables.commands.options.DropTableIndexOptions;
import com.datastax.astra.client.tables.commands.options.TableDeleteManyOptions;
import com.datastax.astra.client.tables.commands.options.TableDeleteOneOptions;
import com.datastax.astra.client.tables.commands.options.TableFindOneOptions;
import com.datastax.astra.client.tables.commands.options.TableFindOptions;
Expand Down Expand Up @@ -469,14 +470,30 @@ public void should_insert_many() {
@Test
public void should_delete_many() {
Table<TableCompositeRow> t = getDatabase().getTable(TABLE_COMPOSITE, TableCompositeRow.class);
t.insertMany(
new TableCompositeRow(10, "a", "b"),
new TableCompositeRow(20, "a", "b"),
new TableCompositeRow(30, "a", "b"));

t.deleteMany(new Filter()
.where("name").isEqualsTo("a")
.where("id").isEqualsTo("b"));
/*
for(int i = 0; i < 1000; i+=10) {
t.insertMany(
new TableCompositeRow(i, "a", "b"),
new TableCompositeRow(i+1, "a", "b"),
new TableCompositeRow(i+2, "d", "c"),
new TableCompositeRow(i+3, "f", "c"),
new TableCompositeRow(i+4, "g", "c"),
new TableCompositeRow(i+5, "h", "c"),
new TableCompositeRow(i+6, "j", "c"),
new TableCompositeRow(i+7, "j", "c"),
new TableCompositeRow(i+8, "c", "c"),
new TableCompositeRow(i+9, "a", "b"));
}
*/
// Position a retry count at 3 default is 1
HttpClientOptions httpClientOptions = new HttpClientOptions()
.retryCount(3)
.retryDelay(Duration.ofMillis(100));
TableDeleteManyOptions deleteManyOptions = new TableDeleteManyOptions()
.httpClientOptions(httpClientOptions)
.timeout(Duration.ofMillis(10));

t.deleteMany(null, deleteManyOptions);
}

@Test
Expand Down
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