提交 8166e699 authored 作者: Thomas Mueller's avatar Thomas Mueller

Remove unused code.

上级 2eebcdd2
...@@ -234,10 +234,9 @@ abstract class PageData extends Page { ...@@ -234,10 +234,9 @@ abstract class PageData extends Page {
} }
public boolean canRemove() { public boolean canRemove() {
int test; if (changeCount >= index.getPageStore().getChangeCount()) {
// if (changeCount >= index.getPageStore().getChangeCount()) { return false;
// return false; }
// }
return true; return true;
} }
......
...@@ -204,7 +204,7 @@ public class PageDataIndex extends PageIndex { ...@@ -204,7 +204,7 @@ public class PageDataIndex extends PageIndex {
if (p instanceof PageDataOverflow) { if (p instanceof PageDataOverflow) {
return (PageDataOverflow) p; return (PageDataOverflow) p;
} }
throw DbException.get(ErrorCode.FILE_CORRUPTED_1, p.toString()); throw DbException.get(ErrorCode.FILE_CORRUPTED_1, p == null ? "null" : p.toString());
} }
/** /**
......
...@@ -155,18 +155,7 @@ public class PageFreeList extends Page { ...@@ -155,18 +155,7 @@ public class PageFreeList extends Page {
data.readShortInt(); data.readShortInt();
for (int i = 0; i < pageCount; i += 8) { for (int i = 0; i < pageCount; i += 8) {
int x = data.readByte() & 255; int x = data.readByte() & 255;
int test;
used.setByte(i, x); used.setByte(i, x);
// for (int j = 0; j < 8; j++) {
// if ((x & (1 << j)) != 0) {
// if (!used.get(i + j)) {
// System.out.println("??");
// }
// used.set(i + j);
// } else if (used.get(i+j)) {
// System.out.println("??");
// }
// }
} }
full = false; full = false;
} }
...@@ -176,14 +165,6 @@ public class PageFreeList extends Page { ...@@ -176,14 +165,6 @@ public class PageFreeList extends Page {
data.writeByte((byte) Page.TYPE_FREE_LIST); data.writeByte((byte) Page.TYPE_FREE_LIST);
data.writeShortInt(0); data.writeShortInt(0);
for (int i = 0; i < pageCount; i += 8) { for (int i = 0; i < pageCount; i += 8) {
int tst;
// int x = 0;
// for (int j = 0; j < 8; j++) {
// if (used.get(i + j)) {
// x += 1 << j;
// }
// }
// data.writeByte((byte) x);
data.writeByte((byte) used.getByte(i)); data.writeByte((byte) used.getByte(i));
} }
store.writePage(getPos(), data); store.writePage(getPos(), data);
......
...@@ -468,7 +468,7 @@ public class PageStore implements CacheWriter { ...@@ -468,7 +468,7 @@ public class PageStore implements CacheWriter {
boolean isCompactFully = compactMode == CommandInterface.SHUTDOWN_COMPACT; boolean isCompactFully = compactMode == CommandInterface.SHUTDOWN_COMPACT;
boolean isDefrag = compactMode == CommandInterface.SHUTDOWN_DEFRAG; boolean isDefrag = compactMode == CommandInterface.SHUTDOWN_DEFRAG;
int test; int testWithReopen;
// isCompactFully = isDefrag = true; // isCompactFully = isDefrag = true;
int maxCompactTime = SysProperties.MAX_COMPACT_TIME; int maxCompactTime = SysProperties.MAX_COMPACT_TIME;
...@@ -492,10 +492,10 @@ public class PageStore implements CacheWriter { ...@@ -492,10 +492,10 @@ public class PageStore implements CacheWriter {
if (compact(full, firstFree)) { if (compact(full, firstFree)) {
j++; j++;
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
// if (now > start + maxCompactTime) { if (now > start + maxCompactTime) {
// j = maxMove; j = maxMove;
// break; break;
// } }
} }
} }
} }
...@@ -1584,6 +1584,11 @@ public class PageStore implements CacheWriter { ...@@ -1584,6 +1584,11 @@ public class PageStore implements CacheWriter {
metaRootPageId.put(id, rootPageId); metaRootPageId.put(id, rootPageId);
if (type == META_TYPE_DATA_INDEX) { if (type == META_TYPE_DATA_INDEX) {
CreateTableData data = new CreateTableData(); CreateTableData data = new CreateTableData();
if (SysProperties.CHECK) {
if (columns == null) {
throw DbException.throwInternalError(row.toString());
}
}
for (int i = 0; i < columns.length; i++) { for (int i = 0; i < columns.length; i++) {
Column col = new Column("C" + i, Value.INT); Column col = new Column("C" + i, Value.INT);
data.columns.add(col); data.columns.add(col);
......
...@@ -168,11 +168,9 @@ public class CacheLRU implements Cache { ...@@ -168,11 +168,9 @@ public class CacheLRU implements Cache {
} }
} }
if (changed.size() > 0) { if (changed.size() > 0) {
int fixMaybeReplacesChangeCount;
if (!flushed) { if (!flushed) {
writer.flushLog(); writer.flushLog();
} }
Collections.sort(changed); Collections.sort(changed);
int max = maxMemory; int max = maxMemory;
try { try {
......
...@@ -552,8 +552,10 @@ public class TestCases extends TestBase { ...@@ -552,8 +552,10 @@ public class TestCases extends TestBase {
} }
time = System.currentTimeMillis() - time; time = System.currentTimeMillis() - time;
if (time > 5000) { if (time > 5000) {
if (!config.record) {
fail("closing took " + time); fail("closing took " + time);
} }
}
deleteDb("cases"); deleteDb("cases");
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论