gresockj commented on a change in pull request #5420:
URL: https://github.com/apache/nifi/pull/5420#discussion_r718375440
##########
File path:
nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/CacheClientRequestHandler.java
##########
@@ -64,6 +64,18 @@ public void channelReadComplete(ChannelHandlerContext ctx)
throws IOException {
}
}
+ @Override
+ public void channelUnregistered(ChannelHandlerContext ctx) {
Review comment:
Consider `final` argument here
##########
File path:
nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-server/src/main/java/org/apache/nifi/distributed/cache/server/map/DistributedMapCacheServer.java
##########
@@ -67,14 +68,14 @@ protected CacheServer createCacheServer(final
ConfigurationContext context) {
try {
final File persistenceDir = persistencePath == null ? null : new
File(persistencePath);
- return createMapCacheServer(port, maxSize, sslContext,
evictionPolicy, persistenceDir);
+ return createMapCacheServer(port, maxSize, sslContext,
evictionPolicy, persistenceDir, maxReadSize);
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
- protected MapCacheServer createMapCacheServer(int port, int maxSize,
SSLContext sslContext, EvictionPolicy evictionPolicy, File persistenceDir)
throws IOException {
- return new MapCacheServer(getIdentifier(), sslContext, port, maxSize,
evictionPolicy, persistenceDir);
+ protected MapCacheServer createMapCacheServer(int port, int maxSize,
SSLContext sslContext, EvictionPolicy evictionPolicy, File persistenceDir, int
maxReadSize) throws IOException {
Review comment:
Recommend `final` arguments
##########
File path:
nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-server/src/main/java/org/apache/nifi/distributed/cache/server/DistributedSetCacheServer.java
##########
@@ -35,6 +35,7 @@ protected CacheServer createCacheServer(final
ConfigurationContext context) {
final SSLContextService sslContextService =
context.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class);
final int maxSize = context.getProperty(MAX_CACHE_ENTRIES).asInteger();
final String evictionPolicyName =
context.getProperty(EVICTION_POLICY).getValue();
+ final int maxReadSize = context.getProperty(MAX_READ_SIZE).asInteger();
Review comment:
If we go with the Data Size Validator, should `maxReadSize` be a `long`?
Anything over ~2.14 GB is over `Integer.MAX_SIZE`. Or if we want to limit the
max data size, perhaps additional custom validation is needed.
##########
File path:
nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/CacheClientRequestHandler.java
##########
@@ -64,6 +64,18 @@ public void channelReadComplete(ChannelHandlerContext ctx)
throws IOException {
}
}
+ @Override
+ public void channelUnregistered(ChannelHandlerContext ctx) {
+ if (!inboundAdapter.isComplete()) {
+ channelPromise.setFailure(new IOException("channelUnregistered
during request - " + ctx.channel().toString()));
+ }
+ }
+
+ @Override
+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
Review comment:
Consider `final` arguments
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]