public void cleanup() throws IOException { cleanup(-1); }
public synchronized void cleanup(int keepVersions) throws IOException { _vs.cleanup(keepVersions); }
private void persistInternal(Map<String, ThriftSerializedObject> serialized, TSerializer ser, boolean cleanup) { try { if (ser == null) { ser = new TSerializer(); } byte[] toWrite = ser.serialize(new LocalStateData(serialized)); String newPath = _vs.createVersion(); File file = new File(newPath); FileUtils.writeByteArrayToFile(file, toWrite); if (toWrite.length != file.length()) { throw new IOException("Tried to serialize " + toWrite.length + " bytes to " + file.getCanonicalPath() + ", but " + file.length() + " bytes were written."); } _vs.succeedVersion(newPath); if (cleanup) { _vs.cleanup(4); } } catch (Exception e) { throw new RuntimeException(e); } }
public synchronized void cleanup(int keepVersions) throws IOException { _vs.cleanup(keepVersions); }
public void cleanup() throws IOException { cleanup(-1); }
private void persistInternal(Map<String, ThriftSerializedObject> serialized, TSerializer ser, boolean cleanup) { try { if (ser == null) { ser = new TSerializer(); } byte[] toWrite = ser.serialize(new LocalStateData(serialized)); String newPath = _vs.createVersion(); File file = new File(newPath); FileUtils.writeByteArrayToFile(file, toWrite); if (toWrite.length != file.length()) { throw new IOException("Tried to serialize " + toWrite.length + " bytes to " + file.getCanonicalPath() + ", but " + file.length() + " bytes were written."); } _vs.succeedVersion(newPath); if(cleanup) _vs.cleanup(4); } catch(Exception e) { throw new RuntimeException(e); } }