use of org.voltdb.catalog.Procedure in project voltdb by VoltDB.
the class TestInvocationAcceptancePolicy method testAdHocReadUserPermission.
@Test
public void testAdHocReadUserPermission() {
AuthSystem.AuthUser user = createUser(false, false, false, null, true, true, true);
StoredProcedureInvocation invocation = new StoredProcedureInvocation();
invocation.setProcName("@AdHoc_RO_MP");
invocation.setParams("select * from T;");
Procedure proc = SystemProcedureCatalog.listing.get("@AdHoc_RO_MP").asCatalogProcedure();
InvocationPermissionPolicy policy = new InvocationSqlPermissionPolicy();
assertEquals(policy.shouldAccept(user, invocation, proc), PolicyResult.ALLOW);
// A user that doesn't have adhoc permission
user = createUser(false, false, false, null, true, false, false);
assertEquals(policy.shouldAccept(user, invocation, proc), PolicyResult.DENY);
}
use of org.voltdb.catalog.Procedure in project voltdb by VoltDB.
the class TestFragmentProgressUpdate method setUp.
@Override
protected void setUp() throws Exception {
final int CLUSTER_ID = 2;
final long NODE_ID = 1;
super.setUp();
VoltDB.instance().readBuildInfo("Test");
m_warehousedata = new VoltTable(new VoltTable.ColumnInfo("W_ID", VoltType.SMALLINT), new VoltTable.ColumnInfo("W_NAME", VoltType.STRING), new VoltTable.ColumnInfo("W_STREET_1", VoltType.STRING), new VoltTable.ColumnInfo("W_STREET_2", VoltType.STRING), new VoltTable.ColumnInfo("W_CITY", VoltType.STRING), new VoltTable.ColumnInfo("W_STATE", VoltType.STRING), new VoltTable.ColumnInfo("W_ZIP", VoltType.STRING), new VoltTable.ColumnInfo("W_TAX", VoltType.FLOAT), new VoltTable.ColumnInfo("W_YTD", VoltType.FLOAT));
m_itemData = new VoltTable(new VoltTable.ColumnInfo("I_ID", VoltType.INTEGER), new VoltTable.ColumnInfo("I_IM_ID", VoltType.INTEGER), new VoltTable.ColumnInfo("I_NAME", VoltType.STRING), new VoltTable.ColumnInfo("I_PRICE", VoltType.FLOAT), new VoltTable.ColumnInfo("I_DATA", VoltType.STRING));
TPCCProjectBuilder builder = new TPCCProjectBuilder();
m_catalog = builder.createTPCCSchemaCatalog();
Cluster cluster = m_catalog.getClusters().get("cluster");
WAREHOUSE_TABLEID = m_catalog.getClusters().get("cluster").getDatabases().get("database").getTables().get("WAREHOUSE").getRelativeIndex();
ITEM_TABLEID = m_catalog.getClusters().get("cluster").getDatabases().get("database").getTables().get("ITEM").getRelativeIndex();
CatalogMap<Procedure> procedures = cluster.getDatabases().get("database").getProcedures();
m_testProc = procedures.getIgnoreCase("FragmentUpdateTestProcedure");
m_ee = new ExecutionEngineJNI(CLUSTER_ID, NODE_ID, 0, 0, "", 0, 64 * 1024, 100, new HashinatorConfig(HashinatorType.LEGACY, LegacyHashinator.getConfigureBytes(1), 0, 0), false);
}
Aggregations