|
@@ -100,9 +100,6 @@ public class FileTxnLog implements TxnLog {
|
|
|
static {
|
|
|
LOG = LoggerFactory.getLogger(FileTxnLog.class);
|
|
|
|
|
|
- forceSync =
|
|
|
- !System.getProperty("zookeeper.forceSync", "yes").equals("no");
|
|
|
-
|
|
|
String size = System.getProperty("zookeeper.preAllocSize");
|
|
|
if (size != null) {
|
|
|
try {
|
|
@@ -119,7 +116,7 @@ public class FileTxnLog implements TxnLog {
|
|
|
volatile FileOutputStream fos = null;
|
|
|
|
|
|
File logDir;
|
|
|
- private static boolean forceSync = true;
|
|
|
+ private final boolean forceSync = !System.getProperty("zookeeper.forceSync", "yes").equals("no");;
|
|
|
long dbId;
|
|
|
private LinkedList<FileOutputStream> streamsToFlush =
|
|
|
new LinkedList<FileOutputStream>();
|
|
@@ -385,6 +382,14 @@ public class FileTxnLog implements TxnLog {
|
|
|
return fh.getDbid();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * the forceSync value. true if forceSync is enabled, false otherwise.
|
|
|
+ * @return the forceSync value
|
|
|
+ */
|
|
|
+ public boolean isForceSync() {
|
|
|
+ return forceSync;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* a class that keeps track of the position
|
|
|
* in the input stream. The position points to offset
|