private void positionReaderAtCheckpoint() { CheckpointData checkpointData = getStepThreadInstance().getCheckpointData(); // check for data in backing store if (checkpointData != null) { Serializable checkpointInfo = checkpointData.getReaderCheckpoint(); readerProxy.open(checkpointInfo); } else { // An entry always should have been inserted by now, even if it wrappers a null value returned by checkpointInfo() String msg = "Didn't find checkpoint data for stepThreadInstance = " + getStepThreadInstance(); throw new IllegalStateException(msg); } }
private void positionReaderAtCheckpoint() { _persistenceManagerService = servicesManager.getPersistenceManagerService(); readerChkptDK = new CheckpointDataKey(jobExecutionImpl.getJobInstance().getInstanceId(), step.getId(), "READER"); CheckpointData readerData = _persistenceManagerService.getCheckpointData(readerChkptDK); try { // check for data in backing store if (readerData != null) { byte[] readertoken = readerData.getRestartToken(); ByteArrayInputStream readerChkptBA = new ByteArrayInputStream(readertoken); TCCLObjectInputStream readerOIS = null; try { readerOIS = new TCCLObjectInputStream(readerChkptBA); readerProxy.open((Serializable) readerOIS.readObject()); readerOIS.close(); } catch (Exception ex) { // is this what I should be throwing here? throw new BatchContainerServiceException("Cannot persist the checkpoint data for [" + step.getId() + "]", ex); } } else { // no chkpt data exists in the backing store readerData = null; readerProxy.open(null); } } catch (ClassCastException e) { throw new IllegalStateException("Expected CheckpointData but found" + readerData); } }
private void positionReaderAtCheckpoint() { _persistenceManagerService = servicesManager.getPersistenceManagerService(); readerChkptDK = new CheckpointDataKey(jobExecutionImpl.getJobInstance().getInstanceId(), step.getId(), "READER"); CheckpointData readerData = _persistenceManagerService.getCheckpointData(readerChkptDK); try { // check for data in backing store if (readerData != null) { byte[] readertoken = readerData.getRestartToken(); ByteArrayInputStream readerChkptBA = new ByteArrayInputStream(readertoken); TCCLObjectInputStream readerOIS = null; try { readerOIS = new TCCLObjectInputStream(readerChkptBA); readerProxy.open((Serializable) readerOIS.readObject()); readerOIS.close(); } catch (Exception ex) { // is this what I should be throwing here? throw new BatchContainerServiceException("Cannot persist the checkpoint data for [" + step.getId() + "]", ex); } } else { // no chkpt data exists in the backing store readerData = null; readerProxy.open(null); } } catch (ClassCastException e) { throw new IllegalStateException("Expected CheckpointData but found" + readerData); } }
private void openReaderAndWriter() { String sourceMethod = "openReaderAndWriter"; if (logger.isLoggable(Level.FINE)) logger.entering(sourceClass, sourceMethod); CheckpointData checkpointData = getStepThreadInstance().getCheckpointData(); if (checkpointData != null) { Serializable readerChkpt = checkpointData.getReaderCheckpoint(); readerProxy.open(readerChkpt); Serializable writerChkpt = checkpointData.getWriterCheckpoint(); writerProxy.open(writerChkpt); } else { //Cannot have a null checkpointData if a rollback is to be performed try { checkpointData = new CheckpointData(); checkpointData.setReaderCheckpoint(null); checkpointData.setWriterCheckpoint(null); getStepThreadInstance().setCheckpointData(checkpointData); } catch (Exception ex) { throw new BatchContainerServiceException("Cannot persist the checkpoint data for " + getStepThreadInstance()); } // Null is a valid value to indicate there hasn't been a checkpoint yet. readerProxy.open(null); writerProxy.open(null); } if (logger.isLoggable(Level.FINE)) logger.exiting(sourceClass, sourceMethod); }