public boolean moveEntry (Uid newUid) throws ObjectStoreException { InputObjectState state = _recoveryStore.read_committed(newUid, _typeName); boolean res = false; if (state != null) // just in case recovery // kicked-in { boolean moved = _recoveryStore.write_committed(newUid, _movedTypeName, new OutputObjectState(state)); if (!moved) { tsLogger.i18NLogger.info_recovery_ExpiredTransactionStatusManagerScanner_3(newUid); } else res = _recoveryStore.remove_committed(newUid, _typeName); } return res; }
public int currentState (Uid u, String tn) throws ObjectStoreException { return rs.currentState (u, tn); }
public boolean hide_state (Uid u, String tn) throws ObjectStoreException { return rs.hide_state (u, tn); }
private static Set<Uid> getUids(Set<Uid> uids, String type) { try { RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); InputObjectState states = new InputObjectState(); if (recoveryStore.allObjUids(type, states) && states.notempty()) { boolean finished = false; do { Uid uid = UidHelper.unpackFrom(states); if (uid.notEquals(Uid.nullUid())) { uids.add(uid); } else { finished = true; } } while (!finished); } } catch (Exception e) { e.printStackTrace(); } return uids; }
private void clearObjectStore() throws Exception { final InputObjectState uids = new InputObjectState(); recoveryStore.allObjUids(ATOMIC_ACTION_TYPE, uids); for (Uid uid = UidHelper.unpackFrom(uids); !uid.equals(Uid.nullUid()); uid = UidHelper.unpackFrom(uids)) { recoveryStore.remove_committed(uid, ATOMIC_ACTION_TYPE); } }
public boolean doRemove() { try { if (StoreManager.getRecoveryStore().remove_committed(getUid(), _uidWrapper.getType())) return true; if (tsLogger.logger.isDebugEnabled()) tsLogger.logger.debugf("%s %s", REMOVE_NOK_1, getUid().toString()); return false; } catch (ObjectStoreException e) { if (tsLogger.logger.isDebugEnabled()) tsLogger.logger.debugf("%s %s - %s", REMOVE_NOK_1, getUid().toString(), e.getMessage()); return false; } }
public ObjectStateWrapper allObjUids(String type) throws ObjectStoreException { InputObjectState ios = new InputObjectState(); boolean ok = rs.allObjUids (type, ios); return new ObjectStateWrapper(ios, ok); }
public ObjectStateWrapper allTypes() throws ObjectStoreException { InputObjectState ios = new InputObjectState(); boolean ok = rs.allTypes(ios); return new ObjectStateWrapper(ios, ok); }
private void moveRecord(Uid uid, String from, String to) throws ObjectStoreException { RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); InputObjectState state = recoveryStore.read_committed(uid, from); if (state != null) { if (!recoveryStore.write_committed(uid, to, new OutputObjectState( state))) { tsLogger.logger.error("Could not move an: " + to + " uid: " + uid); } else if (!recoveryStore.remove_committed(uid, from)) { tsLogger.logger.error("Could not remove a: " + from + " uid: " + uid); } } else { tsLogger.logger .error("Could not read an: " + from + " uid: " + uid); } }
public boolean moveEntry (Uid newUid) throws ObjectStoreException { InputObjectState state = _recoveryStore.read_committed(newUid, _typeName); boolean res = false; if (state != null) // just in case recovery // kicked-in { boolean moved = _recoveryStore.write_committed(newUid, _movedTypeName, new OutputObjectState(state)); if (!moved) { tsLogger.logger.debugf("Removing old transaction status manager item %s", newUid); } else { res = _recoveryStore.remove_committed(newUid, _typeName); tsLogger.i18NLogger.warn_recovery_ExpiredTransactionStatusManagerScanner_6(newUid); } } return res; }
public void removeParticipantInformation(final ParticipantInformation participantInformation) { if (LOG.isTraceEnabled()) { LOG.trace("RecoveryManager.removeParticipantInformation: participantInformation=" + participantInformation); } final RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); final Uid uid = new Uid(participantInformation.getId()); try { recoveryStore.remove_committed(uid, PARTICIPANT_INFORMATION_RECORD_TYPE); } catch (ObjectStoreException e) { LOG.warn("Failure while removing participant information from the object store.", e); } }
public void persistParticipantInformation(final ParticipantInformation participantInformation) { if (LOG.isTraceEnabled()) { LOG.trace("RecoveryManager.persistParticipantInformation: participantInformation=" + participantInformation); } if (!isRecoverableParticipant(participantInformation.getParticipant())) { if (LOG.isTraceEnabled()) { LOG.trace("RecoveryManager.persistParticipantInformation: participant is not recoverable"); } return; } try { final RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); final OutputObjectState state = getParticipantInformationOutputState(participantInformation); final Uid uid = new Uid(participantInformation.getId()); recoveryStore.write_committed(uid, PARTICIPANT_INFORMATION_RECORD_TYPE, state); } catch (Exception e) { LOG.warn("Failure while persisting participant information.", e); } }
private boolean containsCommitMarkableResourceRecord(Uid u) { try { InputObjectState state = StoreManager.getRecoveryStore().read_committed( u, RecoverConnectableAtomicAction.CONNECTABLE_ATOMIC_ACTION_TYPE); if (state != null) { RecoverConnectableAtomicAction rcaa = new RecoverConnectableAtomicAction(RecoverConnectableAtomicAction.CONNECTABLE_ATOMIC_ACTION_TYPE, u, state); return (rcaa.containsIncompleteCommitMarkableResourceRecord()); } } catch (ObjectStoreException e) { } catch (IOException e) { } return false; }
/** * Remove this AtomicAction from the ObjectStore * @return a textual indication of whether the remove operation succeeded */ public String remove() { try { if (!StoreManager.getRecoveryStore().remove_committed(getUid(), getType())) return "Attempt to remove transaction failed"; else w.probe(); return "Transaction successfully removed"; } catch (ObjectStoreException e) { return "Unable to remove transaction: " + e.getMessage(); } }
public StateManagerWrapper(RecoveryStore os, Uid uid, String type) { super(uid); try { unpackHeader(os.read_committed(uid, type)); } catch (IOException e) { tsLogger.i18NLogger.info_osb_StateManagerWrapperFail(e); } catch (ObjectStoreException e) { tsLogger.i18NLogger.info_osb_StateManagerWrapperFail(e); } }
public ObjectStateWrapper read_committed (Uid u, String tn) throws ObjectStoreException { InputObjectState ios = rs.read_committed (u, tn); return new ObjectStateWrapper(ios); }
public boolean isType (Uid u, String tn, int st) throws ObjectStoreException { return rs.isType (u, tn, st); } }
public boolean reveal_state (Uid u, String tn) throws ObjectStoreException { return rs.reveal_state (u, tn); }
private boolean saveMe () { try { OutputObjectState objstate = new OutputObjectState(); if (save_state(objstate)) { getStore().write_committed(_uid, _pseudoTypeName, objstate); return true; } } catch (ObjectStoreException exo) { jtsLogger.i18NLogger.warn_recovery_contact_FactoryContactItem_1(exo); } return false; }
private final void listLogs (String type) throws IOException { InputObjectState buff = new InputObjectState(); try { if (StoreManager.getRecoveryStore().allObjUids(type, buff)) { Uid u = null; do { u = UidHelper.unpackFrom(buff); if (Uid.nullUid().notEquals(u)) { System.out.println("Log: " + u); } } while (Uid.nullUid().notEquals(u)); } } catch (final ObjectStoreException ex) { throw new IOException(); } }