Skip to content

Commit

Permalink
hotfix release 0.4.1
Browse files Browse the repository at this point in the history
remove redundant netty dependencies from http for now and make regionfile fall back to read-only mode
  • Loading branch information
DaMatrix committed Nov 23, 2019
1 parent 9c30974 commit 5e52767
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ allprojects {
ext {
//general things
javaVersion = "1.8"
porklibVersion = "0.4.0"
porklibVersion = "0.4.1"

//dependency things
apacheCommonsCompressVersion = "1.16.1"
Expand Down
6 changes: 4 additions & 2 deletions http/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
*/

dependencies {
compile project(":network:netty-common")
//TODO: netty backend isn't implemented yet
//compile project(":network:netty-common")

compile "io.netty:netty-handler:$nettyVersion"
//compile "io.netty:netty-handler:$nettyVersion"
compile "io.netty:netty-buffer:$nettyVersion"

testCompile project(":encoding")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ counts. The chunk offset for a chunk (x, z) begins at byte 4*(x+z*32) in the
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
Expand Down Expand Up @@ -118,7 +119,17 @@ public RegionFile(File path) {
lastModified = path.lastModified();
}

file = new RandomAccessFile(path, "rw");
try {
file = new RandomAccessFile(path, "rw");
} catch (IOException e) {
try {
//try to open in read-only mode
file = new RandomAccessFile(path, "r");
} catch (IOException e1) {
//if that fails too, throw the original exception
throw e;
}
}

if (file.length() < SECTOR_BYTES) {
/* we need to write the chunk offset table */
Expand Down

0 comments on commit 5e52767

Please sign in to comment.