Package com.foundationdb.server.store.format

Examples of com.foundationdb.server.store.format.PersistitStorageDescription


        sequenceTrees(newAis);
    }

    private void sequenceTrees (final AkibanInformationSchema newAis) throws PersistitException {
        for (Sequence sequence : newAis.getSequences().values()) {
            PersistitStorageDescription storageDescription = (PersistitStorageDescription)sequence.getStorageDescription();
            LOG.debug("registering sequence: {} with tree name: {}", sequence.getSequenceName(), storageDescription.getTreeName());
            // treeCache == null -> loading from start or creating a new sequence
            if (storageDescription.getTreeCache() == null) {
                treeService.populateTreeCache(storageDescription);
            }
        }
    }
View Full Code Here


        }
    }

    @Override
    public void removeTree(Session session, HasStorage object) {
        PersistitStorageDescription storageDescription = (PersistitStorageDescription)object.getStorageDescription();
        treeService.treeWasRemoved(session, storageDescription);
        ((PersistitStoreSchemaManager)schemaManager).treeWasRemoved(session, object.getSchemaName(), storageDescription.getTreeName());
    }
View Full Code Here

    @Test
    public void groupAndIndexTreeDelayedRemoval() throws Exception {
        createAndLoad();

        PersistitStorageDescription groupStorage = (PersistitStorageDescription)getTable(tid).getGroup().getStorageDescription();
        PersistitStorageDescription pkStorage = (PersistitStorageDescription)getTable(tid).getPrimaryKey().getIndex().getStorageDescription();
        String groupTreeName = groupStorage.getTreeName();
        String pkTreeName = pkStorage.getTreeName();
        Set<String> treeNames = pssm.getTreeNames(session());
        assertEquals("Group tree is in set before drop", true, treeNames.contains(groupTreeName));
        assertEquals("PK tree is in set before drop", true, treeNames.contains(pkTreeName));

        ddl().dropTable(session(), TABLE_NAME);
View Full Code Here

    }

    /** As {@link #invalidTreeClearsCache} but Store level removal also busts cache. */
    @Test
    public void storeRemoveTreeClearsCache() {
        PersistitStorageDescription desc = createDescription("tree");
        final Exchange ex1 = treeService.getExchange(session(), desc);
        final Exchange ex2 = treeService.getExchange(session(), desc);
        treeService.releaseExchange(session(), ex1);
        treeService.releaseExchange(session(), ex2);
        assertEquals("cached exchange count", 2, getCachedExchangeCount(ex1.getTree()));
        store().removeTree(session(), desc.getObject());
        assertEquals("cached exchange count", 0, getCachedExchangeCount(ex1.getTree()));
    }
View Full Code Here

    }

    @Test
    public void maxTreeCache() {
        for(int i = 0; i < (MAX_EXCHANGE_CACHE * 5); ++i) {
            PersistitStorageDescription desc = createDescription("tree_" + i);
            Exchange ex = treeService.getExchange(session(), desc);
            treeService.releaseExchange(session(), ex);
        }
        assertEquals("cached tree count", MAX_TREE_CACHE, treeService.getCachedTreeCount(session()));
    }
View Full Code Here

        assertEquals("cached tree count", MAX_TREE_CACHE, treeService.getCachedTreeCount(session()));
    }

    @Test
    public void maxExchangeCache() {
        PersistitStorageDescription desc = createDescription("tree");
        List<Exchange> exchanges = new ArrayList<>();
        for(int i = 0; i < (MAX_EXCHANGE_CACHE * 5); ++i) {
            exchanges.add(treeService.getExchange(session(), desc));
        }
        Tree tree = exchanges.get(0).getTree();
View Full Code Here

    private int getCachedExchangeCount(Tree tree) {
        return treeService.exchangeQueue(session(), tree).size();
    }

    private PersistitStorageDescription createDescription(String treeName) {
        PersistitStorageDescription desc = new PersistitStorageDescription(new TestStorage(ais(), "test", treeName), treeName, identifier);
        desc.getObject().setStorageDescription(desc);
        return desc;
    }
View Full Code Here

        }
    }

    private Tree getTreeForRowDef(RowDef rowDef) {
        Index index = rowDef.getPKIndex();
        PersistitStorageDescription storageDescription = (PersistitStorageDescription)index.getStorageDescription();
        try {
            treeService.populateTreeCache(storageDescription);
            return storageDescription.getTreeCache();
        }
        catch (PersistitException e) {
            throw new PersistitAdapterException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.store.format.PersistitStorageDescription

Copyright © 2018 www.massapicom. 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.