/** * Returns a dirtied, writable version of this chunk whose identity won't change until the write lock is released. */ public Chunk getWritableChunk() { Chunk result = this.fDatabase.getChunk((long) this.fSequenceNumber * Database.CHUNK_SIZE); result.makeDirty(); return result; } }
BTNode(long node) throws IndexException { this.node = node; this.chunk = BTree.this.db.getChunk(node); int i= 0; while (i < BTree.this.maxRecords && getRecord(this.chunk, node, i) != 0) i++; this.keyCount = i; }
BTNode(long node) throws IndexException { this.node = node; this.chunk = BTree.this.db.getChunk(node); int i= 0; while (i < BTree.this.maxRecords && getRecord(this.chunk, node, i) != 0) i++; this.keyCount = i; }
/** * Returns a dirtied, writable version of this chunk whose identity won't change until the write lock is released. */ public Chunk getWritableChunk() { Chunk result = this.fDatabase.getChunk(this.fSequenceNumber * Database.CHUNK_SIZE); result.makeDirty(); return result; } }
public long getLong(long offset) throws IndexException { return getChunk(offset).getLong(offset); }
public double getDouble(long offset) throws IndexException { return getChunk(offset).getDouble(offset); }
public float getFloat(long offset) throws IndexException { return getChunk(offset).getFloat(offset); }
public void putFloat(long offset, float value) throws IndexException { getChunk(offset).putFloat(offset, value); }
public double getDouble(long offset) throws IndexException { return getChunk(offset).getDouble(offset); }
public char getChar(long offset) throws IndexException { return getChunk(offset).getChar(offset); }
public void clearBytes(long offset, int byteCount) throws IndexException { getChunk(offset).clear(offset, byteCount); }
public int get3ByteUnsignedInt(long offset) throws IndexException { return getChunk(offset).get3ByteUnsignedInt(offset); }
public short getShort(long offset) throws IndexException { return getChunk(offset).getShort(offset); }
public void putDouble(long offset, double value) throws IndexException { getChunk(offset).putDouble(offset, value); }
public void putByte(long offset, byte value) throws IndexException { getChunk(offset).putByte(offset, value); }
private void putFreeRecPtr(long offset, long value) throws IndexException { getChunk(offset).putFreeRecPtr(offset, value); }
public void putFloat(long offset, float value) throws IndexException { getChunk(offset).putFloat(offset, value); }
@Override public char[] getChars() throws IndexException { final Chunk chunk = this.db.getChunk(this.record); final int l = chunk.getInt(this.record + LENGTH); final int length = Math.abs(l); final char[] chars = new char[length]; if (l < 0) { chunk.getCharsFromBytes(this.record + CHARS, chars, 0, length); } else { chunk.getChars(this.record + CHARS, chars, 0, length); } return chars; }
private void firstInsert(long record) throws IndexException { // Create the node and save it as root. long root = allocateNode(); this.db.putRecPtr(this.rootPointer, root); // Put the record in the first slot of the node. putRecord(this.db.getChunk(root), root, 0, record); }
private void firstInsert(long record) throws IndexException { // Create the node and save it as root. long root = allocateNode(); this.db.putRecPtr(this.rootPointer, root); // Put the record in the first slot of the node. putRecord(this.db.getChunk(root), root, 0, record); }