Skip to content

Support Range Indexes as GA. #1465

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 16 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ext {
zstdVersion = '1.5.5-3'
awsSdkV2Version = '2.18.9'
awsSdkV1Version = '1.12.337'
mongoCryptVersion = '1.11.0-SNAPSHOT'
mongoCryptVersion = '1.11.0'
projectReactorVersion = '2022.0.0'
junitBomVersion = '5.10.2'
logbackVersion = '1.3.14'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public EncryptOptions(final String algorithm) {
* <li>Unindexed</li>
* <li>Range</li>
* </ul>
* Note: The Range algorithm is unstable. It is subject to breaking changes.
*
* @return the encryption algorithm
*/
Expand Down Expand Up @@ -118,7 +117,6 @@ public EncryptOptions keyAltName(final String keyAltName) {
* The contention factor.
*
* <p>It is an error to set contentionFactor when algorithm is not "Indexed" or "Range".
* <p>Note: The Range algorithm is unstable. It is subject to breaking changes.</p>
* @param contentionFactor the contention factor, which must be {@code >= 0} or null.
* @return this
* @since 4.7
Expand Down Expand Up @@ -147,7 +145,6 @@ public Long getContentionFactor() {
*
* <p>Currently, we support only "equality" or "range" queryType.</p>
* <p>It is an error to set queryType when the algorithm is not "Indexed" or "Range".</p>
* <p>Note: The Range algorithm is unstable. It is subject to breaking changes.</p>
* @param queryType the query type
* @return this
* @since 4.7
Expand All @@ -162,7 +159,6 @@ public EncryptOptions queryType(@Nullable final String queryType) {
* Gets the QueryType.
*
* <p>Currently, we support only "equality" or "range" queryType.</p>
* <p>Note: The Range algorithm is unstable. It is subject to breaking changes.
* @see #queryType(String)
* @return the queryType or null
* @since 4.7
Expand All @@ -177,14 +173,12 @@ public String getQueryType() {
* The RangeOptions
*
* <p>It is an error to set RangeOptions when the algorithm is not "Range".
* <p>Note: The Range algorithm is unstable. It is subject to breaking changes.
* @param rangeOptions the range options
* @return this
* @since 4.9
* @mongodb.server.release 8.0
* @mongodb.driver.manual /core/queryable-encryption/ queryable encryption
*/
@Beta(Reason.SERVER)
public EncryptOptions rangeOptions(@Nullable final RangeOptions rangeOptions) {
this.rangeOptions = rangeOptions;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package com.mongodb.client.model.vault;

import com.mongodb.annotations.Beta;
import com.mongodb.annotations.Reason;
import com.mongodb.lang.Nullable;
import org.bson.BsonValue;

Expand All @@ -29,12 +27,10 @@
*
* <p>For {@code double} and {@code decimal128}, {@code min}/{@code max}/{@code precision} must all be set, or all be unset.
*
* <p>Note: The "Range" algorithm is unstable. It is subject to breaking changes.
* @since 4.9
* @mongodb.server.release 6.2
* @mongodb.driver.manual /core/queryable-encryption/ queryable encryption
*/
@Beta(Reason.SERVER)
public class RangeOptions {

private BsonValue min;
Expand Down Expand Up @@ -81,18 +77,21 @@ public RangeOptions max(@Nullable final BsonValue max) {
* @return the trim factor value if set
* @since 5.2
*/
@Nullable
public Integer getTrimFactor() {
Comment on lines +80 to 81
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's weird that this method was not @Nullable previously, as there was nothing that prevented it from returning null.

return trimFactor;
}

/**
* Set the number of top-level edges stored per record by setting a trim factor, reducing write conflicts during simultaneous inserts
* and optimizing queries by excluding seldom-used high-level edges.
* Set the number of top-level edges stored per record.
* <p>
* The trim factor may be used to tune performance.
*
* @param trimFactor the trim factor
* @return this
* @since 5.2
*/
public RangeOptions setTrimFactor(final Integer trimFactor) {
public RangeOptions trimFactor(@Nullable final Integer trimFactor) {
this.trimFactor = trimFactor;
return this;
}
Expand All @@ -106,7 +105,10 @@ public BsonValue getMax() {
}

/**
* Set the Queryable Encryption range hypergraph sparsity factor
* Set the Queryable Encryption range hypergraph sparsity factor.
* <p>
* Sparsity may be used to tune performance.
*
* @param sparsity the sparsity
* @return this
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down Expand Up @@ -131,6 +130,9 @@
"command": {
"compactStructuredEncryptionData": "default"
}
},
"result": {
"ok": 1
}
}
],
Expand Down Expand Up @@ -228,4 +230,4 @@
]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,38 @@
"result": {
"errorContains": "Driver support of Queryable Encryption is incompatible with server. Upgrade server to use Queryable Encryption."
}
},
{
"name": "assertCollectionNotExists",
"object": "testRunner",
"arguments": {
"database": "default",
"collection": "enxcol_.encryptedCollection.esc"
}
},
{
"name": "assertCollectionNotExists",
"object": "testRunner",
"arguments": {
"database": "default",
"collection": "enxcol_.encryptedCollection.ecc"
}
},
{
"name": "assertCollectionNotExists",
"object": "testRunner",
"arguments": {
"database": "default",
"collection": "enxcol_.encryptedCollection.ecoc"
}
},
{
"name": "assertCollectionNotExists",
"object": "testRunner",
"arguments": {
"database": "default",
"collection": "encryptedCollection"
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down Expand Up @@ -158,9 +157,6 @@
"command": {
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": null,
"ecocCollection": null,
"eccCollection": null,
"fields": [
{
"path": "firstName",
Expand Down Expand Up @@ -343,9 +339,6 @@
"command": {
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": null,
"ecocCollection": null,
"eccCollection": null,
"fields": [
{
"path": "firstName",
Expand Down Expand Up @@ -851,9 +844,6 @@
"command": {
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": null,
"ecocCollection": null,
"eccCollection": null,
"fields": [
{
"path": "firstName",
Expand Down Expand Up @@ -1048,9 +1038,6 @@
"command": {
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": null,
"ecocCollection": null,
"eccCollection": null,
"fields": [
{
"path": "firstName",
Expand Down Expand Up @@ -1367,9 +1354,6 @@
"command": {
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": null,
"ecocCollection": null,
"eccCollection": null,
"fields": [
{
"path": "firstName",
Expand Down Expand Up @@ -1635,9 +1619,6 @@
"command": {
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": null,
"ecocCollection": null,
"eccCollection": null,
"fields": [
{
"path": "firstName",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down Expand Up @@ -55,7 +54,7 @@
"key_vault_data": [],
"tests": [
{
"description": "FLE2 encrypt fails with mising key",
"description": "FLE2 encrypt fails with missing key",
"clientOptions": {
"autoEncryptOpts": {
"kmsProviders": {
Expand Down Expand Up @@ -86,7 +85,7 @@
]
},
{
"description": "FLE2 decrypt fails with mising key",
"description": "FLE2 decrypt fails with missing key",
"clientOptions": {
"autoEncryptOpts": {
"kmsProviders": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"runOn": [
{
"minServerVersion": "7.0.0",
"serverless": "forbid",
"topology": [
"replicaset",
"sharded",
Expand Down
Loading