Skip to content

Commit 61133cb

Browse files
committed
[SPARK-26536][BUILD][FOLLOWUP][TEST-MAVEN] Make StreamingReadSupport public for maven testing
## What changes were proposed in this pull request? `StreamingReadSupport` is designed to be a `package` interface. Mockito seems to complain during `Maven` testing. This doesn't fail in `sbt` and IntelliJ. For mock-testing purpose, this PR makes it `public` interface and adds explicit comments like `public interface ReadSupport` ```scala EpochCoordinatorSuite: *** RUN ABORTED *** java.lang.IllegalAccessError: tried to access class org.apache.spark.sql.sources.v2.reader.streaming.StreamingReadSupport from class org.apache.spark.sql.sources.v2.reader.streaming.ContinuousReadSupport$MockitoMock$58628338 at org.apache.spark.sql.sources.v2.reader.streaming.ContinuousReadSupport$MockitoMock$58628338.<clinit>(Unknown Source) at sun.reflect.GeneratedSerializationConstructorAccessor632.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:48) at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73) at org.mockito.internal.creation.instance.ObjenesisInstantiator.newInstance(ObjenesisInstantiator.java:19) at org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker.createMock(SubclassByteBuddyMockMaker.java:47) at org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.createMock(ByteBuddyMockMaker.java:25) at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:35) at org.mockito.internal.MockitoCore.mock(MockitoCore.java:69) ``` ## How was this patch tested? Pass the Jenkins with Maven build Closes apache#23463 from dongjoon-hyun/SPARK-26536-2. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent fe039fa commit 61133cb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/streaming/StreamingReadSupport.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@
1717

1818
package org.apache.spark.sql.sources.v2.reader.streaming;
1919

20+
import com.google.common.annotations.VisibleForTesting;
21+
2022
import org.apache.spark.sql.sources.v2.reader.ReadSupport;
2123

2224
/**
23-
* A base interface for streaming read support. This is package private and is invisible to data
24-
* sources. Data sources should implement concrete streaming read support interfaces:
25-
* {@link MicroBatchReadSupport} or {@link ContinuousReadSupport}.
25+
* A base interface for streaming read support. Data sources should implement concrete streaming
26+
* read support interfaces: {@link MicroBatchReadSupport} or {@link ContinuousReadSupport}.
27+
* This is exposed for a testing purpose.
2628
*/
27-
interface StreamingReadSupport extends ReadSupport {
29+
@VisibleForTesting
30+
public interface StreamingReadSupport extends ReadSupport {
2831

2932
/**
3033
* Returns the initial offset for a streaming query to start reading from. Note that the

0 commit comments

Comments
 (0)