Examples of OperatorFactory


Examples of com.asakusafw.vocabulary.operator.OperatorFactory

        assert operatorClass != null;
        assert methodName != null;
        assert portKind != null;
        assert portName != null;
        Class<?> factoryClass = findFactoryClass(operatorClass);
        OperatorFactory factory = factoryClass.getAnnotation(OperatorFactory.class);
        assert factory != null;
        Method factoryMethod = findFactoryMethod(factoryClass, methodName);
        OperatorInfo info = factoryMethod.getAnnotation(OperatorInfo.class);
        assert info != null;
        if (portKind == PortKind.INPUT) {
            boolean found = false;
            for (OperatorInfo.Input port : info.input()) {
                if (port.name().equals(portName)) {
                    found = true;
                    break;
                }
            }
            if (found == false) {
                List<String> list = new ArrayList<String>();
                for (OperatorInfo.Input port : info.input()) {
                    list.add(port.name());
                }
                throw new RewriteException(MessageFormat.format(
                        Messages.getString("TracepointWeaveRewriter.errorUnknownInputPort"), //$NON-NLS-1$
                        factoryClass.getName(),
                        factoryMethod.getName(),
                        portName,
                        list));
            }
        } else {
            boolean found = false;
            for (OperatorInfo.Output port : info.output()) {
                if (port.name().equals(portName)) {
                    found = true;
                    break;
                }
            }
            if (found == false) {
                List<String> list = new ArrayList<String>();
                for (OperatorInfo.Output port : info.output()) {
                    list.add(port.name());
                }
                throw new RewriteException(MessageFormat.format(
                        Messages.getString("TracepointWeaveRewriter.errorUnknownOutputPort"), //$NON-NLS-1$
                        factoryClass.getName(),
                        factoryMethod.getName(),
                        portName,
                        list));
            }
        }
        return new Tracepoint(factory.value().getName(), factoryMethod.getName(), portKind, portName);
    }
View Full Code Here

Examples of com.facebook.presto.operator.OperatorFactory

        @Override
        public OperatorFactory createOutputOperator(final int operatorId, final List<TupleInfo> sourceTupleInfo)
        {
            checkNotNull(sourceTupleInfo, "sourceTupleInfo is null");

            return new OperatorFactory()
            {
                @Override
                public List<TupleInfo> getTupleInfos()
                {
                    return ImmutableList.of();
View Full Code Here

Examples of com.facebook.presto.operator.OperatorFactory

            Object queryResult = Iterables.getOnlyElement(result.getMaterializedRows()).getField(0);
            results.add(queryResult);
        }

        // execute as standalone operator
        OperatorFactory operatorFactory = compileFilterProject(TRUE_LITERAL, projectionExpression, compiler);
        Object directOperatorValue = selectSingleValue(operatorFactory, session);
        results.add(directOperatorValue);

        // interpret
        Object interpretedValue = selectSingleValue(interpretedFilterProject(TRUE_LITERAL, projectionExpression, session));
View Full Code Here

Examples of com.facebook.presto.operator.OperatorFactory

        Expression filterExpression = createExpression(filter, metadata, SYMBOL_TYPES);

        List<Boolean> results = new ArrayList<>();

        // execute as standalone operator
        OperatorFactory operatorFactory = compileFilterProject(filterExpression, TRUE_LITERAL, compiler);
        results.add(executeFilter(operatorFactory, session));

        if (executeWithNoInputColumns) {
            // execute as standalone operator
            operatorFactory = compileFilterWithNoInputColumns(filterExpression, compiler);
View Full Code Here

Examples of com.facebook.presto.operator.OperatorFactory

                metadata,
                SQL_PARSER,
                session
        );

        OperatorFactory operatorFactory = new FilterAndProjectOperator.FilterAndProjectOperatorFactory(0, new GenericPageProcessor(filterFunction, ImmutableList.of(projectionFunction)), toTypes(
                ImmutableList.of(projectionFunction)));
        return operatorFactory.createOperator(createDriverContext(session));
    }
View Full Code Here

Examples of com.facebook.presto.operator.OperatorFactory

        @Override
        public PhysicalOperation visitExchange(ExchangeNode node, LocalExecutionPlanContext context)
        {
            List<Type> types = getSourceOperatorTypes(node, context.getTypes());

            OperatorFactory operatorFactory = new ExchangeOperatorFactory(context.getNextOperatorId(), node.getId(), exchangeClientSupplier, types);

            ImmutableMap.Builder<Symbol, Input> outputMappings = ImmutableMap.builder();
            int channel = 0;
            for (Symbol symbol : node.getOutputSymbols()) {
                outputMappings.put(symbol, new Input(channel));
View Full Code Here

Examples of com.facebook.presto.operator.OperatorFactory

            }

            // otherwise, introduce a projection to match the expected output
            IdentityProjectionInfo mappings = computeIdentityMapping(resultSymbols, source.getLayout(), context.getTypes());

            OperatorFactory operatorFactory = new FilterAndProjectOperatorFactory(context.getNextOperatorId(), FilterFunctions.TRUE_FUNCTION, mappings.getProjections());
            return new PhysicalOperation(operatorFactory, mappings.getOutputLayout(), source);
        }
View Full Code Here

Examples of com.facebook.presto.operator.OperatorFactory

            for (Symbol symbol : windowFunctionOutputSymbols) {
                outputMappings.put(symbol, new Input(channel));
                channel++;
            }

            OperatorFactory operatorFactory = new WindowOperatorFactory(
                    context.getNextOperatorId(),
                    source.getTypes(),
                    outputChannels.build(),
                    windowFunctions.build(),
                    partitionChannels.build(),
View Full Code Here

Examples of com.facebook.presto.operator.OperatorFactory

                sortOrders.add(node.getOrderings().get(symbol));
            }

            Optional<Integer> sampleWeightChannel = node.getSampleWeight().transform(source.channelGetter());

            OperatorFactory operator = new TopNOperatorFactory(
                    context.getNextOperatorId(),
                    source.getTypes(),
                    (int) node.getCount(),
                    sortChannels,
                    sortOrders,
View Full Code Here

Examples of com.facebook.presto.operator.OperatorFactory

            ImmutableList.Builder<Integer> outputChannels = ImmutableList.builder();
            for (int i = 0; i < source.getTypes().size(); i++) {
                outputChannels.add(i);
            }

            OperatorFactory operator = new OrderByOperatorFactory(
                    context.getNextOperatorId(),
                    source.getTypes(),
                    outputChannels.build(),
                    10_000,
                    orderByChannels,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.