From bfb267e8025092e72ad0d586e50e1182b54f3242 Mon Sep 17 00:00:00 2001 From: "Robert (Bobby) Evans" Date: Fri, 13 Jul 2018 08:09:02 -0500 Subject: [PATCH] STORM-3148: Addressed review comments --- .../messaging/netty/StormClientHandler.java | 4 +++ .../netty/BackPressureStatusTest.java | 35 ------------------- 2 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 storm-client/test/jvm/org/apache/storm/messaging/netty/BackPressureStatusTest.java diff --git a/storm-client/src/jvm/org/apache/storm/messaging/netty/StormClientHandler.java b/storm-client/src/jvm/org/apache/storm/messaging/netty/StormClientHandler.java index a9032649500..1661fc346a4 100644 --- a/storm-client/src/jvm/org/apache/storm/messaging/netty/StormClientHandler.java +++ b/storm-client/src/jvm/org/apache/storm/messaging/netty/StormClientHandler.java @@ -50,6 +50,8 @@ public void channelRead(ChannelHandlerContext ctx, Object message) throws Except try { remoteBpStatus[bpTask].set(true); } catch (ArrayIndexOutOfBoundsException e) { + //Just in case we get something we are confused about + // we can continue processing the rest of the tasks LOG.error("BP index out of bounds {}", e); } } @@ -59,6 +61,8 @@ public void channelRead(ChannelHandlerContext ctx, Object message) throws Except try { remoteBpStatus[bpTask].set(false); } catch (ArrayIndexOutOfBoundsException e) { + //Just in case we get something we are confused about + // we can continue processing the rest of the tasks LOG.error("BP index out of bounds {}", e); } } diff --git a/storm-client/test/jvm/org/apache/storm/messaging/netty/BackPressureStatusTest.java b/storm-client/test/jvm/org/apache/storm/messaging/netty/BackPressureStatusTest.java deleted file mode 100644 index ed6c59ccf72..00000000000 --- a/storm-client/test/jvm/org/apache/storm/messaging/netty/BackPressureStatusTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The ASF licenses this file to you 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.storm.messaging.netty; - -import java.io.IOException; -import java.util.Arrays; -import org.apache.storm.serialization.KryoValuesSerializer; -import org.apache.storm.shade.io.netty.buffer.ByteBuf; -import org.apache.storm.shade.io.netty.buffer.UnpooledByteBufAllocator; -import org.apache.storm.utils.Utils; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; - -class BackPressureStatusTest { - - @Test - void bufferTest() throws IOException { - UnpooledByteBufAllocator alloc = new UnpooledByteBufAllocator(false); - KryoValuesSerializer ser = new KryoValuesSerializer(Utils.readStormConfig()); - - BackPressureStatus status = new BackPressureStatus("test-worker", Arrays.asList(1, 2, 3), Arrays.asList(4, 5, 6)); - status.buffer(alloc, ser).release(); - } -} \ No newline at end of file