/** Store the given pointer into this field in the given instance. */ public void put(Database db, long instance, long value) throws CoreException { db.putRecPtr(instance + this.offset, value); } }
/** Store the given pointer into this field in the given instance. */ public void put(Database db, long instance, long value) throws CoreException { db.putRecPtr(instance + this.offset, value); } }
/** * A Record Pointer is a pointer as returned by Database.malloc(). * This is a pointer to a block + BLOCK_HEADER_SIZE. */ public void putRecPtr(final long offset, final long value) { makeDirty(); int idx = recPtrToIndex(offset); Database.putRecPtr(value, this.fBuffer, idx); recordWrite(offset, 4); }
/** * A Record Pointer is a pointer as returned by Database.malloc(). * This is a pointer to a block + BLOCK_HEADER_SIZE. */ public void putRecPtr(final long offset, final long value) { makeDirty(); int idx = recPtrToIndex(offset); Database.putRecPtr(value, this.fBuffer, idx); recordWrite(offset, 4); }
/** * Allocates and initializes a record in the specified database for a DBProperty record * @param db * @param key a non-null property name * @param value a non-null property value * @throws IndexException */ DBProperty(Database db, String key, String value) throws IndexException { assert key != null; assert value != null; IString dbkey= db.newString(key); IString dbvalue= db.newString(value); this.record= db.malloc(RECORD_SIZE, Database.POOL_DB_PROPERTIES); db.putRecPtr(this.record + KEY, dbkey.getRecord()); db.putRecPtr(this.record + VALUE, dbvalue.getRecord()); this.db= db; }
/** * Allocates and initializes a record in the specified database for a DBProperty record * @param db * @param key a non-null property name * @param value a non-null property value * @throws IndexException */ DBProperty(Database db, String key, String value) throws IndexException { assert key != null; assert value != null; IString dbkey= db.newString(key); IString dbvalue= db.newString(value); this.record= db.malloc(RECORD_SIZE, Database.POOL_DB_PROPERTIES); db.putRecPtr(this.record + KEY, dbkey.getRecord()); db.putRecPtr(this.record + VALUE, dbvalue.getRecord()); this.db= db; }
private void cleanup(Nd nd, long address) { Database db = nd.getDB(); long ptr = db.getRecPtr(address + this.offset); if (ptr != 0) { db.putRecPtr(ptr + this.backPointer.offset, 0); // If we own our target, delete it if (this.backPointer.pointsToOwner) { nd.scheduleDeletion(ptr); } } }
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); }
private void cleanup(Nd nd, long address) { Database db = nd.getDB(); long ptr = db.getRecPtr(address + this.offset); if (ptr != 0) { db.putRecPtr(ptr + this.backPointer.offset, 0); // If we own our target, delete it if (this.backPointer.pointsToOwner) { nd.scheduleDeletion(ptr); } } }
public void put(Nd nd, long address, T target) { Database db = nd.getDB(); db.getLog().start(this.putTag); try { cleanup(nd, address); if (target == null) { db.putRecPtr(address + this.offset, 0); if (this.pointsToOwner) { nd.scheduleDeletion(address); } } else { db.putRecPtr(address + this.offset, target.getAddress()); db.putRecPtr(target.getAddress() + this.backPointer.offset, address); } } finally { db.getLog().end(this.putTag); } }
public void put(Nd nd, long address, T target) { Database db = nd.getDB(); db.getLog().start(this.putTag); try { cleanup(nd, address); if (target == null) { db.putRecPtr(address + this.offset, 0); if (this.pointsToOwner) { nd.scheduleDeletion(address); } } else { db.putRecPtr(address + this.offset, target.getAddress()); db.putRecPtr(target.getAddress() + this.backPointer.offset, address); } } finally { db.getLog().end(this.putTag); } }
public void put(Nd nd, long address, long newValue) { Database db = nd.getDB(); db.getLog().start(this.putTag); try { nd.getDB().putRecPtr(address + this.offset, newValue); } finally { db.getLog().end(this.putTag); } }
private void cleanup(Nd nd, long address) { boolean isInIndex = isInIndex(nd, address); if (isInIndex) { // Remove this entry from the search index this.searchIndex.get(nd, Database.DATA_AREA_OFFSET).delete(address); get(nd, address).delete(); nd.getDB().putRecPtr(address + this.offset, 0); } }
private void cleanup(Nd nd, long address) { boolean isInIndex = isInIndex(nd, address); if (isInIndex) { // Remove this entry from the search index this.searchIndex.get(nd, Database.DATA_AREA_OFFSET).delete(address); get(nd, address).delete(); nd.getDB().putRecPtr(address + this.offset, 0); } }
public void put(Nd nd, long address, long newValue) { Database db = nd.getDB(); db.getLog().start(this.putTag); try { nd.getDB().putRecPtr(address + this.offset, newValue); } finally { db.getLog().end(this.putTag); } }
@Override public void destruct(Nd nd, long address) { Database db = nd.getDB(); db.getLog().start(this.destructTag); try { get(nd, address).delete(); nd.getDB().putRecPtr(address + this.offset, 0); } finally { db.getLog().end(this.destructTag); } }
public void destruct(Nd nd, long address) { Database db = nd.getDB(); db.getLog().start(this.destructTag); try { get(nd, address).delete(); nd.getDB().putRecPtr(address + this.offset, 0); } finally { db.getLog().end(this.destructTag); } }
/** * Sets the value of the key and inserts it into the index if it is not already present */ public void put(Nd nd, long address, char[] newString) { Database db = nd.getDB(); db.getLog().start(this.putTag); try { cleanup(nd, address); BTree btree = this.searchIndex.get(nd, Database.DATA_AREA_OFFSET); db.putRecPtr(address + this.offset, db.newString(newString).getRecord()); btree.insert(address); } finally { db.getLog().end(this.putTag); } }
/** * Sets the value of the key and inserts it into the index if it is not already present */ public void put(Nd nd, long address, char[] newString) { Database db = nd.getDB(); db.getLog().start(this.putTag); try { cleanup(nd, address); BTree btree = this.searchIndex.get(nd, Database.DATA_AREA_OFFSET); db.putRecPtr(address + this.offset, db.newString(newString).getRecord()); btree.insert(address); } finally { db.getLog().end(this.putTag); } }