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; }
public boolean save_state (OutputObjectState os, int ot) { boolean res = true; if ((targetParticipantStore != null) && (objectUid.notEquals(Uid.nullUid()))) { try { UidHelper.packInto(objectUid, os); os.packString(typeName); res = (res && super.save_state(os, ot)); } catch (IOException e) { tsLogger.i18NLogger.warn_DisposeRecord_2(); res = false; } } else { tsLogger.i18NLogger.warn_DisposeRecord_3(); res = false; } return res; }
InputObjectState uids = new InputObjectState() ; if ( _recoveryStore.allObjUids(_itemTypeName, uids) ) theUid = UidHelper.unpackFrom(uids); if (theUid.equals(Uid.nullUid())) endOfUids = true ; else Uid newUid = new Uid(theUid) ; tsLogger.i18NLogger.info_recovery_ExpiredTransactionStatusManagerScanner_3(newUid); _recoveryStore.remove_committed( newUid, _itemTypeName ) ; tsLogger.i18NLogger.info_recovery_ExpiredTransactionStatusManagerScanner_3(newUid);
public final InputObjectState allObjUids () throws ObjectStoreException { OutputObjectState state = new OutputObjectState(); Iterator<Uid> iter = _ids.keySet().iterator(); try { while (iter.hasNext()) { UidHelper.packInto(iter.next(), state); } // don't forget to null terminate UidHelper.packInto(Uid.nullUid(), state); } catch (final IOException ex) { throw new ObjectStoreException(ex); } return new InputObjectState(state); }
Uid processUid = null; String myState = os.unpackString(); txId = UidHelper.unpackFrom(os); if (!txId.equals(Uid.nullUid())) processUid = UidHelper.unpackFrom(os); tsLogger.i18NLogger.warn_StateManager_9(); throw new IOException(tsLogger.i18NLogger.get_StateManager_15()); long birthDate = os.unpackLong();
typeName = typeName.substring(1); try { OutputObjectState store = new OutputObjectState(); theUid = new Uid(rs.getString(1)); UidHelper.packInto(theUid, store); } catch (IOException ex) { tsLogger.i18NLogger.warn_objectstore_JDBCImple_5(ex); tsLogger.i18NLogger.warn_objectstore_JDBCImple_4(e); connection.close(); } catch (Exception e) { tsLogger.i18NLogger.warn_objectstore_JDBCImple_4(e); } finally { if (rs != null) UidHelper.packInto(Uid.nullUid(), store); state.setBuffer(store.buffer());
RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); + recoveryStore.currentState(new Uid(uid), type)); InputObjectState buff = new InputObjectState(); recoveryStore.allObjUids(type, buff, StateStatus.OS_UNCOMMITTED); Uid u = UidHelper.unpackFrom(buff);
private int getUidsCountInStore() throws Exception { final InputObjectState uids = new InputObjectState(); recoveryStore.allObjUids(ATOMIC_ACTION_TYPE, uids); int counter = 0; for (Uid uid = UidHelper.unpackFrom(uids); !uid.equals(Uid.nullUid()); uid = UidHelper.unpackFrom(uids)) { counter++; } return counter; }
public boolean restore_state (InputObjectState os, int ot) { boolean res = true; try { objectUid = UidHelper.unpackFrom(os); typeName = os.unpackString(); res = (res && super.restore_state(os, ot)); } catch (final Exception e) { res = false; } return res; }
/** * return the Uids from the list one at a time. ObjStore returns either null * list or a list terminated by the NIL_UID. Use the latter to return 0 (for * end of list) * @throws IOException */ public final synchronized Uid iterate () throws IOException { Uid newUid = null; newUid = UidHelper.unpackFrom(uidList); return newUid; }
private void packUid(OutputObjectState store, Uid uid) throws ObjectStoreException { try { UidHelper.packInto(uid, store); } catch (IOException e) { throw new ObjectStoreException("TypedVolatileStore::packUid - could not pack uid: " + e.getMessage()); } }
InputObjectState uids = new InputObjectState() ; if ( _recoveryStore.allObjUids(_itemTypeName, uids) ) theUid = UidHelper.unpackFrom(uids); if (theUid.equals(Uid.nullUid())) endOfUids = true ; else Uid newUid = new Uid(theUid) ; tsLogger.i18NLogger.info_recovery_ExpiredTransactionStatusManagerScanner_3(newUid); _recoveryStore.remove_committed( newUid, _itemTypeName ) ; tsLogger.i18NLogger.info_recovery_ExpiredTransactionStatusManagerScanner_3(newUid);
public final InputObjectState allObjUids () throws ObjectStoreException { OutputObjectState state = new OutputObjectState(); Iterator<Uid> iter = _ids.keySet().iterator(); try { while (iter.hasNext()) { UidHelper.packInto(iter.next(), state); } // don't forget to null terminate UidHelper.packInto(Uid.nullUid(), state); } catch (final IOException ex) { throw new ObjectStoreException(ex); } return new InputObjectState(state); }
Uid processUid = null; String myState = os.unpackString(); txId = UidHelper.unpackFrom(os); if (!txId.equals(Uid.nullUid())) processUid = UidHelper.unpackFrom(os); tsLogger.i18NLogger.warn_StateManager_9(); throw new IOException(tsLogger.i18NLogger.get_StateManager_15()); long birthDate = os.unpackLong();
typeName = typeName.substring(1); try { OutputObjectState store = new OutputObjectState(); theUid = new Uid(rs.getString(1)); UidHelper.packInto(theUid, store); } catch (IOException ex) { tsLogger.i18NLogger.warn_objectstore_JDBCImple_5(ex); tsLogger.i18NLogger.warn_objectstore_JDBCImple_4(e); connection.close(); } catch (Exception e) { tsLogger.i18NLogger.warn_objectstore_JDBCImple_4(e); } finally { if (rs != null) UidHelper.packInto(Uid.nullUid(), store); state.setBuffer(store.buffer());
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 restore_state (InputObjectState os, int ot) { boolean res = true; try { objectUid = UidHelper.unpackFrom(os); typeName = os.unpackString(); res = (res && super.restore_state(os, ot)); } catch (final Exception e) { res = false; } return res; }
/** * return the Uids from the list one at a time. ObjStore returns either null * list or a list terminated by the NIL_UID. Use the latter to return 0 (for * end of list) * @throws IOException */ public final synchronized Uid iterate () throws IOException { Uid newUid = null; newUid = UidHelper.unpackFrom(uidList); return newUid; }
private void packUid(OutputObjectState store, Uid uid) throws ObjectStoreException { try { UidHelper.packInto(uid, store); } catch (IOException e) { throw new ObjectStoreException("TypedVolatileStore::packUid - could not pack uid: " + e.getMessage()); } }
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(); } }