Search in sources :

Example 6 with ModifiedTransformResponse

use of com.thinkbiganalytics.spark.rest.model.ModifiedTransformResponse in project kylo by Teradata.

the class AbstractTransformResponseModifier method modify.

/**
 * Wrapper around the TransformRespone object
 * This will call the <code>modifySuccessfulResults()</code> method when successfully returned
 * otherwise it will return the wrapped response in its same state (i.e. PENDING, ERROR)
 * @param response the response to check
 * @return
 */
public ModifiedTransformResponse<T> modify(TransformResponse response) {
    this.response = response;
    this.responseTransformer = new TransformResponseUtil(response);
    ModifiedTransformResponse modifiedTransformResponse = new ModifiedTransformResponse(response);
    if (response.getStatus() == TransformResponse.Status.SUCCESS) {
        modifySuccessfulResults(modifiedTransformResponse);
    }
    return modifiedTransformResponse;
}
Also used : ModifiedTransformResponse(com.thinkbiganalytics.spark.rest.model.ModifiedTransformResponse)

Aggregations

ModifiedTransformResponse (com.thinkbiganalytics.spark.rest.model.ModifiedTransformResponse)6 FileMetadataResponse (com.thinkbiganalytics.spark.rest.model.FileMetadataResponse)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 TransformResponse (com.thinkbiganalytics.spark.rest.model.TransformResponse)3 Map (java.util.Map)3 Collectors (java.util.stream.Collectors)3 FileParserFactory (com.thinkbiganalytics.discovery.FileParserFactory)2 SchemaParserDescriptor (com.thinkbiganalytics.discovery.model.SchemaParserDescriptor)2 FileSchemaParser (com.thinkbiganalytics.discovery.parser.FileSchemaParser)2 SampleFileSparkScript (com.thinkbiganalytics.discovery.parser.SampleFileSparkScript)2 SparkFileSchemaParser (com.thinkbiganalytics.discovery.parser.SparkFileSchemaParser)2 SchemaParserAnnotationTransformer (com.thinkbiganalytics.discovery.rest.controller.SchemaParserAnnotationTransformer)2 AbstractTransformResponseModifier (com.thinkbiganalytics.spark.rest.controller.AbstractTransformResponseModifier)2 FileMetadataTransformResponseModifier (com.thinkbiganalytics.spark.rest.filemetadata.FileMetadataTransformResponseModifier)2 Arrays (java.util.Arrays)2 Optional (java.util.Optional)2 Cache (com.google.common.cache.Cache)1 CacheBuilder (com.google.common.cache.CacheBuilder)1 Lists (com.google.common.collect.Lists)1