use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.
the class Table method getComponents.
@Override
public OrderedHashSet getComponents() {
OrderedHashSet set = new OrderedHashSet();
set.addAll(constraintList);
set.addAll(triggerList);
for (int i = 0; i < indexList.length; i++) {
if (!indexList[i].isConstraint()) {
set.add(indexList[i]);
}
}
return set;
}
use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.
the class Grantee method getGranteeAndAllRolesWithPublic.
public OrderedHashSet getGranteeAndAllRolesWithPublic() {
OrderedHashSet set = new OrderedHashSet();
addGranteeAndRoles(set);
set.add(granteeManager.publicRole);
return set;
}
use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.
the class Grantee method getAllGrantableRights.
public Right getAllGrantableRights(SchemaObject object) {
if (isAdmin) {
return object.getOwner().ownerRights;
}
if (object.getOwner() == this) {
return ownerRights;
}
if (roles.contains(object.getOwner())) {
return object.getOwner().ownerRights;
}
OrderedHashSet set = getAllRoles();
for (int i = 0; i < set.size(); i++) {
Grantee role = (Grantee) set.get(i);
if (object.getOwner() == role) {
return role.ownerRights;
}
}
Right right = (Right) fullRightsMap.get(object.getName());
return right == null || right.grantableRights == null ? Right.noRights : right.grantableRights;
}
use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.
the class Grantee method getGranteeAndAllRoles.
public OrderedHashSet getGranteeAndAllRoles() {
OrderedHashSet set = new OrderedHashSet();
addGranteeAndRoles(set);
return set;
}
use of org.hsqldb_voltpatches.lib.OrderedHashSet in project voltdb by VoltDB.
the class ParserCommand method compileLock.
private Statement compileLock() {
read();
readThis(Tokens.TABLE);
OrderedHashSet readSet = new OrderedHashSet();
OrderedHashSet writeSet = new OrderedHashSet();
outerloop: while (true) {
Table table = readTableName();
switch(token.tokenType) {
case Tokens.READ:
read();
readSet.add(table.getName());
break;
case Tokens.WRITE:
read();
writeSet.add(table.getName());
break;
default:
throw unexpectedToken();
}
if (token.tokenType == Tokens.COMMA) {
read();
continue;
}
break outerloop;
}
HsqlName[] readTableNames = new HsqlName[readSet.size()];
readSet.toArray(readTableNames);
HsqlName[] writeTableNames = new HsqlName[writeSet.size()];
writeSet.toArray(writeTableNames);
Statement cs = new StatementSession(StatementTypes.TRANSACTION_LOCK_TABLE, readTableNames, writeTableNames);
return cs;
}
Aggregations