[ 
https://issues.apache.org/jira/browse/FLINK-5325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15851344#comment-15851344
 ] 

ASF GitHub Bot commented on FLINK-5325:
---------------------------------------

Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2992#discussion_r99317280
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/util/AbstractConcurrentClosingRegistry.java
 ---
    @@ -18,37 +18,42 @@
     
     package org.apache.flink.util;
     
    +import javax.annotation.concurrent.GuardedBy;
     import java.io.Closeable;
     import java.io.IOException;
    +import java.util.HashMap;
     import java.util.Map;
     
     /**
    - * This is the abstract base class for registries that allow to register 
instances of {@link Closeable}, which are all
    - * closed if this registry is closed.
    + * This is the abstract base class for registries that allow to register 
instances of {@link Closeable}, which are
    + * all closed if this registry is closed.
      * <p>
      * Registering to an already closed registry will throw an exception and 
close the provided {@link Closeable}
      * <p>
      * All methods in this class are thread-safe.
      *
    - * @param <C> Type of the closeable this registers
    + * @param <C> Type of the {@link Closeable} this registers
      * @param <T> Type for potential meta data associated with the registering 
closeables
      */
    -public abstract class AbstractCloseableRegistry<C extends Closeable, T> 
implements Closeable {
    +public abstract class AbstractConcurrentClosingRegistry<C extends 
Closeable, T> implements Closeable {
    --- End diff --
    
    Why is this not `AbstractConcurrentClosableRegistry`?


> Introduce interface for CloseableRegistry to separate user from system-facing 
> functionality
> -------------------------------------------------------------------------------------------
>
>                 Key: FLINK-5325
>                 URL: https://issues.apache.org/jira/browse/FLINK-5325
>             Project: Flink
>          Issue Type: Improvement
>          Components: State Backends, Checkpointing
>            Reporter: Stefan Richter
>            Assignee: Stefan Richter
>
> Currently, the API of {{CloseableRegistry}} exposes the {{close}} method to 
> all client code. We should separate the API into a user-facing interface 
> (allowing only for un/registration of {{Closeable}} and a system-facing part 
> that also exposes the {{close}} method. This prevents users from accidentally 
> calling {{close}}, thus closing resources that other callers registered.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to