Package com.odiago.flumebase.plan

Examples of com.odiago.flumebase.plan.CreateStreamNode


  @Override
  public PlanContext createExecPlan(PlanContext planContext) {
    // The execution plan for a CREATE STREAM statement is to
    // perform the DDL operation by itself and quit.

    planContext.getFlowSpec().addRoot(new CreateStreamNode(mName,
        mType, mSrcLocation, mIsLocal, mFields, mFormatSpec));
    return planContext;
  }
View Full Code Here


      // by the client.
      mMemOutputMap.put(bufferName, (MemoryOutputElement) newElem);
    } else if (node instanceof CreateStreamNode) {
      // Just perform this operation immediately. Do not translate this into another
      // layer. (This results in an empty flow being generated, which is discarded.)
      CreateStreamNode createStream = (CreateStreamNode) node;
      String streamName = createStream.getName();
      StreamSymbol streamSym = new StreamSymbol(createStream);
      if (!streamSym.getEventParser().validate(streamSym)) {
        // Fails final check of parameters
        // TODO: The EventParser is giving better info in its LOG; but this
        // should really be communicated back to the user.
        throw new DAGOperatorException(
            "Stream cannot be created with the specified parameters.");
      } else if (mRootSymbolTable.resolve(streamName) != null) {
        // TODO: Allow CREATE OR REPLACE STREAM to override this.
        throw new DAGOperatorException("Object already exists at top level: " + streamName);
      } else {
        mRootSymbolTable.addSymbol(streamSym);
        mSubmitterSession.sendInfo("CREATE STREAM");
      }

      if (createStream.getType().equals(StreamSourceType.File)
          && streamSym.getFormatSpec().getParam(FileSourceElement.TIMESTAMP_COL_KEY) == null) {
        // We're reading from a file, and making up timestamps based on read time.
        // Warn the user that timestamps will change between queries.
        StringBuilder sb = new StringBuilder();
        sb.append("Warning: File-based streams will set event timestamps based on read time.\n");
View Full Code Here

TOP

Related Classes of com.odiago.flumebase.plan.CreateStreamNode

Copyright © 2018 www.massapicom. 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.