diff options
Diffstat (limited to 'zkfacade')
-rw-r--r-- | zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java b/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java index 82d114ae540..f96e46d90d8 100644 --- a/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java +++ b/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java @@ -61,8 +61,7 @@ public class Curator implements VespaCurator, AutoCloseable { private static final Duration BASE_SLEEP_TIME = Duration.ofSeconds(1); private static final int MAX_RETRIES = 10; private static final RetryPolicy DEFAULT_RETRY_POLICY = new ExponentialBackoffRetry((int) BASE_SLEEP_TIME.toMillis(), MAX_RETRIES); - - protected final RetryPolicy retryPolicy = DEFAULT_RETRY_POLICY; + private static final long juteMaxBuffer = 52428800; // Should correspond with value in ZookeeperServerConfig private final CuratorFramework curatorFramework; private final ConnectionSpec connectionSpec; @@ -183,6 +182,10 @@ public class Curator implements VespaCurator, AutoCloseable { */ // TODO: Use create().orSetData() in Curator 4 and later public void set(Path path, byte[] data) { + if (data.length > juteMaxBuffer) + throw new IllegalArgumentException("Cannot not set data at " + path.getAbsolute() + ", " + + data.length + " bytes, max bytes is " + juteMaxBuffer); + if ( ! exists(path)) create(path); |