Package com.foundationdb.server.store.TableChanges

Examples of com.foundationdb.server.store.TableChanges.ChangeSet


                    int onlineTableID = onlineAIS.getTable(table.getName()).getTableId();
                    List<TableName> tableNames = getTableNames(session, server, queryExpression, table);
                    if(tableNames.size() > 1)
                        throw new UnsupportedCreateSelectException();
                    for( TableName name : tableNames){
                        ChangeSet fromChangeSet = buildChangeSet(onlineAIS.getTable(name), queryExpression,  onlineTableID);
                        schemaManager().addOnlineChangeSet(session, fromChangeSet);
                    }
                    ChangeSet toChangeSet = buildChangeSet(onlineAIS.getTable(tableName), queryExpression, onlineTableID);
                    schemaManager().addOnlineChangeSet(session, toChangeSet);

                }
            });
            onlineAt(OnlineDDLMonitor.Stage.POST_METADATA);
View Full Code Here


   
                // Load ChangeSets
                if(idDir.exists(txn, CHANGES_PATH).get()) {
                    DirectorySubspace changesDir = idDir.open(txn, CHANGES_PATH).get();
                    for(KeyValue kv : txn.getRange(Range.startsWith(changesDir.pack()))) {
                        ChangeSet cs = ChangeSetHelper.load(kv.getValue());
                        Long prev = onlineCache.tableToOnline.put(cs.getTableId(), onlineID);
                        assert (prev == null) : String.format("%d, %d, %d", cs.getTableId(), prev, onlineID);
                        onlineCache.onlineToChangeSets.put(onlineID, cs);
                    }
                }
            }
        } catch (RuntimeException e) {
View Full Code Here

        transactionallyUnchecked(new Runnable() {
            @Override
            public void run() {
                Collection<ChangeSet> changeSets = schemaManager.getOnlineChangeSets(session());
                assertEquals("changeSets size", 1, changeSets.size());
                ChangeSet cs = changeSets.iterator().next();
                assertEquals("changeLevel", "TABLE", cs.getChangeLevel());
                assertEquals("tableId", tid, cs.getTableId());
                assertEquals("oldSchema", "s1", cs.getOldSchema());
                assertEquals("oldName", "n1", cs.getOldName());
                assertEquals("newSchema", "s2", cs.getNewSchema());
                assertEquals("newName", "n2", cs.getNewName());
                assertEquals("columnChangeCount", 1, cs.getColumnChangeCount());
                assertEquals("columnChange type", "ADD", cs.getColumnChange(0).getChangeType());
                assertEquals("columnChange newName", "nn", cs.getColumnChange(0).getNewName());
                assertEquals("indexChangeCount", 1, cs.getIndexChangeCount());
                assertEquals("indexChange index type", "GROUP", cs.getIndexChange(0).getIndexType());
                assertEquals("indexChange change type", "DROP", cs.getIndexChange(0).getChange().getChangeType());
                assertEquals("indexChange oldName", "on", cs.getIndexChange(0).getChange().getOldName());
            }
        });

        transactionallyUnchecked(new Runnable() {
            @Override
View Full Code Here

        try {
            builder.mergeFrom(buffer);
        } catch(InvalidProtocolBufferException e) {
            throw new IllegalStateException(e);
        }
        ChangeSet changeSet = builder.build();
        checkFields(changeSet);
        return changeSet;
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.store.TableChanges.ChangeSet

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.