This is an automated email from the ASF dual-hosted git repository. burcham pushed a commit to branch support/1.13 in repository https://gitbox.apache.org/repos/asf/geode.git
commit f28eca3ad926f4f8f9c481426260f8f8ddc2dc9a Author: Bill Burcham <bill.burc...@gmail.com> AuthorDate: Sat Apr 17 13:15:53 2021 -0700 GEODE-9141: (1 of 2) rename ByteBufferSharingImpl to ByteBuferVendor (cherry picked from commit 38a3540583a1d0a402b026ee0d33ae4b0a2907d3) (cherry picked from commit e0fa01dd9ec9c61504d517e77d1620f8e7975b73) --- .../apache/geode/internal/net/ByteBufferSharingNoOp.java | 2 +- ...{ByteBufferSharingImpl.java => ByteBufferVendor.java} | 6 +++--- .../java/org/apache/geode/internal/net/NioSslEngine.java | 10 +++++----- .../geode/internal/net/ByteBufferConcurrencyTest.java | 16 ++++++++-------- ...ferSharingImplTest.java => ByteBufferVendorTest.java} | 6 +++--- .../org/apache/geode/internal/net/NioSslEngineTest.java | 4 ++-- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/ByteBufferSharingNoOp.java b/geode-core/src/main/java/org/apache/geode/internal/net/ByteBufferSharingNoOp.java index bd707e3..4a8bc49 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/net/ByteBufferSharingNoOp.java +++ b/geode-core/src/main/java/org/apache/geode/internal/net/ByteBufferSharingNoOp.java @@ -27,7 +27,7 @@ import java.nio.ByteBuffer; * meant for use with the {@link NioPlainEngine} only, since that engine keeps no buffers and so, * needs no reference counting on buffers, nor any synchronization around access to buffers. * - * See also {@link ByteBufferSharingImpl} + * See also {@link ByteBufferVendor} */ class ByteBufferSharingNoOp implements ByteBufferSharing { diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/ByteBufferSharingImpl.java b/geode-core/src/main/java/org/apache/geode/internal/net/ByteBufferVendor.java similarity index 96% rename from geode-core/src/main/java/org/apache/geode/internal/net/ByteBufferSharingImpl.java rename to geode-core/src/main/java/org/apache/geode/internal/net/ByteBufferVendor.java index b083d09..4933247 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/net/ByteBufferSharingImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/net/ByteBufferVendor.java @@ -31,7 +31,7 @@ import org.apache.geode.internal.net.BufferPool.BufferType; * {@link ByteBuffer}) is available (for reading and modification) in the scope of the * try-with-resources. */ -class ByteBufferSharingImpl implements ByteBufferSharing { +class ByteBufferVendor implements ByteBufferSharing { static class OpenAttemptTimedOut extends Exception { } @@ -53,8 +53,8 @@ class ByteBufferSharingImpl implements ByteBufferSharing { * This constructor acquires no lock. The reference count will be 1 after this constructor * completes. */ - ByteBufferSharingImpl(final ByteBuffer buffer, final BufferType bufferType, - final BufferPool bufferPool) { + ByteBufferVendor(final ByteBuffer buffer, final BufferType bufferType, + final BufferPool bufferPool) { this.buffer = buffer; this.bufferType = bufferType; this.bufferPool = bufferPool; diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/NioSslEngine.java b/geode-core/src/main/java/org/apache/geode/internal/net/NioSslEngine.java index 8969ecc..fc91a31 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/net/NioSslEngine.java +++ b/geode-core/src/main/java/org/apache/geode/internal/net/NioSslEngine.java @@ -42,7 +42,7 @@ import org.apache.logging.log4j.Logger; import org.apache.geode.GemFireIOException; import org.apache.geode.annotations.VisibleForTesting; import org.apache.geode.internal.net.BufferPool.BufferType; -import org.apache.geode.internal.net.ByteBufferSharingImpl.OpenAttemptTimedOut; +import org.apache.geode.internal.net.ByteBufferVendor.OpenAttemptTimedOut; import org.apache.geode.logging.internal.log4j.api.LogService; @@ -62,12 +62,12 @@ public class NioSslEngine implements NioFilter { /** * holds bytes wrapped by the SSLEngine; a.k.a. myNetData */ - private final ByteBufferSharingImpl outputSharing; + private final ByteBufferVendor outputSharing; /** * holds the last unwrapped data from a peer; a.k.a. peerAppData */ - private final ByteBufferSharingImpl inputSharing; + private final ByteBufferVendor inputSharing; NioSslEngine(SSLEngine engine, BufferPool bufferPool) { SSLSession session = engine.getSession(); @@ -77,10 +77,10 @@ public class NioSslEngine implements NioFilter { this.engine = engine; this.bufferPool = bufferPool; outputSharing = - new ByteBufferSharingImpl(bufferPool.acquireDirectSenderBuffer(packetBufferSize), + new ByteBufferVendor(bufferPool.acquireDirectSenderBuffer(packetBufferSize), TRACKED_SENDER, bufferPool); inputSharing = - new ByteBufferSharingImpl(bufferPool.acquireNonDirectReceiveBuffer(appBufferSize), + new ByteBufferVendor(bufferPool.acquireNonDirectReceiveBuffer(appBufferSize), TRACKED_RECEIVER, bufferPool); } diff --git a/geode-core/src/test/java/org/apache/geode/internal/net/ByteBufferConcurrencyTest.java b/geode-core/src/test/java/org/apache/geode/internal/net/ByteBufferConcurrencyTest.java index 7c1f383..bf95963 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/net/ByteBufferConcurrencyTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/net/ByteBufferConcurrencyTest.java @@ -47,8 +47,8 @@ public class ByteBufferConcurrencyTest { throws Exception { poolMock = mock(BufferPool.class); ByteBuffer someBuffer = ByteBuffer.allocate(1); - ByteBufferSharingImpl sharing = - new ByteBufferSharingImpl(someBuffer, BufferPool.BufferType.TRACKED_SENDER, + ByteBufferVendor sharing = + new ByteBufferVendor(someBuffer, BufferPool.BufferType.TRACKED_SENDER, poolMock); executor.inParallel(() -> { sharing.destruct(); @@ -78,8 +78,8 @@ public class ByteBufferConcurrencyTest { }).when(poolMock).releaseBuffer(any(), any()); ByteBuffer someBuffer = ByteBuffer.allocate(1); - ByteBufferSharingImpl sharing = - new ByteBufferSharingImpl(someBuffer, BufferPool.BufferType.TRACKED_SENDER, + ByteBufferVendor sharing = + new ByteBufferVendor(someBuffer, BufferPool.BufferType.TRACKED_SENDER, poolMock); executor.inParallel(() -> { @@ -109,8 +109,8 @@ public class ByteBufferConcurrencyTest { throws Exception { poolMock = mock(BufferPool.class); ByteBuffer someBuffer = ByteBuffer.allocate(1); - ByteBufferSharingImpl sharing = - new ByteBufferSharingImpl(someBuffer, BufferPool.BufferType.TRACKED_SENDER, + ByteBufferVendor sharing = + new ByteBufferVendor(someBuffer, BufferPool.BufferType.TRACKED_SENDER, poolMock); final AtomicBoolean inUse = new AtomicBoolean(false); @@ -134,8 +134,8 @@ public class ByteBufferConcurrencyTest { throws Exception { poolMock = mock(BufferPool.class); ByteBuffer someBuffer = ByteBuffer.allocate(1); - ByteBufferSharingImpl sharing = - new ByteBufferSharingImpl(someBuffer, BufferPool.BufferType.TRACKED_SENDER, + ByteBufferVendor sharing = + new ByteBufferVendor(someBuffer, BufferPool.BufferType.TRACKED_SENDER, poolMock); final AtomicBoolean inUse = new AtomicBoolean(false); diff --git a/geode-core/src/test/java/org/apache/geode/internal/net/ByteBufferSharingImplTest.java b/geode-core/src/test/java/org/apache/geode/internal/net/ByteBufferVendorTest.java similarity index 97% rename from geode-core/src/test/java/org/apache/geode/internal/net/ByteBufferSharingImplTest.java rename to geode-core/src/test/java/org/apache/geode/internal/net/ByteBufferVendorTest.java index d863076..359d8aa 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/net/ByteBufferSharingImplTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/net/ByteBufferVendorTest.java @@ -29,14 +29,14 @@ import java.util.concurrent.CountDownLatch; import org.junit.Before; import org.junit.Test; -public class ByteBufferSharingImplTest { +public class ByteBufferVendorTest { @FunctionalInterface private static interface Foo { void run() throws IOException; } - private ByteBufferSharingImpl sharing; + private ByteBufferVendor sharing; private BufferPool poolMock; private CountDownLatch clientHasOpenedResource; private CountDownLatch clientMayComplete; @@ -45,7 +45,7 @@ public class ByteBufferSharingImplTest { public void before() { poolMock = mock(BufferPool.class); sharing = - new ByteBufferSharingImpl(mock(ByteBuffer.class), BufferPool.BufferType.TRACKED_SENDER, + new ByteBufferVendor(mock(ByteBuffer.class), BufferPool.BufferType.TRACKED_SENDER, poolMock); clientHasOpenedResource = new CountDownLatch(1); clientMayComplete = new CountDownLatch(1); diff --git a/geode-core/src/test/java/org/apache/geode/internal/net/NioSslEngineTest.java b/geode-core/src/test/java/org/apache/geode/internal/net/NioSslEngineTest.java index 612593b..2fcedb4 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/net/NioSslEngineTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/net/NioSslEngineTest.java @@ -487,7 +487,7 @@ public class NioSslEngineTest { unwrappedBuffer.position(7).limit(preexistingBytes + 7); // 7 bytes of message header - ignored try (final ByteBufferSharing inputSharing = nioSslEngine.shareInputBuffer()) { - final ByteBufferSharingImpl inputSharingImpl = (ByteBufferSharingImpl) inputSharing; + final ByteBufferVendor inputSharingImpl = (ByteBufferVendor) inputSharing; inputSharingImpl.setBufferForTestingOnly(unwrappedBuffer); } @@ -544,7 +544,7 @@ public class NioSslEngineTest { ByteBuffer unwrappedBuffer = ByteBuffer.allocate(initialUnwrappedBufferSize); unwrappedBuffer.position(7).limit(preexistingBytes + 7); // 7 bytes of message header - ignored try (final ByteBufferSharing inputSharing = nioSslEngine.shareInputBuffer()) { - final ByteBufferSharingImpl inputSharingImpl = (ByteBufferSharingImpl) inputSharing; + final ByteBufferVendor inputSharingImpl = (ByteBufferVendor) inputSharing; inputSharingImpl.setBufferForTestingOnly(unwrappedBuffer); }