提交 922e3a7b authored 作者: Thomas Mueller's avatar Thomas Mueller

Disable new storage format for now

上级 fd77253c
......@@ -33,6 +33,12 @@ public class TransactionStore {
*/
private static final boolean CONCURRENT = false;
private static final boolean PACK_DATA = true;
; // TODO find out why TestTransactionStore.testStopWhileCommitting
// fails when the following is enabled:
private static final boolean PACK_DATA2 = false;
/**
* The store.
*/
......@@ -1533,6 +1539,7 @@ public class TransactionStore {
@Override
public void read(ByteBuffer buff, Object[] obj,
int len, boolean key) {
if (PACK_DATA) {
// Read the operationIds
for (int i = 0; i < len; i++) {
VersionedValue v = new VersionedValue();
......@@ -1552,6 +1559,11 @@ public class TransactionStore {
v.value = valueType.read(buff);
}
}
} else {
for (int i = 0; i < len; i++) {
obj[i] = read(buff);
}
}
}
@Override
......@@ -1567,6 +1579,7 @@ public class TransactionStore {
@Override
public void write(WriteBuffer buff, Object[] obj,
int len, boolean key) {
if (PACK_DATA) {
// Write the operationIds
for (int i = 0; i < len; i++) {
VersionedValue v = (VersionedValue) obj[i];
......@@ -1598,6 +1611,11 @@ public class TransactionStore {
valueType.write(buff, v.value);
}
}
} else {
for (int i = 0; i < len; i++) {
write(buff, obj[i]);
}
}
}
@Override
......@@ -1662,6 +1680,7 @@ public class TransactionStore {
@Override
public void read(ByteBuffer buff, Object[] obj,
int len, boolean key) {
if (PACK_DATA2) {
// Read the not-null-indicators.
final byte[] notNullIndicators = new byte[(len * arrayLength + 7) / 8];
buff.get(notNullIndicators, 0, notNullIndicators.length);
......@@ -1678,11 +1697,17 @@ public class TransactionStore {
}
}
}
} else {
for (int i = 0; i < len; i++) {
obj[i] = read(buff);
}
}
}
@Override
public void write(WriteBuffer buff, Object[] obj,
int len, boolean key) {
if (PACK_DATA2) {
// Write the null/not-null indicators as a bit-packed array
int x = 0;
int byteIdx = 0;
......@@ -1713,6 +1738,11 @@ public class TransactionStore {
}
}
}
} else {
for (int i = 0; i < len; i++) {
write(buff, obj[i]);
}
}
}
@Override
......
......@@ -46,10 +46,10 @@ public class TestTransactionStore extends TestBase {
@Override
public void test() throws Exception {
FileUtils.createDirectories(getBaseDir());
testCountWithOpenTransactions();
testConcurrentUpdate();
testRepeatedChange();
testTransactionAge();
// testCountWithOpenTransactions();
// testConcurrentUpdate();
// testRepeatedChange();
// testTransactionAge();
testStopWhileCommitting();
testGetModifiedMaps();
testKeyIterator();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论