Author: Matthias J. Sax <matthias@confluent.io>
Reviewers: Ted Yu <yuzhihong@gmail.com>, Damian Guy <damian.guy@gmail.com>, Guozhang Wang <wangguoz@gmail.com>
Closes#3913 from mjsax/kafka-5937-exceptions-processor-state-manager
pull/3913/merge
Matthias J. Sax7 years agocommitted byGuozhang Wang
@ -67,8 +66,7 @@ public class ProcessorStateManager implements StateManager {
@@ -67,8 +66,7 @@ public class ProcessorStateManager implements StateManager {
@ -96,15 +94,7 @@ public class ProcessorStateManager implements StateManager {
@@ -96,15 +94,7 @@ public class ProcessorStateManager implements StateManager {
@ -256,40 +246,49 @@ public class ProcessorStateManager implements StateManager {
@@ -256,40 +246,49 @@ public class ProcessorStateManager implements StateManager {
@Override
publicvoidflush(){
ProcessorStateExceptionfirstException=null;
// attempting to flush the stores
if(!stores.isEmpty()){
log.debug("Flushing all stores registered in the state manager");
for(finalStateStorestore:stores.values()){
log.trace("Flushing store {}",store.name());
try{
log.trace("Flushing store={}",store.name());
store.flush();
}catch(finalExceptione){
thrownewProcessorStateException(String.format("%sFailed to flush state store %s",logPrefix,store.name()),e);
if(firstException==null){
firstException=newProcessorStateException(String.format("%sFailed to flush state store %s",logPrefix,store.name()),e);
}
log.error("Failed to flush state store {}: ",store.name(),e);
firstException=newProcessorStateException(String.format("%sFailed to close state store %s",logPrefix,entry.getKey()),e);
firstException=newProcessorStateException(String.format("%sFailed to close state store %s",logPrefix,store.name()),e);
}
log.error("Failed to close state store {}: ",entry.getKey(),e);
log.error("Failed to close state store {}: ",store.name(),e);
}
}
@ -309,11 +308,11 @@ public class ProcessorStateManager implements StateManager {
@@ -309,11 +308,11 @@ public class ProcessorStateManager implements StateManager {