use of org.hsqldb_voltpatches.lib.HashSet in project voltdb by VoltDB.
the class JDBCXADataSource method getPreparedXids.
/**
* Return the list of transactions currently <I>in prepared or
* heuristically completed states</I>.
* Need to find out what non-prepared states they are considering
* <I>heuristically completed</I>.
*
* @see javax.transaction.xa.XAResource#recover(int)
*/
Xid[] getPreparedXids() {
Iterator it = resources.keySet().iterator();
Xid curXid;
HashSet preparedSet = new HashSet();
while (it.hasNext()) {
curXid = (Xid) it.next();
if (((JDBCXAResource) resources.get(curXid)).state == JDBCXAResource.XA_STATE_PREPARED) {
preparedSet.add(curXid);
}
}
return (Xid[]) preparedSet.toArray(new Xid[0]);
}
use of org.hsqldb_voltpatches.lib.HashSet 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;
}
use of org.hsqldb_voltpatches.lib.HashSet 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;
}
use of org.hsqldb_voltpatches.lib.HashSet in project voltdb by VoltDB.
the class QuerySpecification method getEquiJoinExpressions.
public Expression getEquiJoinExpressions(OrderedHashSet nameSet, RangeVariable rightRange, boolean fullList) {
HashSet set = new HashSet();
Expression result = null;
OrderedHashSet joinColumnNames = new OrderedHashSet();
for (int i = 0; i < rangeVariableList.size(); i++) {
RangeVariable range = (RangeVariable) rangeVariableList.get(i);
HashMappedList columnList = range.rangeTable.columnList;
for (int j = 0; j < columnList.size(); j++) {
ColumnSchema column = (ColumnSchema) columnList.get(j);
String name = range.getColumnAlias(j);
boolean columnInList = nameSet.contains(name);
boolean namedJoin = range.namedJoinColumns != null && range.namedJoinColumns.contains(name);
boolean repeated = !namedJoin && !set.add(name);
if (repeated && (!fullList || columnInList)) {
throw Error.error(ErrorCode.X_42578, name);
}
if (!columnInList) {
continue;
}
joinColumnNames.add(name);
int position = rightRange.rangeTable.getColumnIndex(name);
ColumnSchema rightColumn = rightRange.rangeTable.getColumn(position);
Expression e = new ExpressionLogical(range, column, rightRange, rightColumn);
result = ExpressionLogical.andExpressions(result, e);
ExpressionColumn col = range.getColumnExpression(name);
if (col == null) {
col = new ExpressionColumn(new Expression[] { e.getLeftNode(), e.getRightNode() }, name);
range.addNamedJoinColumnExpression(name, col);
} else {
col.nodes = (Expression[]) ArrayUtil.resizeArray(col.nodes, col.nodes.length + 1);
col.nodes[col.nodes.length - 1] = e.getRightNode();
}
rightRange.addNamedJoinColumnExpression(name, col);
}
}
if (fullList && !joinColumnNames.containsAll(nameSet)) {
throw Error.error(ErrorCode.X_42501);
}
rightRange.addNamedJoinColumns(joinColumnNames);
return result;
}
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++;
}
}
}
Aggregations