long getPos() throws IOException { switch (type) { case 0: return doublingTable.getPos(offset); case 1: { switch (subtype) { case 1: case 2: if (btreeHugeObjects == null) { btreeHugeObjects = new BTree2(h5, "FractalHeap btreeHugeObjects", btreeAddressHugeObjects); assert btreeHugeObjects.btreeType == subtype; } BTree2.Record1 record1 = btreeHugeObjects.getEntry1(offset); if (record1 == null) { btreeHugeObjects.getEntry1(offset); // debug throw new RuntimeException("Cant find DHeapId="+offset); } return record1.hugeObjectAddress; case 3: case 4: return offset; // guess } } default: throw new RuntimeException("Unknown DHeapId type ="+type); } }
LeafNode(long address, short nrecords) throws IOException { raf.seek(h5.getFileOffset(address)); if (debugPos) debugOut.println("--Btree2 InternalNode position=" + raf.getFilePointer()); // header byte[] sig = new byte[4]; raf.read(sig); String magic = new String(sig); if (!magic.equals("BTLF")) throw new IllegalStateException(magic + " should equal BTLF"); byte version = raf.readByte(); byte nodeType = raf.readByte(); if (nodeType != btreeType) throw new IllegalStateException(); if (debugBtree2) debugOut.println(" BTree2 LeafNode version=" + version + " type=" + nodeType + " nrecords=" + nrecords); entries = new Entry2[nrecords]; for (int i = 0; i < nrecords; i++) { entries[i] = new Entry2(); entries[i].record = readRecord(btreeType); } int checksum = raf.readInt(); }
return; BTree2 btree = new BTree2(H5header.this, who, btreeAddress); FractalHeap fractalHeap = new FractalHeap(H5header.this, who, attInfo.fractalHeapAddress, memTracker);
private void processAttributeInfoMessage(MessageAttributeInfo attInfo, List<MessageAttribute> list) throws IOException { long btreeAddress = (attInfo.v2BtreeAddressCreationOrder > 0) ? attInfo.v2BtreeAddressCreationOrder : attInfo.v2BtreeAddress; if ((btreeAddress < 0) || (attInfo.fractalHeapAddress < 0)) return; BTree2 btree = new BTree2(H5header.this, who, btreeAddress); FractalHeap fractalHeap = new FractalHeap(H5header.this, who, attInfo.fractalHeapAddress, memTracker); for (BTree2.Entry2 e : btree.entryList) { byte[] heapId; switch (btree.btreeType) { case 8: heapId = ((BTree2.Record8) e.record).heapId; break; case 9: heapId = ((BTree2.Record9) e.record).heapId; break; default: continue; } // the heapId points to an Attribute Message in the fractal Heap FractalHeap.DHeapId fractalHeapId = fractalHeap.getFractalHeapId(heapId); long pos = fractalHeapId.getPos(); if (pos > 0) { MessageAttribute attMessage = new MessageAttribute(); if (attMessage.read(pos)) list.add(attMessage); if (debugBtree2) System.out.println(" attMessage=" + attMessage); } } }
f.format(" type n m offset size pos attName%n"); BTree2 btree = new BTree2(H5header.this, "", btreeAddress); for (BTree2.Entry2 e : btree.entryList) { byte[] heapId;
LeafNode(long address, short nrecords) throws IOException { raf.seek(h5.getFileOffset(address)); if (debugPos) debugOut.println("--Btree2 InternalNode position=" + raf.getFilePointer()); // header byte[] sig = new byte[4]; raf.readFully(sig); String magic = new String(sig, CDM.utf8Charset); if (!magic.equals("BTLF")) throw new IllegalStateException(magic + " should equal BTLF"); byte version = raf.readByte(); byte nodeType = raf.readByte(); if (nodeType != btreeType) throw new IllegalStateException(); if (debugBtree2) debugOut.println(" BTree2 LeafNode version=" + version + " type=" + nodeType + " nrecords=" + nrecords); entries = new Entry2[nrecords]; for (int i = 0; i < nrecords; i++) { entries[i] = new Entry2(); entries[i].record = readRecord(btreeType); } // skip raf.readInt(); }
long getPos() throws IOException { switch (type) { case 0: return doublingTable.getPos(offset); case 1: { switch (subtype) { case 1: case 2: if (btreeHugeObjects == null) { btreeHugeObjects = new BTree2(h5, "FractalHeap btreeHugeObjects", btreeAddressHugeObjects); assert btreeHugeObjects.btreeType == subtype; } BTree2.Record1 record1 = btreeHugeObjects.getEntry1(offset); if (record1 == null) throw new RuntimeException("Cant find DHeapId="+offset); return record1.hugeObjectAddress; case 3: case 4: return offset; // guess } } default: throw new RuntimeException("Unknown DHeapId type ="+type); } }
f.format(" type n m offset size pos attName%n"); BTree2 btree = new BTree2(H5header.this, "", btreeAddress); for (BTree2.Entry2 e : btree.entryList) { byte[] heapId;
LeafNode(long address, short nrecords) throws IOException { raf.seek(h5.getFileOffset(address)); if (debugPos) debugOut.println("--Btree2 InternalNode position=" + raf.getFilePointer()); // header byte[] sig = new byte[4]; raf.readFully(sig); String magic = new String(sig, CDM.utf8Charset); if (!magic.equals("BTLF")) throw new IllegalStateException(magic + " should equal BTLF"); byte version = raf.readByte(); byte nodeType = raf.readByte(); if (nodeType != btreeType) throw new IllegalStateException(); if (debugBtree2) debugOut.println(" BTree2 LeafNode version=" + version + " type=" + nodeType + " nrecords=" + nrecords); entries = new Entry2[nrecords]; for (int i = 0; i < nrecords; i++) { entries[i] = new Entry2(); entries[i].record = readRecord(btreeType); } // skip raf.readInt(); }
BTree2 btree = new BTree2(H5header.this, group.displayName, btreeAddress); for (BTree2.Entry2 e : btree.entryList) { byte[] heapId;
for (int i = 0; i < nrecords; i++) { entries[i] = new Entry2(); entries[i].record = readRecord(btreeType);
f.format(" type n m offset size pos attName%n"); BTree2 btree = new BTree2(H5header.this, "", btreeAddress); for (BTree2.Entry2 e : btree.entryList) { byte[] heapId = null;
for (int i = 0; i < nrecords; i++) { entries[i] = new Entry2(); entries[i].record = readRecord(btreeType);
private void processAttributeInfoMessage(MessageAttributeInfo attInfo, List<MessageAttribute> list) throws IOException { long btreeAddress = (attInfo.v2BtreeAddressCreationOrder > 0) ? attInfo.v2BtreeAddressCreationOrder : attInfo.v2BtreeAddress; if ((btreeAddress < 0) || (attInfo.fractalHeapAddress < 0)) return; BTree2 btree = new BTree2(H5header.this, who, btreeAddress); FractalHeap fractalHeap = new FractalHeap(H5header.this, who, attInfo.fractalHeapAddress); for (BTree2.Entry2 e : btree.entryList) { byte[] heapId = null; switch (btree.btreeType) { case 8: heapId = ((BTree2.Record8) e.record).heapId; break; case 9: heapId = ((BTree2.Record9) e.record).heapId; break; default: continue; } // the heapId points to an Attribute Message in the fractal Heap long pos = fractalHeap.getHeapId(heapId).getPos(); if (pos > 0) { raf.seek(pos); MessageAttribute attMessage = new MessageAttribute(); if (attMessage.read()) list.add(attMessage); if (debugBtree2) System.out.println(" attMessage=" + attMessage); } } }
for (int i = 0; i < nrecords; i++) { entries[i] = new Entry2(); entries[i].record = readRecord(btreeType);
BTree2 btree = new BTree2(H5header.this, group.displayName, btreeAddress); for (BTree2.Entry2 e : btree.entryList) { byte[] heapId = null;
BTree2 btree = new BTree2(H5header.this, group.displayName, btreeAddress); for (BTree2.Entry2 e : btree.entryList) { byte[] heapId;