diff --git a/.gitignore b/.gitignore index 15d770bd0..f64799025 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ windows-exe/Debug/ windows-exe/Release/ windows-exe/ipch/ /test.sh +install-packages/SDFS-3.0.3-Setup.exe diff --git a/install-packages/deb/usr/share/sdfs/lib/sdfs.jar b/install-packages/deb/usr/share/sdfs/lib/sdfs.jar index d3488d49b..008f7eb71 100644 Binary files a/install-packages/deb/usr/share/sdfs/lib/sdfs.jar and b/install-packages/deb/usr/share/sdfs/lib/sdfs.jar differ diff --git a/install-packages/windows/sdfs_win.nsi b/install-packages/windows/sdfs_win.nsi index 924c7eaa5..8ef6a8e14 100644 --- a/install-packages/windows/sdfs_win.nsi +++ b/install-packages/windows/sdfs_win.nsi @@ -3,7 +3,7 @@ ; Sets the theme path -!define VERSION '3.0.1' +!define VERSION '3.0.3' !define MUI_PRODUCT "SDFS Cloud File System" diff --git a/src/org/opendedup/collections/SimpleByteArrayLongMap.java b/src/org/opendedup/collections/SimpleByteArrayLongMap.java index 820251f20..ebf08967a 100644 --- a/src/org/opendedup/collections/SimpleByteArrayLongMap.java +++ b/src/org/opendedup/collections/SimpleByteArrayLongMap.java @@ -132,7 +132,9 @@ public boolean containsKey(byte[] key) throws MapClosedException { return true; } return false; - } catch (Exception e) { + } catch(MapClosedException e) { + throw e; + } catch (Exception e) { SDFSLogger.getLog().fatal("error getting record", e); return false; } finally { @@ -327,7 +329,9 @@ public boolean put(byte[] key, int value) throws MapClosedException{ vb.position(0); this.currentSz++; return pos > -1 ? true : false; - } catch (Exception e) { + } catch(MapClosedException e){ + throw e; + }catch (Exception e) { SDFSLogger.getLog().fatal("error inserting record", e); e.printStackTrace(); return false; @@ -355,7 +359,9 @@ public int get(byte[] key) throws MapClosedException { return val; } - } catch (Exception e) { + } catch(MapClosedException e){ + throw e; + }catch (Exception e) { SDFSLogger.getLog().fatal("error getting record", e); return -1; } finally { diff --git a/src/org/opendedup/sdfs/filestore/BatchFileChunkStore.java b/src/org/opendedup/sdfs/filestore/BatchFileChunkStore.java index 9ca1cb9fd..67dadaef2 100644 --- a/src/org/opendedup/sdfs/filestore/BatchFileChunkStore.java +++ b/src/org/opendedup/sdfs/filestore/BatchFileChunkStore.java @@ -449,9 +449,10 @@ public void run() { } } else { + long fs = blob.length(); HashBlobArchive.deleteArchive(k); HashBlobArchive.currentLength.addAndGet(-1 * Integer.parseInt(metaData.get("bsize"))); - HashBlobArchive.compressedLength.addAndGet(-1 * blob.length()); + HashBlobArchive.compressedLength.addAndGet(-1 *fs); File _f = new File(HashBlobArchive.getPath(k).getPath() + ".md"); _f.delete(); } diff --git a/src/org/opendedup/sdfs/filestore/HashBlobArchive.java b/src/org/opendedup/sdfs/filestore/HashBlobArchive.java index c2f60c619..742187e27 100644 --- a/src/org/opendedup/sdfs/filestore/HashBlobArchive.java +++ b/src/org/opendedup/sdfs/filestore/HashBlobArchive.java @@ -1,6 +1,7 @@ package org.opendedup.sdfs.filestore; import java.io.File; + import java.io.IOException; import java.io.RandomAccessFile; import java.io.Serializable; @@ -655,6 +656,7 @@ private void putChunk(byte[] hash, byte[] chunk) synchronized (this) { this.notifyAll(); } + SDFSLogger.getLog().info("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"); throw new ArchiveFullException(); } @@ -864,19 +866,6 @@ private byte[] getChunk(byte[] hash) throws IOException, DataArchivedException { } else { throw new IOException("requested block not found in " + f.getPath()); } - /* - * byte[] b = new byte[hash.length]; ByteBuffer buf = ByteBuffer - * .allocateDirect(4 + 4 + HashFunctionPool.hashLength); ch = - * rf.getChannel(); while (ch.position() < ch.size()) { - * buf.position(0); ch.read(buf); buf.position(0); buf.getInt(); - * buf.get(b); pos = (int) ch.position() - 4; blockMap.put(hash, - * pos); if (Arrays.equals(b, hash)) { nlen = buf.getInt(); byte[] - * chk = new byte[nlen]; ByteBuffer.wrap(chk); - * ch.read(ByteBuffer.wrap(chk)); return chk; } else { int _nlen = - * buf.getInt(); if ((ch.position() + _nlen) < ch.size()) - * ch.position(ch.position() + _nlen); } } buf = null; throw new - * IOException("hash not found"); - */ } catch (ClosedChannelException e) { return getChunk(hash); } catch (MapClosedException e) { @@ -1051,6 +1040,7 @@ public long compact() throws IOException { Thread.sleep(100); } } else { + _har.delete(); return 0; } @@ -1062,6 +1052,8 @@ public long compact() throws IOException { } } catch (Exception e) { SDFSLogger.getLog().error("unable to compact " + id, e); + HashBlobArchive.compressedLength.addAndGet(-1 * _har.f.length()); + HashBlobArchive.currentLength.addAndGet(-1 * _har.uncompressedLength.get()); _har.delete(); throw new IOException(e); }