private CustomSchemaStateExecutor createSchemaReviewExecutor(Map<String, Object> props, SchemaVersionLifecycleStateMachine.Builder builder) { Map<String, Object> schemaReviewExecConfig = (Map<String, Object>) props.getOrDefault("customSchemaStateExecutor", Collections.emptyMap()); String className = (String) schemaReviewExecConfig.getOrDefault("className", DEFAULT_SCHEMA_REVIEW_EXECUTOR_CLASS); Map<String, ?> executorProps = (Map<String, ?>) schemaReviewExecConfig.getOrDefault("props", Collections.emptyMap()); CustomSchemaStateExecutor customSchemaStateExecutor; try { customSchemaStateExecutor = (CustomSchemaStateExecutor) Class.forName(className, true, Thread.currentThread() .getContextClassLoader()) .newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { LOG.error("Error encountered while loading class [{}]", className, e); throw new IllegalArgumentException(e); } customSchemaStateExecutor.init(builder, SchemaVersionLifecycleStates.REVIEWED.getId(), SchemaVersionLifecycleStates.CHANGES_REQUIRED.getId(), executorProps); return customSchemaStateExecutor; }
private static void transitionToStartReview(SchemaVersionLifecycleContext context) throws SchemaLifecycleException, SchemaNotFoundException { context.setState(START_REVIEW); // execute start review process, updation of the state should be done by schemaReviewExecutor context.getCustomSchemaStateExecutor().executeReviewState(context); }
private static void transitionToStartReview(SchemaVersionLifecycleContext context) throws SchemaLifecycleException, SchemaNotFoundException { context.setState(START_REVIEW); // execute start review process, updation of the state should be done by schemaReviewExecutor context.getCustomSchemaStateExecutor().executeReviewState(context); }