Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.GroupIndex


            Set<GroupIndex> uncheckedGis = new HashSet<>(gis);
            if (gis.size() != uncheckedGis.size())
                fail(gis + ".size() != " + uncheckedGis + ".size()");

            for(Map.Entry<GroupIndex,List<String>> checkPair : expectedStrings.entrySet()) {
                GroupIndex gi = checkPair.getKey();
                List<String> expected = checkPair.getValue();
                checkIndex(gi, expected);
                uncheckedGis.remove(gi);
            }

            if (!uncheckedGis.isEmpty()) {
                List<String> uncheckedGiNames = new ArrayList<>();
                for (GroupIndex gi : uncheckedGis) {
                    uncheckedGiNames.add(gi.getIndexName().getName());
                }
                throw new RuntimeException("unchecked GIs: " + uncheckedGiNames.toString());
            }
        }
View Full Code Here


    public void rightJoinPersistence() throws Exception {
        createTable("test", "c", "cid int not null primary key, name varchar(255)");
        int oid = createTable("test", "o", "oid int not null primary key, c_id int, priority int, " + akibanFK("c_id", "c", "cid"));
        AkibanInformationSchema ais = ddl().getAIS(session());
        TableName groupName = ais.getTable(oid).getGroup().getName();
        GroupIndex createdGI = createRightGroupIndex(groupName, "my_gi", "c.name", "o.priority");
        assertEquals("join type", Index.JoinType.RIGHT, createdGI.getJoinType());

        GroupIndex confirmationGi = ddl().getAIS(session()).getGroup(groupName).getIndex("my_gi");
        assertNotNull("gi not found", confirmationGi);

        safeRestartTestServices();

        GroupIndex reconstructedGi = ddl().getAIS(session()).getGroup(groupName).getIndex("my_gi");
        assertNotSame("GIs were same instance", createdGI, reconstructedGi);
        assertEquals("join type", Index.JoinType.RIGHT, reconstructedGi.getJoinType());
    }
View Full Code Here

        updateRow(oldRow, newRow);
        checkIndex(groupIndexName, expectedGiEntries);
    }

    void checkIndex(String indexName, String... expected) {
        GroupIndex groupIndex = ddl().getAIS(session()).getGroup(groupName).getIndex(indexName);
        checkIndex(groupIndex, expected);
    }
View Full Code Here

        AkibanInformationSchema ais = ddl().getAIS(session());
        containingTables.add(ais.getTable(firstTableId));
        for (int tableId : tableIds) {
            containingTables.add(ais.getTable(tableId));
        }
        GroupIndex groupIndex = ais.getGroup(groupName).getIndex(indexName);
        if (groupIndex == null)
            throw new RuntimeException("group index undefined: " + indexName);
        long result = 0;
        for(Table table = groupIndex.leafMostTable();
            table != groupIndex.rootMostTable().getParentTable();
            table = table.getParentTable())
        {
            if (containingTables.remove(table)) {
                result |= 1 << table.getDepth();
            }
View Full Code Here

        for(IndexChange ic : changeSet.getIndexChangeList()) {
            if(IndexType.GROUP.name().equals(ic.getIndexType())) {
                switch(ChangeType.valueOf(ic.getChange().getChangeType())) {
                    case ADD:
                    case MODIFY:
                        GroupIndex index = group.getIndex(ic.getChange().getNewName());
                        assert index != null : ic;
                        groupIndexes.add(index);
                        break;
                }
            }
View Full Code Here

TOP

Related Classes of com.foundationdb.ais.model.GroupIndex

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.