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

GuoHao edited comment on HDDS-4474 at 11/24/21, 3:08 AM:
---------------------------------------------------------

[~szetszwo] Can you add a `link()` abstract method in 
`org.apache.ratis.statemachine.StateMachine.DataStream`, I will use it in 
`ContainerStateMachine.link(DataStream, LogEntryProto)`

Like this


{code:java}
/**
   * For streaming state machine data.
   */
  interface DataStream {
    /** @return a channel for streaming state machine data. */
    DataChannel getDataChannel();

    /**
     * Clean up asynchronously this stream.
     *
     * When there is an error, this method is invoked to clean up the 
associated resources.
     * If this stream is not yet linked (see {@link DataApi#link(DataStream, 
LogEntryProto)}),
     * the state machine may choose to remove the data or to keep the data 
internally for future recovery.
     * If this stream is already linked, the data must not be removed.
     *
     * @return a future for the cleanup task.
     */
    CompletableFuture<?> cleanUp();

    /**
     * @return an {@link Executor} for executing the streaming tasks of this 
stream.
     *         If the returned value is null, the default {@link Executor} will 
be used.
     */
    default Executor getExecutor() {
      return null;
    }
    
    default void link(LogEntryProto entry) throws IOException {}
  }
{code}





was (Author: nicholas niu):
[~szetszwo] Can you add a `link()` abstract method in 
`org.apache.ratis.statemachine.StateMachine.DataStream`, I will use it in 
`ContainerStateMachine.link(DataStream, LogEntryProto)`

Like this


{code:java}
/**
   * For streaming state machine data.
   */
  interface DataStream {
    /** @return a channel for streaming state machine data. */
    DataChannel getDataChannel();

    /**
     * Clean up asynchronously this stream.
     *
     * When there is an error, this method is invoked to clean up the 
associated resources.
     * If this stream is not yet linked (see {@link DataApi#link(DataStream, 
LogEntryProto)}),
     * the state machine may choose to remove the data or to keep the data 
internally for future recovery.
     * If this stream is already linked, the data must not be removed.
     *
     * @return a future for the cleanup task.
     */
    CompletableFuture<?> cleanUp();

    /**
     * @return an {@link Executor} for executing the streaming tasks of this 
stream.
     *         If the returned value is null, the default {@link Executor} will 
be used.
     */
    default Executor getExecutor() {
      return null;
    }
    
    default void link(LogEntryProto entry){}
  }
{code}




> Use WriteSmallFile to write small file.
> ---------------------------------------
>
>                 Key: HDDS-4474
>                 URL: https://issues.apache.org/jira/browse/HDDS-4474
>             Project: Apache Ozone
>          Issue Type: Sub-task
>            Reporter: runzhiwang
>            Assignee: GuoHao
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2021-11-22-19-40-34-715.png
>
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to