Search in sources :

Example 1 with StreamProvider

use of org.finos.legend.engine.shared.core.url.StreamProvider in project legend-engine by finos.

the class AbstractServicePlanExecutor method execute.

protected Result execute(Map<String, ?> parameters, ServiceRunnerInput serviceRunnerInput, StreamProvider streamProvider) {
    MutableList<CommonProfile> profiles = Lists.mutable.empty();
    PlanExecutionContext planExecutionContext = null;
    if (serviceRunnerInput != null) {
        Identity identity = serviceRunnerInput.getIdentity();
        if (identity != null) {
            profiles.addAll(IdentityFactoryProvider.getInstance().adapt(identity));
        }
        if (serviceRunnerInput.getOperationalContext() != null && serviceRunnerInput.getOperationalContext().getGraphFetchCrossAssociationKeysCacheConfig() != null) {
            List<GraphFetchCache> graphFetchCaches = serviceRunnerInput.getOperationalContext().getGraphFetchCrossAssociationKeysCacheConfig().entrySet().stream().map(e -> ExecutionCacheBuilder.buildGraphFetchCacheByTargetCrossKeysFromExecutionCache(e.getValue(), e.getKey())).collect(Collectors.toList());
            planExecutionContext = new PlanExecutionContext(graphFetchCaches);
        }
    }
    return this.executor.execute(this.plan, parameters, streamProvider, profiles, planExecutionContext);
}
Also used : Identity(org.finos.legend.engine.shared.core.identity.Identity) Assert(org.finos.legend.engine.shared.core.operational.Assert) CommonProfile(org.pac4j.core.profile.CommonProfile) URL(java.net.URL) GraphFetchCache(org.finos.legend.engine.plan.execution.cache.graphFetch.GraphFetchCache) Lists(org.eclipse.collections.api.factory.Lists) SerializationFormat(org.finos.legend.engine.plan.execution.result.serialization.SerializationFormat) HashMap(java.util.HashMap) StreamProvider(org.finos.legend.engine.shared.core.url.StreamProvider) MutableList(org.eclipse.collections.api.list.MutableList) GraphFetchCrossAssociationKeys(org.finos.legend.engine.plan.execution.cache.graphFetch.GraphFetchCrossAssociationKeys) StoreExecutor(org.finos.legend.engine.plan.execution.stores.StoreExecutor) PlanExecutor(org.finos.legend.engine.plan.execution.PlanExecutor) ByteArrayInputStream(java.io.ByteArrayInputStream) StoreExecutorConfiguration(org.finos.legend.engine.plan.execution.stores.StoreExecutorConfiguration) Map(java.util.Map) ConstantResult(org.finos.legend.engine.plan.execution.result.ConstantResult) Multiplicity(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity) Path(java.nio.file.Path) ErrorResult(org.finos.legend.engine.plan.execution.result.ErrorResult) PlanExecutorInfo(org.finos.legend.engine.plan.execution.PlanExecutorInfo) OutputStream(java.io.OutputStream) Result(org.finos.legend.engine.plan.execution.result.Result) Files(java.nio.file.Files) StreamingResult(org.finos.legend.engine.plan.execution.result.StreamingResult) IOException(java.io.IOException) Reader(java.io.Reader) ExecutionCacheBuilder(org.finos.legend.engine.plan.execution.cache.ExecutionCacheBuilder) IdentityFactoryProvider(org.finos.legend.engine.shared.core.identity.factory.IdentityFactoryProvider) InputStreamReader(java.io.InputStreamReader) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) Objects(java.util.Objects) List(java.util.List) PlanExecutionContext(org.finos.legend.engine.plan.execution.PlanExecutionContext) ObjectMapperFactory(org.finos.legend.engine.shared.core.ObjectMapperFactory) ExecutionPlan(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.ExecutionPlan) BufferedReader(java.io.BufferedReader) Collections(java.util.Collections) InputStream(java.io.InputStream) CommonProfile(org.pac4j.core.profile.CommonProfile) GraphFetchCache(org.finos.legend.engine.plan.execution.cache.graphFetch.GraphFetchCache) Identity(org.finos.legend.engine.shared.core.identity.Identity) PlanExecutionContext(org.finos.legend.engine.plan.execution.PlanExecutionContext)

Aggregations

BufferedReader (java.io.BufferedReader)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 OutputStream (java.io.OutputStream)1 Reader (java.io.Reader)1 URL (java.net.URL)1 StandardCharsets (java.nio.charset.StandardCharsets)1 Files (java.nio.file.Files)1 Path (java.nio.file.Path)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1 Collectors (java.util.stream.Collectors)1 Lists (org.eclipse.collections.api.factory.Lists)1 MutableList (org.eclipse.collections.api.list.MutableList)1 PlanExecutionContext (org.finos.legend.engine.plan.execution.PlanExecutionContext)1