Search in sources :

Example 1 with OperatorListManager

use of com.alibaba.maxgraph.compiler.optimizer.OperatorListManager in project GraphScope by alibaba.

the class TimelyExecutor method prepare.

@Override
public void prepare(String prepareId, TimelyQuery timelyQuery, ExecuteConfig executeConfig) {
    QueryFlowManager queryFlowManager = timelyQuery.getQueryFlowManager();
    checkArgument(queryFlowManager.checkValidPrepareFlow(), "There's no argument for prepare statement");
    try {
        if (statementStore.checkExist(prepareId)) {
            throw new RuntimeException("PREPARE " + prepareId + " fail for the same name statement has been exist.");
        }
        QueryFlowOuterClass.QueryFlow queryFlow = queryFlowManager.getQueryFlow().setQueryId(prepareId).build();
        rpcConnector.prepare(queryFlow, this.isAsyncGrpc);
        OperatorListManager operatorListManager = queryFlowManager.getOperatorListManager();
        statementStore.save(prepareId, new PrepareStoreEntity(operatorListManager.getPrepareEntityList(), operatorListManager.getLabelManager(), queryFlowManager.getResultValueType(), queryFlow));
        logger.info("PREPARE " + prepareId + " success");
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : OperatorListManager(com.alibaba.maxgraph.compiler.optimizer.OperatorListManager) QueryFlowManager(com.alibaba.maxgraph.compiler.optimizer.QueryFlowManager) PrepareStoreEntity(com.alibaba.maxgraph.compiler.prepare.store.PrepareStoreEntity) QueryFlowOuterClass(com.alibaba.maxgraph.QueryFlowOuterClass) IOException(java.io.IOException)

Aggregations

QueryFlowOuterClass (com.alibaba.maxgraph.QueryFlowOuterClass)1 OperatorListManager (com.alibaba.maxgraph.compiler.optimizer.OperatorListManager)1 QueryFlowManager (com.alibaba.maxgraph.compiler.optimizer.QueryFlowManager)1 PrepareStoreEntity (com.alibaba.maxgraph.compiler.prepare.store.PrepareStoreEntity)1 IOException (java.io.IOException)1