public static EPDeployment deploy(EPCompiled compiledStmt, EPRuntime runtime) { try { return runtime.getDeploymentService().deploy(compiledStmt); } catch (EPDeployException e) { throw new RuntimeException(e); } }
private EPDeployment tryDeploy(EPCompiled compiled) { try { return runtime.getDeploymentService().deploy(compiled); } catch (EPDeployException ex) { throw notExpected(ex); } }
public RegressionEnvironment deploy(EPCompiled compiled, DeploymentOptions options) { try { runtime.getDeploymentService().deploy(compiled, options); } catch (EPDeployException ex) { throw notExpected(ex); } return this; }
public static EPDeployment compileDeploy(String epl, EPRuntime runtime, Configuration configuration) { EPCompiled compiled = compile(epl, configuration, new RegressionPath()); try { return runtime.getDeploymentService().deploy(compiled); } catch (Throwable t) { throw new RuntimeException(t); } }
public static void deploy(EPRuntime runtime, EPCompiled compiled) { try { runtime.getDeploymentService().deploy(compiled, new DeploymentOptions().setDeploymentId("stockticker")); } catch (EPDeployException ex) { throw new RuntimeException(ex); } } }
private static void deployWithResolver(RegressionEnvironment env, EPCompiled compiled, String statementName, StatementSubstitutionParameterOption resolver) { DeploymentOptions options = new DeploymentOptions().setStatementSubstitutionParameter(resolver); options.setStatementNameRuntime(context -> statementName); try { env.deployment().deploy(compiled, options); } catch (EPDeployException e) { throw new RuntimeException(e); } }
public static void deployAddListener(EPCompiled compiledStmt, String stmtName, UpdateListener listener, EPRuntime runtime) { try { EPDeployment deployed = runtime.getDeploymentService().deploy(compiledStmt, new DeploymentOptions().setStatementNameRuntime(ctx -> stmtName)); if (deployed.getStatements().length != 1) { throw new UnsupportedOperationException("This method is designed for a single statement"); } deployed.getStatements()[0].addListener(listener); } catch (EPDeployException e) { throw new RuntimeException(e); } }
private EPStatement compileDeploy(String expression, Configuration config, EPRuntime runtime) { try { CompilerArguments args = new CompilerArguments(config); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(expression, args); EPDeployment deployment = runtime.getDeploymentService().deploy(compiled); // EPL modules can have multiple statements // We return the first statement here. return deployment.getStatements()[0]; } catch (Exception ex) { throw new RuntimeException(ex); } }
private static void tryInvalidDeployNoCallbackProvided(RegressionEnvironment env, String stmt) { EPCompiled compiled = env.compile(stmt); try { env.deployment().deploy(compiled); fail(); } catch (EPDeploySubstitutionParameterException ex) { assertEquals("Substitution parameters have not been provided: Statement 's0' has 1 substitution parameters", ex.getMessage()); } catch (EPDeployException ex) { throw new RuntimeException(ex); } }
public String deployGetId(EPCompiled compiled) { try { return runtime().getDeploymentService().deploy(compiled).getDeploymentId(); } catch (EPDeployException ex) { throw notExpected(ex); } }
public static void tryInvalidDeploy(RegressionEnvironment env, EPCompiled unit, String expected) { try { env.runtime().getDeploymentService().deploy(unit); fail(); } catch (EPDeployException ex) { assertMessage(ex, expected); } }
private static void tryInvalidResolver(RegressionEnvironment env, EPCompiled compiled, String expected, StatementSubstitutionParameterOption resolver) { DeploymentOptions options = new DeploymentOptions().setStatementSubstitutionParameter(resolver); try { env.deployment().deploy(compiled, options); fail(); } catch (EPDeploySubstitutionParameterException e) { SupportMessageAssertUtil.assertMessage(e.getMessage(), expected); } catch (EPDeployException e) { throw new RuntimeException(e); } }
public static void tryInvalidDeploy(RegressionEnvironment env, RegressionPath path, String epl, String expected) { EPCompiled compiled = env.compile(epl, path); try { env.runtime().getDeploymentService().deploy(compiled); fail(); } catch (EPDeployException ex) { assertMessage(ex, expected); } path.getCompileds().remove(compiled); }
private EPStatement compileDeploy(String expression, String statementName) { try { CompilerArguments args = new CompilerArguments(runtime.getRuntimePath()); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(expression, args); DeploymentOptions options = new DeploymentOptions(); options.setStatementNameRuntime(env -> statementName); return runtime.getDeploymentService().deploy(compiled, options).getStatements()[0]; } catch (Exception ex) { throw new RuntimeException("Failed to compile and deploy: " + ex.getMessage(), ex); } } }
private static EPDeployment createStmt(EPRuntime runtime, String epl) { try { Configuration configuration = runtime.getConfigurationDeepCopy(); CompilerArguments args = new CompilerArguments(configuration); args.getPath().add(runtime.getRuntimePath()); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(epl, args); return runtime.getDeploymentService().deploy(compiled); } catch (Exception ex) { throw new RuntimeException(ex); } } }
public static EPDeployment compileDeploy(EPRuntime runtime, String epl) { try { Configuration configuration = runtime.getConfigurationDeepCopy(); CompilerArguments args = new CompilerArguments(configuration); args.getPath().add(runtime.getRuntimePath()); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(epl, args); return runtime.getDeploymentService().deploy(compiled); } catch (Exception ex) { throw new RuntimeException(ex); } }
private EPDeployment compileDeploySubscription(EPRuntimeSPI runtime, String eventTypeName, String name) { try { String epl = "@name('" + name + "') select * from " + eventTypeName; CompilerArguments args = new CompilerArguments(runtime.getConfigurationDeepCopy()); args.getPath().add(runtime.getRuntimePath()); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(epl, args); return runtime.getDeploymentService().deploy(compiled); } catch (Exception ex) { throw new EPException("Failed to compile and deploy subscription: " + ex.getMessage(), ex); } }
private EPDeployment compileDeploySubscription(EPRuntimeSPI runtime, String eventTypeName, String name) { try { String epl = "@name('" + name + "') select * from " + eventTypeName; CompilerArguments args = new CompilerArguments(runtime.getConfigurationDeepCopy()); args.getPath().add(runtime.getRuntimePath()); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(epl, args); return runtime.getDeploymentService().deploy(compiled); } catch (Exception ex) { throw new EPException("Failed to compile and deploy subscription: " + ex.getMessage(), ex); } } }
private EPDeployment compileDeploySubscription(EPRuntimeSPI runtime, String eventTypeName, String name) { try { String epl = "@name('" + name + "') select * from " + eventTypeName; CompilerArguments args = new CompilerArguments(runtime.getConfigurationDeepCopy()); args.getPath().add(runtime.getRuntimePath()); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(epl, args); return runtime.getDeploymentService().deploy(compiled); } catch (Exception ex) { throw new EPException("Failed to compile and deploy subscription: " + ex.getMessage(), ex); } } }
protected static EPStatement compileDeploy(String epl, EPRuntime runtime) { try { CompilerArguments args = new CompilerArguments(); args.getPath().add(runtime.getRuntimePath()); args.getOptions().setAccessModifierEventType(env -> NameAccessModifier.PUBLIC); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(epl, args); EPDeployment deployment = runtime.getDeploymentService().deploy(compiled); return deployment.getStatements()[0]; } catch (Exception ex) { throw new RuntimeException(ex); } }