Examples of BTreeIndex


Examples of com.coyotegulch.jisp.BTreeIndex

            {
                getLogger().debug("initialize(): Datafile exists: " + isOld);
            }

            if (!isOld) {
                m_Index = new BTreeIndex(indexFile.toString(),
                                         order, super.getNullKey(), false);
            } else {
                m_Index = new BTreeIndex(indexFile.toString());
            }
            m_Database = new IndexedObjectDatabase(databaseFile.toString(), !isOld);
            m_Database.attachIndex(m_Index);
        }
        catch (KeyNotFound ignore)
View Full Code Here

Examples of com.coyotegulch.jisp.BTreeIndex

            super.m_Database = new IndexedObjectDatabase(databaseFile.toString(),
                                                         !databaseExists);

            if (!databaseExists) {
                // Create new index
                super.m_Index = new BTreeIndex(indexFile.toString(),
                                               order, super.getNullKey(), false);
            } else {
                // Open existing index
                super.m_Index = new BTreeIndex(indexFile.toString());
            }
            super.m_Database.attachIndex(super.m_Index);
        } catch (KeyNotFound ignore) {
        } catch (Exception e) {
            getLogger().error("Exception during initialization of jisp store.", e);
View Full Code Here

Examples of com.coyotegulch.jisp.BTreeIndex

            if (databaseFile.exists()) {
                if (getLogger().isDebugEnabled()) {
                    this.getLogger().debug("initialize(): Datafile exists");
                }
                mDatabase = new IndexedObjectDatabase(databaseFile.toString(), false);
                mIndex = new BTreeIndex(indexFile.toString());
                mDatabase.attachIndex(mIndex);
            } else {
                if (getLogger().isDebugEnabled()) {
                    this.getLogger().debug("initialize(): Datafile does not exist");
                }
                mDatabase = new IndexedObjectDatabase(databaseFile.toString(), false);
                mIndex = new BTreeIndex(indexFile.toString(),
                                        mOrder, new JispStringKey(), false);
                mDatabase.attachIndex(mIndex);
            }
        } catch (KeyNotFound ignore) {
        } catch (Exception e) {
View Full Code Here

Examples of com.coyotegulch.jisp.BTreeIndex

            indexFile.append(indexDef.getName());

            File killit = new File(indexFile.toString());
            if (killit.exists()) killit.delete();

            final BTreeIndex index = new BTreeIndex(
                    indexFile.toString(),
                    INDEX_ORDER,
                    (KeyObject)factory.newInstance(),
                    false, m_loader);
View Full Code Here

Examples of com.coyotegulch.jisp.BTreeIndex

            final StringBuffer indexFile = new StringBuffer();
            indexFile.append(m_databaseDir);
            indexFile.append(File.separator);
            indexFile.append(indexDef.getName());

            final BTreeIndex index = new BTreeIndex(indexFile.toString(), m_loader);
            indexes.add(index);

            m_jispIndexes.put(indexDef.getName(), index);

            final Class indexType = m_loader.loadClass(
View Full Code Here

Examples of com.coyotegulch.jisp.BTreeIndex

            indexFile.append(indexDef.getName());

            File killit = new File(indexFile.toString());
            if (killit.exists()) killit.delete();

            final BTreeIndex index = new BTreeIndex(
                    indexFile.toString(),
                    INDEX_ORDER,
                    (KeyObject)factory.newInstance(),
                    false, m_loader);
View Full Code Here

Examples of com.coyotegulch.jisp.BTreeIndex

            final StringBuffer indexFile = new StringBuffer();
            indexFile.append(m_databaseDir);
            indexFile.append(File.separator);
            indexFile.append(indexDef.getName());

            final BTreeIndex index = new BTreeIndex(indexFile.toString(), m_loader);
            indexes.add(index);

            m_jispIndexes.put(indexDef.getName(), index);

            final Class indexType = m_loader.loadClass(
View Full Code Here

Examples of com.coyotegulch.jisp.BTreeIndex

            indexFile.append(indexDef.getName());

            File killit = new File(indexFile.toString());
            if (killit.exists()) killit.delete();

            final BTreeIndex index = new BTreeIndex(
                    indexFile.toString(),
                    INDEX_ORDER,
                    (KeyObject)factory.newInstance(),
                    false, m_loader);
View Full Code Here

Examples of com.coyotegulch.jisp.BTreeIndex

            final StringBuffer indexFile = new StringBuffer();
            indexFile.append(m_databaseDir);
            indexFile.append(File.separator);
            indexFile.append(indexDef.getName());

            final BTreeIndex index = new BTreeIndex(indexFile.toString(), m_loader);
            indexes.add(index);

            m_jispIndexes.put(indexDef.getName(), index);

            final Class indexType = m_loader.loadClass(
View Full Code Here

Examples of org.apache.kahadb.index.BTreeIndex

     * @throws Exception
     */
    public void disabled_testTreeBalancing() throws Exception {
        createPageFileAndIndex(100);

        BTreeIndex index = ((BTreeIndex)this.index);
        this.index.load(tx);
        tx.commit();
       
        doInsert(50);
       
        int minLeafDepth = index.getMinLeafDepth(tx);
        int maxLeafDepth = index.getMaxLeafDepth(tx);
        assertTrue("Tree is balanced", maxLeafDepth-minLeafDepth <= 1);

        // Remove some of the data
        doRemove(16);
        minLeafDepth = index.getMinLeafDepth(tx);
        maxLeafDepth = index.getMaxLeafDepth(tx);

        System.out.println( "min:"+minLeafDepth );
        System.out.println( "max:"+maxLeafDepth );
        index.printStructure(tx, new PrintWriter(System.out));

        assertTrue("Tree is balanced", maxLeafDepth-minLeafDepth <= 1);

        this.index.unload(tx);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.