// 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");