public ObjectStateWrapper allObjUids(String type) throws ObjectStoreException { InputObjectState ios = new InputObjectState(); boolean ok = rs.allObjUids (type, ios); return new ObjectStateWrapper(ios, ok); }
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 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); }
/** * Read the object's committed state. * * @param uid The object to work on. * @param typeName The type of the object to work on. * @return the state of the object. * @throws ObjectStoreException if things go wrong. */ public InputObjectState read_committed(Uid uid, String typeName) throws ObjectStoreException { RecordInfo record = getContentForType(typeName).get(uid); if(record == null) { return null; } // this repeated unpacking is a little inefficient - subclass RecordInfo to hold unpacked form too? // not too much of an issue as log reads are done for recovery only. try { InputBuffer inputBuffer = new InputBuffer(record.data); Uid unpackedUid = UidHelper.unpackFrom(inputBuffer); String unpackedTypeName = inputBuffer.unpackString(); InputObjectState inputObjectState = new InputObjectState(uid, typeName, inputBuffer.unpackBytes()); return inputObjectState; } catch(Exception e) { throw new ObjectStoreException(e); } }
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 ObjectStateWrapper allObjUids(String type, int m) throws ObjectStoreException { InputObjectState ios = new InputObjectState(); boolean ok = rs.allObjUids (type, ios, m); return new ObjectStateWrapper(ios, ok); }
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); }
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(); } }
public ObjectStateWrapper allObjUids(String type) throws ObjectStoreException { InputObjectState ios = new InputObjectState(); boolean ok = rs.allObjUids (type, ios); return new ObjectStateWrapper(ios, ok); }
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); }
throws ObjectStoreException InputObjectState ios = new InputObjectState(); Uid tempUid = new Uid(Uid.nullUid()); tempUid = UidHelper.unpackFrom(ios); if (tempUid.equals(objUid)) return StateStatus.OS_COMMITTED; } while (tempUid.notEquals(Uid.nullUid()));
public ObjectStateWrapper allObjUids(String type) throws ObjectStoreException { InputObjectState ios = new InputObjectState(); boolean ok = rs.allObjUids (type, ios); return new ObjectStateWrapper(ios, ok); }
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); }
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(); } }
public ObjectStateWrapper allObjUids(String type, int m) throws ObjectStoreException { InputObjectState ios = new InputObjectState(); boolean ok = rs.allObjUids (type, ios, m); return new ObjectStateWrapper(ios, ok); }
public InputObjectState getIOS() { if (getBuff() == null || getBuff().length == 0) return null; Uid u = getNewUid() == null ? Uid.nullUid() : getNewUid(); String t = gettName() == null ? "" : gettName(); byte[] b = getBuff() == null ? new byte[0] : getBuff(); return new InputObjectState(u, t, b); }
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(); } }
public ObjectStateWrapper allObjUids(String type) throws ObjectStoreException { InputObjectState ios = new InputObjectState(); boolean ok = rs.allObjUids (type, ios); return new ObjectStateWrapper(ios, ok); }
public InputObjectState getIOS() { if (getBuff() == null || getBuff().length == 0) return null; Uid u = getNewUid() == null ? Uid.nullUid() : getNewUid(); String t = gettName() == null ? "" : gettName(); byte[] b = getBuff() == null ? new byte[0] : getBuff(); return new InputObjectState(u, t, b); }
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(); } }