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);
}
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
}
}
}
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++;
}
}
}
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);
}
}
}
}
Aggregations