Search in sources :

Example 11 with HashSet

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

the class DatabaseManager method registerServer.

/**
     * Registers a server as serving a given database.
     */
private static void registerServer(Server server, Database db) {
    if (!serverMap.containsKey(server)) {
        serverMap.put(server, new HashSet());
    }
    HashSet databases = (HashSet) serverMap.get(server);
    databases.add(db);
}
Also used : HashSet(org.hsqldb_voltpatches.lib.HashSet)

Example 12 with HashSet

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

the class DatabaseManager method notifyServers.

/**
     * Notifies all servers that serve the database that the database has been
     * shutdown.
     */
private static void notifyServers(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)) {
        // A VoltDB extension to disable a package dependency
        /* disable 2 lines ...
                server.notify(ServerConstants.SC_DATABASE_SHUTDOWN,
                              db.databaseID);
... disabled 2 lines */
        // End of VoltDB extension
        }
    }
}
Also used : Iterator(org.hsqldb_voltpatches.lib.Iterator) HashSet(org.hsqldb_voltpatches.lib.HashSet)

Example 13 with HashSet

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

the class QuerySpecification method resolveColumnReferencesForAsterisk.

private void resolveColumnReferencesForAsterisk() {
    for (int pos = 0; pos < indexLimitVisible; ) {
        Expression e = (Expression) (exprColumnList.get(pos));
        if (e.getType() == OpTypes.MULTICOLUMN) {
            exprColumnList.remove(pos);
            String tablename = ((ExpressionColumn) e).getTableName();
            if (tablename == null) {
                addAllJoinedColumns(e);
            } else {
                int rangeIndex = e.findMatchingRangeVariableIndex(rangeVariables);
                if (rangeIndex == -1) {
                    throw Error.error(ErrorCode.X_42501, tablename);
                }
                RangeVariable range = rangeVariables[rangeIndex];
                HashSet exclude = getAllNamedJoinColumns();
                range.addTableColumns(e, exclude);
            }
            for (int i = 0; i < e.nodes.length; i++) {
                exprColumnList.add(pos, e.nodes[i]);
                pos++;
            }
            indexLimitVisible += e.nodes.length - 1;
        } else {
            pos++;
        }
    }
}
Also used : OrderedHashSet(org.hsqldb_voltpatches.lib.OrderedHashSet) HashSet(org.hsqldb_voltpatches.lib.HashSet) OrderedIntHashSet(org.hsqldb_voltpatches.lib.OrderedIntHashSet)

Example 14 with HashSet

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

the class StatementCompound method setHandlers.

private void setHandlers() {
    if (handlers.length == 0) {
        return;
    }
    HashSet statesSet = new HashSet();
    OrderedIntHashSet typesSet = new OrderedIntHashSet();
    for (int i = 0; i < handlers.length; i++) {
        int[] types = handlers[i].getConditionTypes();
        for (int j = 0; j < types.length; j++) {
            if (!typesSet.add(types[j])) {
                throw Error.error(ErrorCode.X_42601);
            }
        }
        String[] states = handlers[i].getConditionStates();
        for (int j = 0; j < states.length; j++) {
            if (!statesSet.add(states[j])) {
                throw Error.error(ErrorCode.X_42601);
            }
        }
    }
}
Also used : OrderedIntHashSet(org.hsqldb_voltpatches.lib.OrderedIntHashSet) OrderedIntHashSet(org.hsqldb_voltpatches.lib.OrderedIntHashSet) HashSet(org.hsqldb_voltpatches.lib.HashSet)

Aggregations

HashSet (org.hsqldb_voltpatches.lib.HashSet)14 Iterator (org.hsqldb_voltpatches.lib.Iterator)8 OrderedHashSet (org.hsqldb_voltpatches.lib.OrderedHashSet)6 HashMappedList (org.hsqldb_voltpatches.lib.HashMappedList)3 OrderedIntHashSet (org.hsqldb_voltpatches.lib.OrderedIntHashSet)3 WrapperIterator (org.hsqldb_voltpatches.lib.WrapperIterator)3 Xid (javax.transaction.xa.Xid)1 Constraint (org.hsqldb_voltpatches.Constraint)1 HsqlName (org.hsqldb_voltpatches.HsqlNameManager.HsqlName)1 SchemaObject (org.hsqldb_voltpatches.SchemaObject)1 Table (org.hsqldb_voltpatches.Table)1 TextTable (org.hsqldb_voltpatches.TextTable)1 Set (org.hsqldb_voltpatches.lib.Set)1 DataFileCache (org.hsqldb_voltpatches.persist.DataFileCache)1 PersistentStore (org.hsqldb_voltpatches.persist.PersistentStore)1