private static void assertDeploy(RegressionEnvironment env, EPCompiled compiled, AtomicInteger milestone, Object userObject) { DeploymentOptions options = new DeploymentOptions(); options.setStatementUserObjectRuntime(new StatementUserObjectRuntimeOption() { public Object getUserObject(StatementUserObjectRuntimeContext env) { return userObject; } }); try { env.deployment().deploy(compiled, options); } catch (EPDeployException e) { fail(e.getMessage()); } env.undeployAll(); }
private static DeploymentInternal deploy(boolean recovery, String deploymentId, int statementIdFirstStatement, EPCompiled compiled, StatementNameRuntimeOption statementNameResolverRuntime, StatementUserObjectRuntimeOption userObjectResolverRuntime, StatementSubstitutionParameterOption substitutionParameterResolver, EPRuntimeSPI epRuntime) throws EPDeployException { // set variable local version epRuntime.getServicesContext().getVariableManagementService().setLocalVersion(); try { return deploySafe(recovery, deploymentId, statementIdFirstStatement, compiled, statementNameResolverRuntime, userObjectResolverRuntime, substitutionParameterResolver, epRuntime); } catch (EPDeployException ex) { throw ex; } catch (Throwable t) { throw new EPDeployException(t.getMessage(), t); } }
private static void tryInvalidDeploy(RegressionEnvironment env, EPCompiled compiled, String text, String moduleName) { String message = "A precondition is not satisfied: " + text + " has already been created for module '" + moduleName + "'"; try { env.runtime().getDeploymentService().deploy(compiled); fail(); } catch (EPDeployPreconditionException ex) { if (!message.equals("skip")) { SupportMessageAssertUtil.assertMessage(ex.getMessage(), message); } } catch (EPDeployException ex) { ex.printStackTrace(); fail(); } } }
runtime.getDeploymentService().deploy(compiled, new DeploymentOptions().setDeploymentId("assetmonitor")); } catch (EPDeployException ex) { throw new RuntimeException("Failed to deploy: " + ex.getMessage(), ex);
throw new EPDeployException("Cannot deploy EPL that was compiled as a fire-and-forget query, make sure to use the 'compile' method of the compiler"); throw new EPDeployException("Failed to find module provider class name in manifest (is this a compiled module?)");
private static void tryInvalidDeploy(RegressionEnvironment env, EPCompiled compiled, String text) { String message = "A precondition is not satisfied: Required " + text + " cannot be found"; try { env.runtime().getDeploymentService().deploy(compiled); fail(); } catch (EPDeployPreconditionException ex) { if (!message.equals("skip")) { SupportMessageAssertUtil.assertMessage(ex.getMessage(), message); } } catch (EPDeployException ex) { ex.printStackTrace(); fail(); } }
public void registerStatement(String epl, Object userObject) { // Compile statement. We simply use the provided configuration. CompilerArguments args = new CompilerArguments(runtime.getConfigurationDeepCopy()); args.getConfiguration().getCompiler().getByteCode().setAllowSubscriber(true); // using subcribers EPCompiled compiled; try { compiled = EPCompilerProvider.getCompiler().compile(epl, args); } catch (EPCompileException e) { throw new RuntimeException("Failed to compile: " + e.getMessage(), e); } EPStatement stmt; try { stmt = runtime.getDeploymentService().deploy(compiled, new DeploymentOptions().setStatementUserObjectRuntime(ctx -> userObject)).getStatements()[0]; } catch (EPDeployException e) { throw new RuntimeException("Failed to deploy: " + e.getMessage(), e); } if (System.getProperty("esper.benchmark.ul") != null) { stmt.addListener(updateListener); } else { stmt.setSubscriber(subscriber); } }
throw new EPDeployException("Duplicate statement name provide by statement name resolver for statement name '" + statementName + "'"); log.warn(udex.getMessage(), udex); throw new EPDeployException("Failed to deploy: " + t.getMessage(), t);
admin.deploy(compiled); } catch (EPDeployException ex) { ex.printStackTrace(); fail();
public void run(RegressionEnvironment env) { MyUserObjectRuntimeOption.getContexts().clear(); String epl = "@name('s0') select * from SupportBean"; EPCompiled compiled = env.compile(epl); DeploymentOptions options = new DeploymentOptions(); options.setStatementUserObjectRuntime(new MyUserObjectRuntimeOption()); try { env.deployment().deploy(compiled, options); } catch (EPDeployException e) { fail(e.getMessage()); } StatementUserObjectRuntimeContext ctx = MyUserObjectRuntimeOption.getContexts().get(0); assertEquals("s0", ctx.getStatementName()); assertEquals(env.deploymentId("s0"), ctx.getDeploymentId()); assertSame(env.statement("s0").getAnnotations(), ctx.getAnnotations()); assertEquals(epl, ctx.getEpl()); env.undeployAll(); } }
public void run(RegressionEnvironment env) { MyStatementNameRuntimeResolver.getContexts().clear(); String epl = "@name('s0') select * from SupportBean"; EPCompiled compiled = env.compile(epl); DeploymentOptions options = new DeploymentOptions(); options.setStatementNameRuntime(new MyStatementNameRuntimeResolver()); try { env.deployment().deploy(compiled, options); } catch (EPDeployException e) { fail(e.getMessage()); } StatementNameRuntimeContext ctx = MyStatementNameRuntimeResolver.getContexts().get(0); assertEquals("s0", ctx.getStatementName()); assertEquals(env.deploymentId("hello"), ctx.getDeploymentId()); assertSame(env.statement("hello").getAnnotations(), ctx.getAnnotations()); assertEquals(epl, ctx.getEpl()); assertEquals("hello", env.statement("hello").getName()); env.milestone(0); assertEquals("hello", env.statement("hello").getName()); env.undeployAll(); } }
public void run(RegressionEnvironment env) { RegressionPath path = new RegressionPath(); env.compileDeploy("create window SomeWindow#keepall as SupportBean", path); EPCompiled compiledFAF = env.compileFAF("select * from SomeWindow", path); EPCompiled compiledModule = env.compile("select * from SomeWindow", path); try { env.runtime().getDeploymentService().deploy(compiledFAF); fail(); } catch (EPDeployException ex) { assertEquals("Cannot deploy EPL that was compiled as a fire-and-forget query, make sure to use the 'compile' method of the compiler", ex.getMessage()); } try { env.runtime().getFireAndForgetService().executeQuery(compiledModule); fail(); } catch (EPException ex) { assertEquals("Cannot execute a fire-and-forget query that was compiled as module EPL, make sure to use the 'compileQuery' method of the compiler", ex.getMessage()); } env.undeployAll(); } }
deployerResult = Deployer.deployRecover(entry.getKey(), entry.getValue().getStatementIdFirstStatement(), entry.getValue().getCompiled(), statementNameResolver, userObjectResolver, substitutionParameterResolver, this); } catch (EPDeployException ex) { throw new EPException(ex.getMessage(), ex);
env.deployment().deploy(compiled, new DeploymentOptions().setDeploymentId("MyDeploymentId")); } catch (EPDeployException e) { fail(e.getMessage()); env.deployment().deploy(compiled, new DeploymentOptions().setDeploymentId("MyDeploymentId")); } catch (EPDeployException e) { fail(e.getMessage()); env.deployment().deploy(compiled, new DeploymentOptions().setDeploymentId("MyDeploymentId")); } catch (EPDeployException e) { fail(e.getMessage());
fail(); } catch (EPDeployException ex) { SupportMessageAssertUtil.assertMessage(ex.getMessage(), "Failed to deploy: Unique index violation, index 'SecIndex' is a unique index and key 'E1' already exists");