/** * Inserts the record into the b-tree. We don't insert if the key was already there, * in which case we return the record that matched. In other cases, we just return * the record back. * * @param record offset of the record */ public long insert(long record) throws IndexException { long root = getRoot(); // Is this our first time in. if (root == 0) { firstInsert(record); return record; } return insert(null, 0, 0, root, record); }
/** * Inserts the record into the b-tree. We don't insert if the key was already there, * in which case we return the record that matched. In other cases, we just return * the record back. * * @param record offset of the record */ public long insert(long record) throws IndexException { long root = getRoot(); // Is this our first time in. if (root == 0) { firstInsert(record); return record; } return insert(null, 0, 0, root, record); }
/** * Writes the key, value mapping to the properties. If a mapping for the * same key already exists, it is overwritten. * @param key a non-null property name * @param value a value to associate with the key. may not be null. * @throws IndexException * @throws NullPointerException if key is null */ public void setProperty(String key, String value) throws IndexException { removeProperty(key); DBProperty newProperty= new DBProperty(this.db, key, value); this.index.insert(newProperty.getRecord()); }
/** * Writes the key, value mapping to the properties. If a mapping for the * same key already exists, it is overwritten. * @param key a non-null property name * @param value a value to associate with the key. may not be null. * @throws IndexException * @throws NullPointerException if key is null */ public void setProperty(String key, String value) throws IndexException { removeProperty(key); DBProperty newProperty= new DBProperty(this.db, key, value); this.index.insert(newProperty.getRecord()); }
/** * 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); } }
if (child != 0) { return insert(chunk, node, i, child, record); } else {
if (child != 0) { return insert(chunk, node, i, child, record); } else {