~akiban-technologies/akiban-server/trunk

« back to all changes in this revision

Viewing changes to src/main/java/com/akiban/server/store/PersistitStoreSchemaManager.java

merge nwilliams: Change SERIAL back to BY DEFAULT, fix div by zero on maximum range cycling sequence and underlying support for ALTER SEQUENCE.

https://code.launchpad.net/~nwilliams/akiban-server/sequence-fix-and-tweak/+merge/177031

Show diffs side-by-side

added added

removed removed

Lines of Context:
337
337
                    @Override
338
338
                    public AkibanInformationSchema runAndReturn(Session session) throws PersistitException {
339
339
                        // Unrelated to loading, but fine time to do it
340
 
                        cleanupDelayedTrees(session);
 
340
                        cleanupDelayedTrees(session, true);
341
341
 
342
342
                        SharedAIS sAIS = loadAISFromStorage(session, GenValue.SNAPSHOT, GenMap.PUT_NEW);
343
343
 
791
791
    }
792
792
 
793
793
    /** Public for test only. Should not generally be called. */
794
 
    public void cleanupDelayedTrees(final Session session) throws PersistitException {
 
794
    public void cleanupDelayedTrees(final Session session, final boolean clearMemoryTables) throws PersistitException {
795
795
        treeService.visitStorage(
796
796
                session,
797
797
                new TreeVisitor() {
798
798
                    @Override
799
799
                    public void visit(final Exchange ex) throws PersistitException {
800
 
                        // Don't reload memory table definitions
801
 
                        ex.clear().append(AIS_MEMORY_TABLE_KEY).remove();
 
800
                        if(clearMemoryTables) {
 
801
                            // Don't reload memory table definitions
 
802
                            ex.clear().append(AIS_MEMORY_TABLE_KEY).remove();
 
803
                        }
802
804
                        // Clear old trees
803
805
                        ex.clear().append(DELAYED_TREE_KEY);
804
806
                        KeyFilter filter = new KeyFilter().append(KeyFilter.simpleTerm(DELAYED_TREE_KEY));