Ejemplo n.º 1
0
    def metadata(self):
        # istreams is an array that expects tuples of a type: (string, StreamGrouping).
        # In this example there are multiple istreams, therefore this computation is performing
        # a type of stream join.
        
        # The GROUP_BY enum instructs the framework that an aggregation by key is to be performed.
        # This ensures that records with the same key are always sent to the same instance of
        # this operator.

        # By aggregating two streams by key we can be assured that records from any stream emitted
        # on a particular provider will always be sent to the same instance of CtrCalculator.
        return Metadata(
            name='ctr-calculator',
            istreams=[ ('impressions', StreamGrouping.GROUP_BY),
                        ('clicks', StreamGrouping.GROUP_BY) ]
            ostreams=[ 'click_through_rate' ])
Ejemplo n.º 2
0
 def metadata(self):
     return Metadata(name=self.name, istreams=[], ostreams=self.ostreams)
Ejemplo n.º 3
0
 def metadata(self):
     return Metadata(name='coinbase-indx', istreams=[], ostreams=['btcusd'])
Ejemplo n.º 4
0
 def metadata(self):
     return Metadata(name='first', istreams=[], ostreams=["outstream"])
Ejemplo n.º 5
0
 def metadata(self):
     return Metadata(name='cyclical',
                     istreams=[("cycle", StreamGrouping.GROUP_BY)],
                     ostreams=["cycle"])
Ejemplo n.º 6
0
 def metadata(self):
     return Metadata(name='sentence-splitter',
                     istreams=['sentences'],
                     ostreams=['words'])
Ejemplo n.º 7
0
 def metadata(self):
     return Metadata(name="gatherer",
                     istreams=["nothing_going_here"],
                     ostreams=[])
Ejemplo n.º 8
0
 def metadata(self):
     return Metadata(
         name='something',
         istreams=[],
         ostreams=["outputstream"])
Ejemplo n.º 9
0
 def metadata(self):
     return Metadata(name=self.name,
                     istreams=[],
                     ostreams=["nothing_going_here"])
Ejemplo n.º 10
0
 def metadata(self):
     return Metadata(name='sentence-generator',
                     istreams=[],
                     ostreams=['sentences'])
Ejemplo n.º 11
0
 def metadata(self):
     return Metadata(
         name='BayesianChangepointDetection',
         istreams=self.istream,
         ostreams=self.ostream)
Ejemplo n.º 12
0
 def metadata(self):
     return Metadata(name='coinbase-price-printer',
                     istreams=['btcusd'],
                     ostreams=[])
Ejemplo n.º 13
0
 def metadata(self):
     return Metadata(name='word-counter',
                     istreams=[('words', StreamGrouping.GROUP_BY)],
                     ostreams=[])
Ejemplo n.º 14
0
 def metadata(self):
     return Metadata(name='final',
                     istreams=[("outstream", StreamGrouping.GROUP_BY)],
                     ostreams=[])