_purger.trigger(); TransactionData td = getLogName(u, tn, -1); throw new ObjectStoreException(); ArrayList<InputObjectState> states = scanLog(td.container.getName(), tn); if (states.get(i).stateUid().equals(u)) return states.get(i);
OutputObjectState removalState = new OutputObjectState(u, tn); removalState.packBytes(_removedState); if (!write_state(u, tn, removalState, s)) throw new ObjectStoreException(); _purger.addRemovedState(u, tn, s); throw new ObjectStoreException(ex.toString(), ex); throw new ObjectStoreException(ex.toString(), ex); removeFromLog(u);
public void writeRemovalEntries() { synchronized (_entries) { if (_entries.size() > 0) { Collection<LogElement> entries = _entries.values(); Iterator<LogElement> iter = entries.iterator(); while (iter.hasNext()) { LogElement val = iter.next(); try { _objStore.removeState(val.uid, val.tn, val.state); } catch (final Exception ex) { // TODO log warning, but there's nothing else we can do. } } _entries.clear(); } } }
String fname = genPathName(logName, typeName, StateStatus.OS_COMMITTED); File fd = openAndLock(fname, FileLock.F_WRLCK, true); RandomAccessFile iFile = new RandomAccessFile(fd, FILE_MODE); iFile.seek(0); // make sure we're at the start while (iFile.getFilePointer() < iFile.length()) iFile.read(buff); if (!redzoneProtected(buff)) iFile.read(uidString); throw new ObjectStoreException(ex.toString(), ex); unlockAndClose(fd, iFile); iFile = null; if (Arrays.equals(curr.unpackBytes(), _removedState)) curr.reread(); // don't forget to reset the read pointer! deleteEntries(objectStates, deletedLogs); pruneEntries(objectStates); unlockAndClose(fd, iFile);
TransactionData theLogEntry = getLogName(objUid, tName, buffSize); // always adds entry to log LogInstance theLog = theLogEntry.container; throw new ObjectStoreException(); fname = genPathName(theLog.getName(), tName, ft); fd = openAndLock(fname, FileLock.F_WRLCK, true); ofile = new RandomAccessFile(fd, FILE_MODE); ofile.setLength(_maxFileSize); if (theLog.remaining() < buffSize) long size = ofile.length() + buffSize - theLog.remaining(); ofile.setLength(size); unlockAndClose(fd, ofile); unlockAndClose(fd, ofile); unlockAndClose(fd, ofile); if (!unlockAndClose(fd, ofile)) { tsLogger.i18NLogger.warn_objectstore_ShadowingStore_19(fname);
File fd = new File(genPathName(log.getName(), log.getTypeName(), StateStatus.OS_COMMITTED)); ArrayList<InputObjectState> objectStates = scanLog(log.getName(), log.getTypeName()); String fname = genPathName(log.getName(), log.getTypeName(), StateStatus.OS_UNCOMMITTED); File fd2 = openAndLock(fname, FileLock.F_WRLCK, true); RandomAccessFile oFile = new RandomAccessFile(fd2, FILE_MODE); int size = 0; oFile.setLength(_maxFileSize); byte[] uidString = objectStates.get(i).stateUid().stringForm().getBytes(); int buffSize = _redzone.length + uidString.length + objectStates.get(i).buffer().length + 8; java.nio.ByteBuffer buff = java.nio.ByteBuffer.allocate(buffSize); unlockAndClose(fd2, oFile); throw new ObjectStoreException(ex.toString(), ex); oFile.setLength(size); log.freeze(); throw new ObjectStoreException(ex.toString(), ex); unlockAndClose(fd2, oFile); ex.printStackTrace();
_purger.trigger(); InputObjectState logs = new InputObjectState(); OutputObjectState objUids = new OutputObjectState(); Uid logName = new Uid(Uid.nullUid()); if (logName.notEquals(Uid.nullUid())) ArrayList<InputObjectState> txs = scanLog(logName, tName); UidHelper.packInto(txs.get(i).stateUid(), objUids); UidHelper.packInto(Uid.nullUid(), objUids); state.setBuffer(objUids.buffer());
throws ObjectStoreException InputObjectState ios = new InputObjectState(); if (allObjUids(tName, ios, StateStatus.OS_UNKNOWN)) Uid tempUid = new Uid(Uid.nullUid()); if (tempUid.equals(objUid)) return StateStatus.OS_COMMITTED;
public boolean write_committed(Uid storeUid, String tName, OutputObjectState state) throws ObjectStoreException { if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("LogStore.write_committed(" + storeUid + ", " + tName + ")"); } try { return super.write_committed(storeUid, tName, state); } catch (ObjectStoreException ex) { removeFromLog(storeUid); throw ex; } }
String fname = genPathName(logName, typeName, StateStatus.OS_COMMITTED); File fd = openAndLock(fname, FileLock.F_WRLCK, true); RandomAccessFile iFile = new RandomAccessFile(fd, FILE_MODE); iFile.seek(0); // make sure we're at the start while (iFile.getFilePointer() < iFile.length()) iFile.read(buff); if (!redzoneProtected(buff)) iFile.read(uidString); throw new ObjectStoreException(ex.toString(), ex); unlockAndClose(fd, iFile); iFile = null; if (Arrays.equals(curr.unpackBytes(), _removedState)) curr.reread(); // don't forget to reset the read pointer! deleteEntries(objectStates, deletedLogs); pruneEntries(objectStates); unlockAndClose(fd, iFile);
TransactionData theLogEntry = getLogName(objUid, tName, buffSize); // always adds entry to log LogInstance theLog = theLogEntry.container; throw new ObjectStoreException(); fname = genPathName(theLog.getName(), tName, ft); fd = openAndLock(fname, FileLock.F_WRLCK, true); ofile = new RandomAccessFile(fd, FILE_MODE); ofile.setLength(_maxFileSize); if (theLog.remaining() < buffSize) long size = ofile.length() + buffSize - theLog.remaining(); ofile.setLength(size); unlockAndClose(fd, ofile); unlockAndClose(fd, ofile); unlockAndClose(fd, ofile); if (!unlockAndClose(fd, ofile)) { tsLogger.i18NLogger.warn_objectstore_ShadowingStore_19(fname);
File fd = new File(genPathName(log.getName(), log.getTypeName(), StateStatus.OS_COMMITTED)); ArrayList<InputObjectState> objectStates = scanLog(log.getName(), log.getTypeName()); String fname = genPathName(log.getName(), log.getTypeName(), StateStatus.OS_UNCOMMITTED); File fd2 = openAndLock(fname, FileLock.F_WRLCK, true); RandomAccessFile oFile = new RandomAccessFile(fd2, FILE_MODE); int size = 0; oFile.setLength(_maxFileSize); byte[] uidString = objectStates.get(i).stateUid().stringForm().getBytes(); int buffSize = _redzone.length + uidString.length + objectStates.get(i).buffer().length + 8; java.nio.ByteBuffer buff = java.nio.ByteBuffer.allocate(buffSize); unlockAndClose(fd2, oFile); throw new ObjectStoreException(ex.toString(), ex); oFile.setLength(size); log.freeze(); throw new ObjectStoreException(ex.toString(), ex); unlockAndClose(fd2, oFile); ex.printStackTrace();
_purger.trigger(); InputObjectState logs = new InputObjectState(); OutputObjectState objUids = new OutputObjectState(); Uid logName = new Uid(Uid.nullUid()); if (logName.notEquals(Uid.nullUid())) ArrayList<InputObjectState> txs = scanLog(logName, tName); UidHelper.packInto(txs.get(i).stateUid(), objUids); UidHelper.packInto(Uid.nullUid(), objUids); state.setBuffer(objUids.buffer());
throws ObjectStoreException InputObjectState ios = new InputObjectState(); if (allObjUids(tName, ios, StateStatus.OS_UNKNOWN)) Uid tempUid = new Uid(Uid.nullUid()); if (tempUid.equals(objUid)) return StateStatus.OS_COMMITTED;
public boolean write_committed(Uid storeUid, String tName, OutputObjectState state) throws ObjectStoreException { if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("LogStore.write_committed(" + storeUid + ", " + tName + ")"); } try { return super.write_committed(storeUid, tName, state); } catch (ObjectStoreException ex) { removeFromLog(storeUid); throw ex; } }
String fname = genPathName(logName, typeName, StateStatus.OS_COMMITTED); File fd = openAndLock(fname, FileLock.F_WRLCK, true); RandomAccessFile iFile = new RandomAccessFile(fd, FILE_MODE); iFile.seek(0); // make sure we're at the start while (iFile.getFilePointer() < iFile.length()) iFile.read(buff); if (!redzoneProtected(buff)) iFile.read(uidString); throw new ObjectStoreException(ex.toString(), ex); unlockAndClose(fd, iFile); iFile = null; if (Arrays.equals(curr.unpackBytes(), _removedState)) curr.reread(); // don't forget to reset the read pointer! deleteEntries(objectStates, deletedLogs); pruneEntries(objectStates); unlockAndClose(fd, iFile);
TransactionData theLogEntry = getLogName(objUid, tName, buffSize); // always adds entry to log LogInstance theLog = theLogEntry.container; throw new ObjectStoreException(); fname = genPathName(theLog.getName(), tName, ft); fd = openAndLock(fname, FileLock.F_WRLCK, true); ofile = new RandomAccessFile(fd, FILE_MODE); ofile.setLength(_maxFileSize); if (theLog.remaining() < buffSize) long size = ofile.length() + buffSize - theLog.remaining(); ofile.setLength(size); unlockAndClose(fd, ofile); unlockAndClose(fd, ofile); unlockAndClose(fd, ofile); if (!unlockAndClose(fd, ofile)) { tsLogger.i18NLogger.warn_objectstore_ShadowingStore_19(fname);
File fd = new File(genPathName(log.getName(), log.getTypeName(), ObjectStore.OS_COMMITTED)); ArrayList<InputObjectState> objectStates = scanLog(log.getName(), log.getTypeName()); String fname = genPathName(log.getName(), log.getTypeName(), ObjectStore.OS_UNCOMMITTED); File fd2 = openAndLock(fname, FileLock.F_WRLCK, true); RandomAccessFile oFile = new RandomAccessFile(fd2, FILE_MODE); int size = 0; oFile.setLength(_maxFileSize); byte[] uidString = objectStates.get(i).stateUid().stringForm().getBytes(); int buffSize = _redzone.length + uidString.length + objectStates.get(i).buffer().length + 8; java.nio.ByteBuffer buff = java.nio.ByteBuffer.allocate(buffSize); unlockAndClose(fd2, oFile); throw new ObjectStoreException(ex.toString(), ex); oFile.setLength(size); log.freeze(); throw new ObjectStoreException(ex.toString(), ex); unlockAndClose(fd2, oFile); ex.printStackTrace();
_purger.trigger(); InputObjectState logs = new InputObjectState(); OutputObjectState objUids = new OutputObjectState(); Uid logName = new Uid(Uid.nullUid()); if (logName.notEquals(Uid.nullUid())) ArrayList<InputObjectState> txs = scanLog(logName, tName); UidHelper.packInto(txs.get(i).stateUid(), objUids); UidHelper.packInto(Uid.nullUid(), objUids); state.setBuffer(objUids.buffer());
throws ObjectStoreException InputObjectState ios = new InputObjectState(); if (allObjUids(tName, ios, StateStatus.OS_UNKNOWN)) Uid tempUid = new Uid(Uid.nullUid()); if (tempUid.equals(objUid)) return StateStatus.OS_COMMITTED;