private boolean waitForNotScanState(ScanStates state) { try { while (getScanState().equals(state)) { scanState.wait(); } return true; } catch (InterruptedException e) { tsLogger.logger.warn("problem waiting for scanLock whilst in state " + state.name(), e); return false; } }
private boolean waitForNotScanState(ScanStates state) { try { while (getScanState().equals(state)) { scanState.wait(); } return true; } catch (InterruptedException e) { tsLogger.logger.warn("problem waiting for scanLock whilst in state " + state.name(), e); return false; } }
/** * Update the status of the scanner * @param state the new state */ private void setScanState(ScanStates state) { synchronized (scanState) { tsLogger.logger.debugf("XARecoveryModule state change %s->%s%n", getScanState(), state); scanState.set(state.ordinal()); scanState.notifyAll(); } }
private boolean waitForNotScanState(ScanStates state) { try { while (getScanState().equals(state)) { scanState.wait(); } return true; } catch (InterruptedException e) { tsLogger.logger.warn("problem waiting for scanLock whilst in state " + state.name(), e); return false; } }
/** * Update the status of the scanner * @param state the new state */ private void setScanState(ScanStates state) { synchronized (scanState) { tsLogger.logger.debugf("XARecoveryModule state change %s->%s%n", getScanState(), state); scanState.set(state.ordinal()); scanState.notifyAll(); } }
/** * Update the status of the scanner * @param state the new state */ private void setScanState(ScanStates state) { synchronized (scanState) { tsLogger.logger.debugf("XARecoveryModule state change %s->%s%n", getScanState(), state); scanState.set(state.ordinal()); scanState.notifyAll(); } }
private boolean waitForNotScanState(ScanStates state) { try { while (getScanState().equals(state)) { scanState.wait(); } return true; } catch (InterruptedException e) { tsLogger.logger.warn("problem waiting for scanLock whilst in state " + state.name(), e); return false; } }
/** * Update the status of the scanner * @param state the new state */ private void setScanState(ScanStates state) { synchronized (scanState) { tsLogger.logger.debugf("XARecoveryModule state change %s->%s%n", getScanState(), state); scanState.set(state.ordinal()); scanState.notifyAll(); } }
/** * Update the status of the scanner * @param state the new state */ private void setScanState(ScanStates state) { synchronized (scanState) { tsLogger.logger.debugf("XARecoveryModule state change %s->%s%n", getScanState(), state); scanState.set(state.ordinal()); scanState.notifyAll(); } }
/** * Wait until scanner reaches a specific target state. * Must be called holding a lock on scanState. * @param state the target scan state to wait for * @return false if the thread was interrupted */ private boolean waitForScanState(ScanStates state) { try { do { scanState.wait(); } while (!getScanState().equals(state)); return true; } catch (InterruptedException e) { tsLogger.logger.warn("problem waiting for scanLock whilst in state " + state.name(), e); return false; } } private boolean waitForNotScanState(ScanStates state) {
/** * Wait until scanner reaches a specific target state. * Must be called holding a lock on scanState. * @param state the target scan state to wait for * @return false if the thread was interrupted */ private boolean waitForScanState(ScanStates state) { try { do { scanState.wait(); } while (!getScanState().equals(state)); return true; } catch (InterruptedException e) { tsLogger.logger.warn("problem waiting for scanLock whilst in state " + state.name(), e); return false; } } private boolean waitForNotScanState(ScanStates state) {
/** * Wait until scanner reaches a specific target state. * Must be called holding a lock on scanState. * @param state the target scan state to wait for * @return false if the thread was interrupted */ private boolean waitForScanState(ScanStates state) { try { do { scanState.wait(); } while (!getScanState().equals(state)); return true; } catch (InterruptedException e) { tsLogger.logger.warn("problem waiting for scanLock whilst in state " + state.name(), e); return false; } } private boolean waitForNotScanState(ScanStates state) {
/** * Wait until scanner reaches a specific target state. * Must be called holding a lock on scanState. * @param state the target scan state to wait for * @return false if the thread was interrupted */ private boolean waitForScanState(ScanStates state) { try { do { scanState.wait(); } while (!getScanState().equals(state)); return true; } catch (InterruptedException e) { tsLogger.logger.warn("problem waiting for scanLock whilst in state " + state.name(), e); return false; } }
/** * Wait until scanner reaches a specific target state. * Must be called holding a lock on scanState. * @param state the target scan state to wait for * @return false if the thread was interrupted */ private boolean waitForScanState(ScanStates state) { try { do { scanState.wait(); } while (!getScanState().equals(state)); return true; } catch (InterruptedException e) { tsLogger.logger.warn("problem waiting for scanLock whilst in state " + state.name(), e); return false; } } private boolean waitForNotScanState(ScanStates state) {
if (!getScanState().equals(ScanStates.IDLE)) { else if (getScanState().equals(ScanStates.BETWEEN_PASSES)) { synchronized (this) { // Because we need to remove the _resources XAResource[] xaResources = recoveryHelpersXAResource.get(xaResourceRecoveryHelper);
if (!getScanState().equals(ScanStates.IDLE)) { else if (getScanState().equals(ScanStates.BETWEEN_PASSES)) { synchronized (this) { // Because we need to remove the _resources XAResource[] xaResources = recoveryHelpersXAResource.get(xaResourceRecoveryHelper);
if (!getScanState().equals(ScanStates.IDLE)) { else if (getScanState().equals(ScanStates.BETWEEN_PASSES)) { synchronized (this) { // Because we need to remove the _resources XAResource[] xaResources = recoveryHelpersXAResource.get(xaResourceRecoveryHelper);
public void removeXAResourceRecoveryHelper(XAResourceRecoveryHelper xaResourceRecoveryHelper) { synchronized (scanState) { if (getScanState().equals(ScanStates.FIRST_PASS)) { // the first pass collects xa resources from recovery helpers - wait for it to finish waitForScanState(ScanStates.BETWEEN_PASSES); if (getScanState().equals(ScanStates.BETWEEN_PASSES)) { /* * check whether any resources found in the first pass were provided by * the target xaResourceRecoveryHelper and if so then we need to wait for second pass * of the scanner to finish */ if (isHelperInUse(xaResourceRecoveryHelper)) waitForScanState(ScanStates.IDLE); } } else if (!getScanState().equals(ScanStates.IDLE)) { // scanner is in pass 2 or in between passes if (isHelperInUse(xaResourceRecoveryHelper)) waitForScanState(ScanStates.IDLE); } _xaResourceRecoveryHelpers.remove(xaResourceRecoveryHelper); } }
public synchronized void periodicWorkSecondPass() if (getScanState() == ScanStates.IDLE) {
public synchronized void periodicWorkSecondPass() if (getScanState() == ScanStates.IDLE) {