cleanup old code

This commit is contained in:
Eugene Zhuravlev
2011-04-11 19:35:24 +02:00
parent 0acbfbfd17
commit 991bb160b4
@@ -101,7 +101,7 @@ public class FSRecords implements Forceable {
}
private static class DbConnection {
private static int refCount = 0;
private static boolean ourInitialized;
private static final TObjectIntHashMap<String> myAttributeIds = new TObjectIntHashMap<String>();
private static PersistentStringEnumerator myNames;
@@ -114,17 +114,15 @@ public class FSRecords implements Forceable {
private static ScheduledFuture<?> myFlushingFuture;
private static boolean myCorrupted = false;
public static DbConnection connect() {
public static void connect() {
synchronized (lock) {
if (refCount == 0) {
if (!ourInitialized) {
init();
scanFreeRecords();
setupFlushing();
ourInitialized = true;
}
refCount++;
}
return new DbConnection();
}
private static void scanFreeRecords() {
@@ -384,15 +382,6 @@ public class FSRecords implements Forceable {
return myRecords;
}
public static void dispose() throws IOException {
synchronized (lock) {
refCount--;
if (refCount == 0) {
closeFiles();
}
}
}
private static void closeFiles() throws IOException {
if (myFlushingFuture != null) {
myFlushingFuture.cancel(false);