@Override public boolean start(MemoryLimitedChunk chunk) { boolean shutdown = false; CheckpointLock lock = null; try { lock = parent.jobRunner.lock(); innerEncode(chunk); } catch (PersistenceDisabledException e) { // Will be retried on restarting. shutdown = true; } finally { chunk.release(); try { if(!shutdown) { // We do want to call the callback even if we threw something, because we // may be waiting to cancel. However we DON'T call it if we are shutting down. synchronized(SplitFileInserterCrossSegmentStorage.this) { encoding = false; } parent.onFinishedEncoding(SplitFileInserterCrossSegmentStorage.this); } } finally { // Callback is part of the persistent job, unlock *after* calling it. if(lock != null) lock.unlock(false, MemoryLimitedJobRunner.THREAD_PRIORITY); } } return true; }
@Override public boolean start(MemoryLimitedChunk chunk) { boolean shutdown = false; CheckpointLock lock = null; try { lock = parent.jobRunner.lock(); innerEncode(chunk); } catch (PersistenceDisabledException e) { // Will be retried on restarting. shutdown = true; } finally { chunk.release(); try { if(!shutdown) { // We do want to call the callback even if we threw something, because we // may be waiting to cancel. However we DON'T call it if we are shutting down. synchronized(SplitFileInserterSegmentStorage.this) { encoding = false; } parent.onFinishedEncoding(SplitFileInserterSegmentStorage.this); } } finally { // Callback is part of the persistent job, unlock *after* calling it. if(lock != null) lock.unlock(false, MemoryLimitedJobRunner.THREAD_PRIORITY); } } return true; }
CheckpointLock lock = null; try { lock = parent.jobRunner.lock(); innerDecode(chunk); } catch (IOException e) {
CheckpointLock lock = null; try { lock = parent.jobRunner.lock(); innerDecode(chunk); } catch (IOException e) {