You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flume.apache.org by Shangan Chen <ch...@gmail.com> on 2013/12/05 04:47:04 UTC

will memory channel lose data when stop flume?

When I check the code in Application, I found the stop logic doesn't
guarantee the memory channel is drained out. It seems to stop component
randomly as components are stored in a map. So events in memory channel
might be lost when stopping flume. This can also happen in reload mode. Am
I right ?



   Runtime.*getRuntime*().addShutdownHook(*new* Thread("agent-shutdown-hook")
{

        @Override

        *public* *void* run() {

          appReference.stop();

        }

      });


  *public* *synchronized* *void* stop() {

    supervisor.stop();

    *if*(monitorServer != *null*) {

      monitorServer.stop();

    }

  }

-- 
have a good day!
chenshang'an

Re: will memory channel lose data when stop flume?

Posted by Hari Shreedharan <hs...@cloudera.com>.
Memory Channel will lose the data in memory if the application restarts. If the config is changed and the channel is restarted the data will still be available.

Thanks,
Hari


On Wednesday, December 4, 2013 at 7:47 PM, Shangan Chen wrote:

> When I check the code in Application, I found the stop logic doesn't guarantee the memory channel is drained out. It seems to stop component randomly as components are stored in a map. So events in memory channel might be lost when stopping flume. This can also happen in reload mode. Am I right ? 
>    
>    Runtime.getRuntime().addShutdownHook(new Thread("agent-shutdown-hook") {
>         @Override
>         public void run() {
>           appReference.stop();
>         }
>       });
> 
>   public synchronized void stop() {
>     supervisor.stop();
>     if(monitorServer != null) {
>       monitorServer.stop();
>     }
> 
>   }
> 
> -- 
> have a good day! 
> chenshang'an
>