// Create a stream we will fill with numbers via flume.
File sourceFile = File.createTempFile("numberstream-", ".txt");
sourceFile.deleteOnExit();
String sourceFilename = sourceFile.getAbsolutePath();
StreamBuilder streamBuilder = new StreamBuilder("inputstream");
streamBuilder.addField(new TypedField("a", Type.getPrimitive(Type.TypeName.INT)));
streamBuilder.setFormat(new FormatSpec("delimited"));
streamBuilder.setLocal(true);
streamBuilder.setSourceType(StreamSourceType.Source);
streamBuilder.setSource("tail(\"" + sourceFilename + "\")");
StreamSymbol inputStream = streamBuilder.build();
getSymbolTable().addSymbol(inputStream);
LocalEnvironment env = getEnvironment();
env.connect();