Skip to content

nouveau: use http/2 #5598

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 1 commit into from
Jul 17, 2025
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ src/couch/priv/couchspawnkillable
src/couch/priv/couch_ejson_compare/couch_ejson_compare.d
src/couch/priv/couch_js/**/*.d
src/couch/priv/icu_driver/couch_icu_driver.d
src/cowlib/
src/mango/src/mango_cursor_text.nocompile
src/excoveralls/
src/fauxton/
src/folsom/
src/gun/
src/hackney/
src/hqueue/
src/ibrowse/
Expand Down
4 changes: 4 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ ERLANG_MD5="false"
SKIP_DEPS="false"
WITH_SPIDERMONKEY="true"

export GIT_CONFIG_COUNT=1
export GIT_CONFIG_KEY_0="url.https://github.com/apache/couchdb-.insteadOf"
export GIT_CONFIG_VALUE_0="https://github.com/ninenines/"

run_erlang() {
erl -noshell -eval "$1" -eval "halt()."
}
Expand Down
4 changes: 4 additions & 0 deletions configure.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ with_docs = $BuildDocs
with_nouveau = $($WithNouveau.ToString().ToLower())
with_clouseau = $($WithClouseau.ToString().ToLower())

$Env:GIT_CONFIG_COUNT = 1
$Env:GIT_CONFIG_KEY_0 = "url.https://github.com/apache/couchdb-.insteadOf"
$Env:GIT_CONFIG_VALUE_0 = "https://github.com/ninenines/"

user = $CouchDBUser

js_engine = $JSEngine
Expand Down
26 changes: 26 additions & 0 deletions nouveau/src/main/java/org/apache/couchdb/nouveau/api/Ok.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.apache.couchdb.nouveau.api;

import com.fasterxml.jackson.annotation.JsonProperty;

public class Ok {

public static final Ok INSTANCE = new Ok();

@JsonProperty
public boolean ok() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.apache.couchdb.nouveau.api.IndexDefinition;
import org.apache.couchdb.nouveau.api.IndexInfo;
import org.apache.couchdb.nouveau.api.IndexInfoRequest;
import org.apache.couchdb.nouveau.api.Ok;
import org.apache.couchdb.nouveau.api.SearchRequest;
import org.apache.couchdb.nouveau.api.SearchResults;
import org.apache.couchdb.nouveau.core.IndexManager;
Expand All @@ -54,27 +55,29 @@ public IndexResource(final IndexManager indexManager) {
}

@PUT
public void createIndex(@PathParam("name") String name, @NotNull @Valid IndexDefinition indexDefinition)
public Ok createIndex(@PathParam("name") String name, @NotNull @Valid IndexDefinition indexDefinition)
throws IOException {
indexManager.create(name, indexDefinition);
return Ok.INSTANCE;
}

@DELETE
@Path("/doc/{docId}")
public void deleteDoc(
public Ok deleteDoc(
@PathParam("name") String name,
@PathParam("docId") String docId,
@NotNull @Valid DocumentDeleteRequest request)
throws Exception {
indexManager.with(name, (index) -> {
return indexManager.with(name, (index) -> {
index.delete(docId, request);
return null;
return Ok.INSTANCE;
});
}

@DELETE
public void deletePath(@PathParam("name") String path, @Valid final List<String> exclusions) throws IOException {
public Ok deletePath(@PathParam("name") String path, @Valid final List<String> exclusions) throws IOException {
indexManager.deleteAll(path, exclusions);
return Ok.INSTANCE;
}

@GET
Expand All @@ -85,9 +88,8 @@ public IndexInfo getIndexInfo(@PathParam("name") String name) throws Exception {
}

@POST
public void setIndexInfo(@PathParam("name") String name, @NotNull @Valid IndexInfoRequest request)
throws Exception {
indexManager.with(name, (index) -> {
public Ok setIndexInfo(@PathParam("name") String name, @NotNull @Valid IndexInfoRequest request) throws Exception {
return indexManager.with(name, (index) -> {
if (request.getMatchUpdateSeq().isPresent()
&& request.getUpdateSeq().isPresent()) {
index.setUpdateSeq(
Expand All @@ -99,7 +101,7 @@ public void setIndexInfo(@PathParam("name") String name, @NotNull @Valid IndexIn
request.getMatchPurgeSeq().getAsLong(),
request.getPurgeSeq().getAsLong());
}
return null;
return Ok.INSTANCE;
});
}

Expand All @@ -114,14 +116,14 @@ public SearchResults searchIndex(@PathParam("name") String name, @NotNull @Valid

@PUT
@Path("/doc/{docId}")
public void updateDoc(
public Ok updateDoc(
@PathParam("name") String name,
@PathParam("docId") String docId,
@NotNull @Valid DocumentUpdateRequest request)
throws Exception {
indexManager.with(name, (index) -> {
return indexManager.with(name, (index) -> {
index.update(docId, request);
return null;
return Ok.INSTANCE;
});
}
}
1 change: 1 addition & 0 deletions rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ DepDescs = [
{fauxton, {url, "https://github.com/apache/couchdb-fauxton"},
{tag, "v1.3.4"}, [raw]},
{ibrowse, "ibrowse", {tag, "CouchDB-4.4.2-6"}},
{gun, "gun", {tag, "2.2.0"}},
{jiffy, "jiffy", {tag, "1.1.2"}},
{mochiweb, "mochiweb", {tag, "v3.2.2"}},
{meck, "meck", {tag, "1.0.0"}},
Expand Down
4 changes: 2 additions & 2 deletions rel/nouveau.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ logging:

server:
applicationConnectors:
- type: http
- type: h2c
bindHost: 127.0.0.1
port: {{nouveau_port}}
useDateHeader: false
adminConnectors:
- type: http
- type: h2c
bindHost: 127.0.0.1
port: {{nouveau_admin_port}}
useDateHeader: false
Expand Down
4 changes: 4 additions & 0 deletions rel/reltool.config
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
ets_lru,
fabric,
global_changes,
gun,
cowlib,
ibrowse,
ioq,
jiffy,
Expand Down Expand Up @@ -111,6 +113,8 @@
{app, ets_lru, [{incl_cond, include}]},
{app, fabric, [{incl_cond, include}]},
{app, global_changes, [{incl_cond, include}]},
{app, gun, [{incl_cond, include}]},
{app, cowlib, [{incl_cond, include}]},
{app, ibrowse, [{incl_cond, include}]},
{app, ioq, [{incl_cond, include}]},
{app, jiffy, [{incl_cond, include}]},
Expand Down
2 changes: 1 addition & 1 deletion src/nouveau/src/nouveau.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{vsn, git},
{applications, [
config,
ibrowse,
gun,
kernel,
stdlib,
mem3,
Expand Down
Loading