Search in sources :

Example 26 with Iterator

use of org.hsqldb_voltpatches.lib.Iterator in project voltdb by VoltDB.

the class HsqlDatabaseProperties method getUserDefinedPropertyData.

public Set getUserDefinedPropertyData() {
    Set set = new HashSet();
    Iterator it = meta.values().iterator();
    while (it.hasNext()) {
        Object[] row = (Object[]) it.next();
        if (((Integer) row[indexType]).intValue() == SET_PROPERTY) {
            set.add(row);
        }
    }
    return set;
}
Also used : Set(org.hsqldb_voltpatches.lib.Set) HashSet(org.hsqldb_voltpatches.lib.HashSet) Iterator(org.hsqldb_voltpatches.lib.Iterator) HashSet(org.hsqldb_voltpatches.lib.HashSet)

Example 27 with Iterator

use of org.hsqldb_voltpatches.lib.Iterator in project voltdb by VoltDB.

the class PersistentStoreCollectionSession method clearTransactionTables.

public void clearTransactionTables() {
    if (rowStoreMapTransaction.isEmpty()) {
        return;
    }
    Iterator it = rowStoreMapTransaction.values().iterator();
    while (it.hasNext()) {
        PersistentStore store = (PersistentStore) it.next();
        store.release();
    }
}
Also used : Iterator(org.hsqldb_voltpatches.lib.Iterator)

Example 28 with Iterator

use of org.hsqldb_voltpatches.lib.Iterator in project voltdb by VoltDB.

the class PersistentStoreCollectionSession method clearStatementTables.

public void clearStatementTables() {
    if (rowStoreMapStatement.isEmpty()) {
        return;
    }
    Iterator it = rowStoreMapStatement.values().iterator();
    while (it.hasNext()) {
        PersistentStore store = (PersistentStore) it.next();
        store.release();
    }
}
Also used : Iterator(org.hsqldb_voltpatches.lib.Iterator)

Example 29 with Iterator

use of org.hsqldb_voltpatches.lib.Iterator in project voltdb by VoltDB.

the class DatabaseManager method isServerDB.

static boolean isServerDB(Database db) {
    Iterator it = serverMap.keySet().iterator();
    for (; it.hasNext(); ) {
        Server server = (Server) it.next();
        HashSet databases = (HashSet) serverMap.get(server);
        if (databases.contains(db)) {
            return true;
        }
    }
    return false;
}
Also used : Iterator(org.hsqldb_voltpatches.lib.Iterator) HashSet(org.hsqldb_voltpatches.lib.HashSet)

Example 30 with Iterator

use of org.hsqldb_voltpatches.lib.Iterator in project voltdb by VoltDB.

the class RangeVariableResolver method expandConditions.

void expandConditions(HsqlArrayList[] array, boolean isJoin) {
    for (int i = 0; i < rangeVariables.length; i++) {
        HsqlArrayList list = array[i];
        map.clear();
        set.clear();
        boolean hasChain = false;
        for (int j = 0; j < list.size(); j++) {
            Expression e = (Expression) list.get(j);
            if (!e.isColumnEqual || e.getLeftNode().getRangeVariable() == e.getRightNode().getRangeVariable()) {
                continue;
            }
            if (e.getLeftNode().getRangeVariable() == rangeVariables[i]) {
                map.put(e.getLeftNode().getColumn(), e.getRightNode());
                if (!set.add(e.getLeftNode().getColumn())) {
                    hasChain = true;
                }
            } else {
                map.put(e.getRightNode().getColumn(), e.getLeftNode());
                if (!set.add(e.getRightNode().getColumn())) {
                    hasChain = true;
                }
            }
        }
        if (hasChain && !(hasOuterJoin && isJoin)) {
            Iterator keyIt = map.keySet().iterator();
            while (keyIt.hasNext()) {
                Object key = keyIt.next();
                Iterator it = map.get(key);
                set.clear();
                while (it.hasNext()) {
                    set.add(it.next());
                }
                while (set.size() > 1) {
                    Expression e1 = (Expression) set.remove(set.size() - 1);
                    for (int j = 0; j < set.size(); j++) {
                        Expression e2 = (Expression) set.get(j);
                        closeJoinChain(array, e1, e2);
                    }
                }
            }
        }
    }
}
Also used : HsqlArrayList(org.hsqldb_voltpatches.lib.HsqlArrayList) Iterator(org.hsqldb_voltpatches.lib.Iterator)

Aggregations

Iterator (org.hsqldb_voltpatches.lib.Iterator)102 WrapperIterator (org.hsqldb_voltpatches.lib.WrapperIterator)74 HsqlName (org.hsqldb_voltpatches.HsqlNameManager.HsqlName)64 SchemaObject (org.hsqldb_voltpatches.SchemaObject)57 Table (org.hsqldb_voltpatches.Table)55 PersistentStore (org.hsqldb_voltpatches.persist.PersistentStore)51 Constraint (org.hsqldb_voltpatches.Constraint)50 TextTable (org.hsqldb_voltpatches.TextTable)39 OrderedHashSet (org.hsqldb_voltpatches.lib.OrderedHashSet)28 HsqlException (org.hsqldb_voltpatches.HsqlException)18 HsqlArrayList (org.hsqldb_voltpatches.lib.HsqlArrayList)14 NumberType (org.hsqldb_voltpatches.types.NumberType)10 HashSet (org.hsqldb_voltpatches.lib.HashSet)9 Type (org.hsqldb_voltpatches.types.Type)9 Grantee (org.hsqldb_voltpatches.rights.Grantee)8 Routine (org.hsqldb_voltpatches.Routine)7 RoutineSchema (org.hsqldb_voltpatches.RoutineSchema)7 TriggerDef (org.hsqldb_voltpatches.TriggerDef)6 CharacterType (org.hsqldb_voltpatches.types.CharacterType)6 IntervalType (org.hsqldb_voltpatches.types.IntervalType)6