Database Reference
In-Depth Information
new Values(
" "+Math. pow (input.getDouble(0),
input.getDouble(1)),
input.getValue(2)
)
);
}
public void declareOutputFields(OutputFieldsDeclarer
declarer) {
declarer.declare( new
Fields("result","return-info"));
}
}
Most of the time, topologies like this are not built by hand. In older versions
of Storm the LinearDRPCTopologyBuilder class is used to construct
these topologies. It automatically adds the appropriate DRPCSpout spout
and ReturnResults bolt to the topology and ensures that the topology
itself is linear. In newer versions of Storm, this has been deprecated in favor
of the Trident version, which is created using the newDRPCStream method
instead of the usual newStream method. The Trident domain-specific
language is discussed in much more detail in the next section.
Trident: The Storm DSL
With version 0.8.0, Storm introduced a new domain-specific language that
isintendedtobethepreferredmethodfordevelopingStormtopologies.This
domain-specific language is called Trident. In Storm 0.9.0 it has undergone
extensive development.
The goal of the Trident interface is to provide a higher-level abstraction
similar to what is found in Hadoop frameworks, such as Cascading. Rather
than providing the very primitive spout and bolt interface, Trident operates
on streams. These streams can be manipulated with high-level concepts,
suchasjoins,groups,aggregates,andfilters.Italsoaddssomeprimitivesfor
state management and persistence, particularly in the case of aggregation.
Underneath the hood, Trident is still using the same bolt and spout
interface. The difference is that each operation defined in a Trident topology
does not necessarily result in a new bolt being created. This allows the
Search WWH ::




Custom Search