Skip to content

Commit

Permalink
Merge pull request #49 from rethinkdb/release-candidate/v2.4.3
Browse files Browse the repository at this point in the history
Release version v2.4.3
  • Loading branch information
gabor-boros authored May 19, 2020
2 parents 33c8484 + 7166075 commit a25c392
Show file tree
Hide file tree
Showing 24 changed files with 2,653 additions and 341 deletions.
25 changes: 18 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
build/
out/
.gradle/
# ## RethinkDB .gitignore

# General
.#*

# IDE-related
*.iml
.idea/
.vscode/
out/

# Java-related
*.class

# Gradle-related
build/
.gradle/
confidential.properties

# Kotlin scripts
scripts/kotlinc/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -27,7 +41,4 @@ virtualenv/

# RethinkDB
scripts/*.proto

# Editors
.vscode/
.idea/
test-dburl-override.txt
4 changes: 4 additions & 0 deletions DEPLOYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ To upload a new release directly to Sonatype, run the Gradle task `uploadArchive
After release, you may need to go to https://oss.sonatype.org/#stagingRepositories and search for "rethinkdb" in the search box, find the release that is in status `open`. Select it and then click the `Close` button. This will check it and make it ready for release. If that stage passes you can click the `Release` button.

For full instructions see: http://central.sonatype.org/pages/releasing-the-deployment.html

## After deploying: Documentations

After deploying, the following file must be updated to reflect the new version: https://github.com/rethinkdb/docs/blob/master/0-getting-started/drivers/java.md
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
id("com.jfrog.bintray") version "1.8.4"
}

version = "2.4.2"
version = "2.4.3"
group = "com.rethinkdb"

java.sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down
23 changes: 17 additions & 6 deletions src/main/java/com/rethinkdb/RethinkDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
public class RethinkDB extends TopLevel {
/**
* The Singleton to use to begin interacting with RethinkDB Driver
* The Singleton to use to begin interacting with RethinkDB Driver.
*/
public static final RethinkDB r = new RethinkDB();
/**
Expand All @@ -25,7 +25,7 @@ public class RethinkDB extends TopLevel {
/**
* Gets (or creates, if null) the {@link ObjectMapper} for handling {@link com.rethinkdb.net.Result}'s values.
*
* @return the {@link com.rethinkdb.net.Result}'s {@link ObjectMapper}
* @return the {@link com.rethinkdb.net.Result}'s {@link ObjectMapper}.
*/
public synchronized static @NotNull ObjectMapper getResultMapper() {
ObjectMapper mapper = resultMapper;
Expand All @@ -40,7 +40,7 @@ public class RethinkDB extends TopLevel {
/**
* Sets the {@link ObjectMapper} for handling {@link com.rethinkdb.net.Result}'s values.
*
* @param mapper an {@link ObjectMapper}, or null
* @param mapper an {@link ObjectMapper}, or null.
*/
public synchronized static void setResultMapper(@Nullable ObjectMapper mapper) {
resultMapper = mapper;
Expand All @@ -49,7 +49,7 @@ public synchronized static void setResultMapper(@Nullable ObjectMapper mapper) {
/**
* Creates a new connection builder.
*
* @return a newly created {@link Connection.Builder}
* @return a newly created {@link Connection.Builder}.
*/
public @NotNull Connection.Builder connection() {
return new Connection.Builder();
Expand All @@ -59,7 +59,7 @@ public synchronized static void setResultMapper(@Nullable ObjectMapper mapper) {
* Creates a new connection builder and configures it with a db-url.
*
* @param dburl the db-url to configure the builder.
* @return a newly created {@link Connection.Builder}
* @return a newly created {@link Connection.Builder}.
*/
public @NotNull Connection.Builder connection(@NotNull String dburl) {
return connection(URI.create(dburl));
Expand All @@ -69,9 +69,20 @@ public synchronized static void setResultMapper(@Nullable ObjectMapper mapper) {
* Creates a new connection builder and configures it with a db-url.
*
* @param uri the db-url to configure the builder.
* @return a newly created {@link Connection.Builder}
* @return a newly created {@link Connection.Builder}.
*/
public @NotNull Connection.Builder connection(@NotNull URI uri) {
return new Connection.Builder(uri);
}

/**
* Copies a connection builder.
*
* @param b the original builder.
* @return a copy of the {@link Connection.Builder}.
*/
public @NotNull Connection.Builder connection(Connection.Builder b) {
return new Connection.Builder(b);
}

}
17 changes: 8 additions & 9 deletions src/main/java/com/rethinkdb/ast/Query.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.rethinkdb.ast;

import com.rethinkdb.RethinkDB;
import com.rethinkdb.gen.exc.ReqlRuntimeError;
import com.rethinkdb.gen.proto.QueryType;
import com.rethinkdb.model.OptArgs;
import com.rethinkdb.utils.Internals;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -22,21 +22,20 @@
public class Query {
private static final Logger LOGGER = LoggerFactory.getLogger(Query.class);

public final QueryType type;
public final @NotNull QueryType type;
public final long token;
public final OptArgs globalOptions;

public final @Nullable ReqlAst term;
public final @Nullable OptArgs globalOptions;

public Query(QueryType type, long token, @Nullable ReqlAst term, OptArgs globalOptions) {
public Query(@NotNull QueryType type, long token, @Nullable ReqlAst term, @Nullable OptArgs globalOptions) {
this.type = type;
this.token = token;
this.term = term;
this.globalOptions = globalOptions;
}

public Query(QueryType type, long token) {
this(type, token, null, new OptArgs());
public Query(@NotNull QueryType type, long token) {
this(type, token, null, null);
}

public ByteBuffer serialize() {
Expand All @@ -47,8 +46,8 @@ public ByteBuffer serialize() {
if (term != null) {
list.add(term.build());
}
if (!globalOptions.isEmpty()) {
list.add(ReqlAst.buildOptarg(globalOptions));
if (globalOptions != null && !globalOptions.isEmpty()) {
list.add(ReqlAst.buildToMap(globalOptions));
}
String json = Internals.getInternalMapper().writeValueAsString(list);
byte[] bytes = json.getBytes(StandardCharsets.UTF_8);
Expand Down
Loading

0 comments on commit a25c392

Please sign in to comment.