Skip to content

Commit 98ab384

Browse files
author
Mark
committed
reloadRouting
1 parent 16416dd commit 98ab384

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

src/main/java/com/arangodb/ArangoDatabase.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,4 +1320,32 @@ public <T> CompletableFuture<Optional<T>> getDocumentAsync(
13201320
final String[] split = id.split("/");
13211321
return collection(split[0]).getDocumentAsync(split[1], type, options);
13221322
}
1323+
1324+
/**
1325+
* Reload the routing table.
1326+
*
1327+
* @see <a href=
1328+
* "https://docs.arangodb.com/current/HTTP/AdministrationAndMonitoring/index.html#reloads-the-routing-information">API
1329+
* Documentation</a>
1330+
* @throws ArangoDBException
1331+
*/
1332+
public void reloadRouting() throws ArangoDBException {
1333+
executeSync(reloadRoutingRequest(), Void.class);
1334+
}
1335+
1336+
/**
1337+
* Reload the routing table.
1338+
*
1339+
* @see <a href=
1340+
* "https://docs.arangodb.com/current/HTTP/AdministrationAndMonitoring/index.html#reloads-the-routing-information">API
1341+
* Documentation</a>
1342+
* @return void
1343+
*/
1344+
public CompletableFuture<Void> reloadRoutingAsync() {
1345+
return executeAsync(reloadRoutingRequest(), Void.class);
1346+
}
1347+
1348+
private Request reloadRoutingRequest() {
1349+
return new Request(name, RequestType.POST, ArangoDBConstants.PATH_API_ADMIN_ROUTING_RELOAD);
1350+
}
13231351
}

src/main/java/com/arangodb/internal/ArangoDBConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class ArangoDBConstants {
5454
public static final String PATH_API_QUERY_SLOW = "/_api/query/slow";
5555
public static final String PATH_API_TRAVERSAL = "/_api/traversal";
5656
public static final String PATH_API_ADMIN_LOG = "/_admin/log";
57+
public static final String PATH_API_ADMIN_ROUTING_RELOAD = "/_admin/routing/reload";
5758

5859
public static final String ENCRYPTION_PLAIN = "plain";
5960

src/test/java/com/arangodb/ArangoDatabaseTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,4 +815,9 @@ public void getDocument() {
815815
public void getDocumentWrongId() {
816816
db.getDocument("123", BaseDocument.class);
817817
}
818+
819+
@Test
820+
public void reloadRouting() {
821+
db.reloadRouting();
822+
}
818823
}

0 commit comments

Comments
 (0)