* INs
*/
IN in = new IN(database,
new byte[] {1,0,1,0},
7, 5);
in.insertEntry(new ChildReference(null,
new byte[] {1,0,1,0},
DbLsn.makeLsn(12, 200)));
in.insertEntry(new ChildReference(null,
new byte[] {1,1,1,0},
DbLsn.makeLsn(29, 300)));
in.insertEntry(new ChildReference(null,
new byte[] {0,0,1,0},
DbLsn.makeLsn(35, 400)));
/* Write it. */
IN inFromLog = new IN();
writeAndRead(buffer, in, inFromLog);
/*
* IN - long form
*/
in = new IN(database,
new byte[] {1,0,1,0},
7, 5);
in.insertEntry(new ChildReference(null,
new byte[] {1,0,1,0},
DbLsn.makeLsn(12, 200)));
in.insertEntry(new ChildReference(null,
new byte[] {1,1,1,0},
DbLsn.makeLsn(29, 300)));
in.insertEntry(new ChildReference(null,
new byte[] {0,0,1,0},
DbLsn.makeLsn(1235, 400)));
in.insertEntry(new ChildReference(null,
new byte[] {0,0,1,0},
DbLsn.makeLsn(0xFFFFFFF0L, 400)));
/* Write it. */
inFromLog = new IN();
writeAndRead(buffer, in, inFromLog);
/*
* BINs
*/
BIN bin = new BIN(database,
new byte[] {3,2,1},
8, 5);
bin.latch();
bin.insertEntry(new ChildReference(null,
new byte[] {1,0,1,0},
DbLsn.makeLsn(212, 200)));
bin.insertEntry(new ChildReference(null,
new byte[] {1,1,1,0},
DbLsn.makeLsn(229, 300)));
bin.insertEntry(new ChildReference(null,
new byte[] {0,0,1,0},
DbLsn.makeLsn(235, 400)));
BIN binFromLog = new BIN();
writeAndRead(buffer, bin, binFromLog);
binFromLog.verify(null);
bin.releaseLatch();
/*
* DINs
*/
DIN din = new DIN(database,
new byte[] {1,0,0,1},
7,
new byte[] {0,1,1,0},
new ChildReference(null,
new byte[] {1,0,0,1},
DbLsn.makeLsn(10, 100)),
5);
din.insertEntry(new ChildReference(null,
new byte[] {1,0,1,0},
DbLsn.makeLsn(12, 200)));
din.insertEntry(new ChildReference(null,
new byte[] {1,1,1,0},
DbLsn.makeLsn(29, 300)));
din.insertEntry(new ChildReference(null,
new byte[] {0,0,1,0},
DbLsn.makeLsn(35, 400)));
/* Write it. */
DIN dinFromLog = new DIN();
writeAndRead(buffer, din, dinFromLog);
/*
* DBINs
*/
DBIN dbin = new DBIN(database,
new byte[] {3,2,1},
8,
new byte[] {1,2,3},
5);
dbin.latch();
dbin.insertEntry(new ChildReference(null,
new byte[] {1,0,1,0},
DbLsn.makeLsn(212, 200)));
dbin.insertEntry(new ChildReference(null,
new byte[] {1,1,1,0},
DbLsn.makeLsn(229, 300)));
dbin.insertEntry(new ChildReference(null,
new byte[] {0,0,1,0},
DbLsn.makeLsn(235, 400)));
DBIN dbinFromLog = new DBIN();
writeAndRead(buffer, dbin, dbinFromLog);
dbinFromLog.verify(null);