Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
injectives committed Feb 23, 2024
1 parent ee9746c commit 3a01433
Show file tree
Hide file tree
Showing 640 changed files with 8,418 additions and 71,024 deletions.
4 changes: 4 additions & 0 deletions driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
13 changes: 8 additions & 5 deletions driver/src/main/java/org/neo4j/driver/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
import java.util.logging.Level;
import org.neo4j.driver.exceptions.UnsupportedFeatureException;
import org.neo4j.driver.internal.SecuritySettings;
import org.neo4j.driver.internal.async.pool.PoolSettings;
import org.neo4j.driver.internal.cluster.RoutingSettings;
import org.neo4j.driver.internal.handlers.pulln.FetchSizeUtil;
import org.neo4j.driver.internal.bolt.basicimpl.async.pool.PoolSettings;
import org.neo4j.driver.internal.bolt.routedimpl.cluster.RoutingSettings;
import org.neo4j.driver.internal.retry.ExponentialBackoffRetryLogic;
import org.neo4j.driver.net.ServerAddressResolver;
import org.neo4j.driver.util.Experimental;
Expand Down Expand Up @@ -371,7 +370,7 @@ public static final class ConfigBuilder {
private long maxTransactionRetryTimeMillis = ExponentialBackoffRetryLogic.DEFAULT_MAX_RETRY_TIME_MS;
private ServerAddressResolver resolver;
private MetricsAdapter metricsAdapter = MetricsAdapter.DEV_NULL;
private long fetchSize = FetchSizeUtil.DEFAULT_FETCH_SIZE;
private long fetchSize = 1000;
private int eventLoopThreads = 0;
private NotificationConfig notificationConfig = NotificationConfig.defaultConfig();

Expand Down Expand Up @@ -602,7 +601,11 @@ public ConfigBuilder withRoutingTablePurgeDelay(long delay, TimeUnit unit) {
* @return this builder
*/
public ConfigBuilder withFetchSize(long size) {
this.fetchSize = FetchSizeUtil.assertValidFetchSize(size);
if (size <= 0 && size != -1) {
throw new IllegalArgumentException(String.format(
"The record fetch size may not be 0 or negative. Illegal record fetch size: %s.", size));
}
this.fetchSize = size;
return this;
}

Expand Down
1 change: 1 addition & 0 deletions driver/src/main/java/org/neo4j/driver/GraphDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* @since 1.0
*/
public final class GraphDatabase {

private GraphDatabase() {}

/**
Expand Down
7 changes: 5 additions & 2 deletions driver/src/main/java/org/neo4j/driver/SessionConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.neo4j.driver;

import static java.util.Objects.requireNonNull;
import static org.neo4j.driver.internal.handlers.pulln.FetchSizeUtil.assertValidFetchSize;

import java.io.Serial;
import java.io.Serializable;
Expand Down Expand Up @@ -341,7 +340,11 @@ public Builder withDatabase(String database) {
* @return this builder
*/
public Builder withFetchSize(long size) {
this.fetchSize = assertValidFetchSize(size);
if (size <= 0 && size != -1) {
throw new IllegalArgumentException(String.format(
"The record fetch size may not be 0 or negative. Illegal record fetch size: %s.", size));
}
this.fetchSize = size;
return this;
}

Expand Down

This file was deleted.

Loading

0 comments on commit 3a01433

Please sign in to comment.