You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2021/11/26 08:56:07 UTC

[flink] branch master updated (4a91354 -> c6af21f)

This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git.


    from 4a91354  [FLINK-25064][rest] Remove incorrect @VisibleForTesting
     new bca54f3  [hotfix][tests] Extract originOwner variable
     new 481bb71  [FLINK-25063][tests] Allow @VisibleForTesting calls from enclosing class
     new c6af21f  [hotfix][tests] Allow @VisibleForTesting calls from static inner classes

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../flink/architecture/rules/ApiAnnotationRules.java   | 18 ++++++++++++------
 .../violations/e5126cae-f3fe-48aa-b6fb-60ae6cc3fcd5    |  5 -----
 2 files changed, 12 insertions(+), 11 deletions(-)

[flink] 02/03: [FLINK-25063][tests] Allow @VisibleForTesting calls from enclosing class

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 481bb718c526b18ca92dff4659ae10e1f781dd8d
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Thu Nov 25 15:47:04 2021 +0100

    [FLINK-25063][tests] Allow @VisibleForTesting calls from enclosing class
---
 .../org/apache/flink/architecture/rules/ApiAnnotationRules.java     | 6 ++++++
 .../violations/e5126cae-f3fe-48aa-b6fb-60ae6cc3fcd5                 | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java b/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java
index 9f7078a..1402612 100644
--- a/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java
+++ b/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java
@@ -148,6 +148,12 @@ public class ApiAnnotationRules {
                                                             .orElse(false)) {
                                                 return false;
                                             }
+                                            if (targetOwner
+                                                    .getEnclosingClass()
+                                                    .map(originOwner::equals)
+                                                    .orElse(false)) {
+                                                return false;
+                                            }
 
                                             return call.getTarget()
                                                     .isAnnotatedWith(VisibleForTesting.class);
diff --git a/flink-architecture-tests/violations/e5126cae-f3fe-48aa-b6fb-60ae6cc3fcd5 b/flink-architecture-tests/violations/e5126cae-f3fe-48aa-b6fb-60ae6cc3fcd5
index f5e3ff0..67bd28c 100644
--- a/flink-architecture-tests/violations/e5126cae-f3fe-48aa-b6fb-60ae6cc3fcd5
+++ b/flink-architecture-tests/violations/e5126cae-f3fe-48aa-b6fb-60ae6cc3fcd5
@@ -1,4 +1,3 @@
-Constructor <org.apache.flink.runtime.scheduler.exceptionhistory.ExceptionHistoryEntry.<init>(java.lang.Throwable, long, java.lang.String, org.apache.flink.runtime.taskmanager.TaskManagerLocation)> calls method <org.apache.flink.runtime.scheduler.exceptionhistory.ExceptionHistoryEntry$ArchivedTaskManagerLocation.fromTaskManagerLocation(org.apache.flink.runtime.taskmanager.TaskManagerLocation)> in (ExceptionHistoryEntry.java:90)
 Constructor <org.apache.flink.runtime.state.heap.CopyOnWriteStateMapSnapshot.<init>(org.apache.flink.runtime.state.heap.CopyOnWriteStateMap)> calls method <org.apache.flink.runtime.state.heap.CopyOnWriteStateMap.snapshotMapArrays()> in (CopyOnWriteStateMapSnapshot.java:86)
 Constructor <org.apache.flink.streaming.api.operators.StreamingRuntimeContext.<init>(org.apache.flink.streaming.api.operators.AbstractStreamOperator, org.apache.flink.runtime.execution.Environment, java.util.Map)> calls method <org.apache.flink.streaming.api.operators.AbstractStreamOperator.getProcessingTimeService()> in (StreamingRuntimeContext.java:85)
 Constructor <org.apache.flink.streaming.runtime.io.StreamTaskExternallyInducedSourceInput.<init>(org.apache.flink.streaming.api.operators.SourceOperator, java.util.function.Consumer, int, int)> calls method <org.apache.flink.streaming.api.operators.SourceOperator.getSourceReader()> in (StreamTaskExternallyInducedSourceInput.java:39)
@@ -31,7 +30,6 @@ Method <org.apache.flink.runtime.io.network.partition.consumer.RemoteInputChanne
 Method <org.apache.flink.runtime.operators.coordination.RecreateOnResetOperatorCoordinator$DeferrableCoordinator.closeAsync(long)> calls method <org.apache.flink.runtime.operators.coordination.RecreateOnResetOperatorCoordinator$QuiesceableContext.quiesce()> in (RecreateOnResetOperatorCoordinator.java:319)
 Method <org.apache.flink.runtime.state.heap.HeapKeyedStateBackend.numKeyValueStateEntries(java.lang.Object)> calls method <org.apache.flink.runtime.state.heap.StateTable.sizeOfNamespace(java.lang.Object)> in (HeapKeyedStateBackend.java:391)
 Method <org.apache.flink.runtime.state.heap.StateTable.sizeOfNamespace(java.lang.Object)> calls method <org.apache.flink.runtime.state.heap.StateMap.sizeOfNamespace(java.lang.Object)> in (StateTable.java:361)
-Method <org.apache.flink.runtime.taskexecutor.TaskExecutor.registerNewJobAndCreateServices(org.apache.flink.api.common.JobID, java.lang.String)> calls method <org.apache.flink.runtime.taskexecutor.TaskExecutor$TaskExecutorJobServices.create(org.apache.flink.runtime.execution.librarycache.LibraryCacheManager$ClassLoaderLease, java.lang.Runnable)> in (TaskExecutor.java:1121)
 Method <org.apache.flink.runtime.taskexecutor.TaskManagerConfiguration.fromConfiguration(org.apache.flink.configuration.Configuration, org.apache.flink.runtime.taskexecutor.TaskExecutorResourceSpec, java.lang.String)> calls method <org.apache.flink.runtime.taskexecutor.TaskExecutorResourceUtils.generateDefaultSlotResourceProfile(org.apache.flink.runtime.taskexecutor.TaskExecutorResourceSpec, int)> in (TaskManagerConfiguration.java:236)
 Method <org.apache.flink.runtime.taskexecutor.TaskManagerConfiguration.fromConfiguration(org.apache.flink.configuration.Configuration, org.apache.flink.runtime.taskexecutor.TaskExecutorResourceSpec, java.lang.String)> calls method <org.apache.flink.runtime.taskexecutor.TaskExecutorResourceUtils.generateTotalAvailableResourceProfile(org.apache.flink.runtime.taskexecutor.TaskExecutorResourceSpec)> in (TaskManagerConfiguration.java:238)
 Method <org.apache.flink.runtime.taskexecutor.TaskManagerServices.createTaskSlotTable(int, org.apache.flink.runtime.taskexecutor.TaskExecutorResourceSpec, long, int, java.util.concurrent.Executor)> calls method <org.apache.flink.runtime.taskexecutor.TaskExecutorResourceUtils.generateDefaultSlotResourceProfile(org.apache.flink.runtime.taskexecutor.TaskExecutorResourceSpec, int)> in (TaskManagerServices.java:387)
@@ -42,13 +40,10 @@ Method <org.apache.flink.streaming.api.operators.InternalTimeServiceManagerImpl.
 Method <org.apache.flink.streaming.api.operators.SourceOperator$1$1.asClassLoader()> calls method <org.apache.flink.streaming.api.operators.SourceOperator.getRuntimeContext()> in (SourceOperator.java:250)
 Method <org.apache.flink.streaming.api.operators.SourceOperator$1$1.registerReleaseHookIfAbsent(java.lang.String, java.lang.Runnable)> calls method <org.apache.flink.streaming.api.operators.SourceOperator.getRuntimeContext()> in (SourceOperator.java:256)
 Method <org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer.getTransactionCoordinatorId()> calls method <org.apache.flink.streaming.connectors.kafka.internals.FlinkKafkaInternalProducer.getTransactionCoordinatorId()> in (FlinkKafkaProducer.java:1327)
-Method <org.apache.flink.streaming.connectors.kafka.internals.KafkaShuffleFetcher.partitionConsumerRecordsHandler(java.util.List, org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicPartitionState)> calls method <org.apache.flink.streaming.connectors.kafka.internals.KafkaShuffleFetcher$KafkaShuffleElementDeserializer.deserialize(org.apache.kafka.clients.consumer.ConsumerRecord)> in (KafkaShuffleFetcher.java:108)
 Method <org.apache.flink.streaming.runtime.tasks.SourceOperatorStreamTask.init()> calls method <org.apache.flink.streaming.api.operators.SourceOperator.getSourceReader()> in (SourceOperatorStreamTask.java:72)
 Method <org.apache.flink.streaming.runtime.tasks.StreamTask.isMailboxLoopRunning()> calls method <org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.isMailboxLoopRunning()> in (StreamTask.java:801)
 Method <org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxStep()> calls method <org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxStep()> in (StreamTask.java:796)
 Method <org.apache.flink.streaming.runtime.tasks.mailbox.MailboxExecutorImpl.isIdle()> calls method <org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.isDefaultActionAvailable()> in (MailboxExecutorImpl.java:63)
-Method <org.apache.flink.table.catalog.CatalogManager.getPermanentTable(org.apache.flink.table.catalog.ObjectIdentifier)> calls method <org.apache.flink.table.catalog.CatalogManager$TableLookupResult.permanent(org.apache.flink.table.catalog.Catalog, org.apache.flink.table.catalog.ResolvedCatalogBaseTable)> in (CatalogManager.java:428)
-Method <org.apache.flink.table.catalog.CatalogManager.getTable(org.apache.flink.table.catalog.ObjectIdentifier)> calls method <org.apache.flink.table.catalog.CatalogManager$TableLookupResult.temporary(org.apache.flink.table.catalog.ResolvedCatalogBaseTable)> in (CatalogManager.java:394)
 Method <org.apache.flink.table.catalog.hive.util.HiveTableUtil.instantiateHiveTable(org.apache.flink.table.catalog.ObjectPath, org.apache.flink.table.catalog.CatalogBaseTable, org.apache.hadoop.hive.conf.HiveConf)> calls method <org.apache.flink.table.catalog.hive.HiveCatalog.isHiveTable(java.util.Map)> in (HiveTableUtil.java:379)
 Method <org.apache.flink.table.data.writer.BinaryArrayWriter.getSegments()> calls method <org.apache.flink.table.data.writer.AbstractBinaryWriter.getSegments()> in (BinaryArrayWriter.java:30)
 Method <org.apache.flink.table.data.writer.BinaryRowWriter.getSegments()> calls method <org.apache.flink.table.data.writer.AbstractBinaryWriter.getSegments()> in (BinaryRowWriter.java:27)

[flink] 01/03: [hotfix][tests] Extract originOwner variable

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit bca54f3311d95ff90c2e1dfb17e9e5a539adc879
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Thu Nov 25 15:46:30 2021 +0100

    [hotfix][tests] Extract originOwner variable
---
 .../org/apache/flink/architecture/rules/ApiAnnotationRules.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java b/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java
index e1cc723..9f7078a 100644
--- a/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java
+++ b/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java
@@ -137,11 +137,12 @@ public class ApiAnnotationRules {
                                         @Override
                                         public boolean apply(JavaMethodCall call) {
                                             final JavaClass targetOwner = call.getTargetOwner();
-                                            if (call.getOriginOwner().equals(targetOwner)) {
+                                            final JavaClass originOwner = call.getOriginOwner();
+                                            if (originOwner.equals(targetOwner)) {
                                                 return false;
                                             }
-                                            if (call.getOriginOwner().isInnerClass()
-                                                    && call.getOriginOwner()
+                                            if (originOwner.isInnerClass()
+                                                    && originOwner
                                                             .getEnclosingClass()
                                                             .map(targetOwner::equals)
                                                             .orElse(false)) {

[flink] 03/03: [hotfix][tests] Allow @VisibleForTesting calls from static inner classes

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit c6af21f2036d26012424e50e902b0a9a74c8ccf3
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Thu Nov 25 15:58:26 2021 +0100

    [hotfix][tests] Allow @VisibleForTesting calls from static inner classes
---
 .../org/apache/flink/architecture/rules/ApiAnnotationRules.java  | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java b/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java
index 1402612..e96e3e3 100644
--- a/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java
+++ b/flink-architecture-tests/src/test/java/org/apache/flink/architecture/rules/ApiAnnotationRules.java
@@ -141,11 +141,10 @@ public class ApiAnnotationRules {
                                             if (originOwner.equals(targetOwner)) {
                                                 return false;
                                             }
-                                            if (originOwner.isInnerClass()
-                                                    && originOwner
-                                                            .getEnclosingClass()
-                                                            .map(targetOwner::equals)
-                                                            .orElse(false)) {
+                                            if (originOwner
+                                                    .getEnclosingClass()
+                                                    .map(targetOwner::equals)
+                                                    .orElse(false)) {
                                                 return false;
                                             }
                                             if (targetOwner