当前位置: 首页>>代码示例>>Python>>正文


Python PubsubManagementServiceProcessClient.read_stream_definition方法代码示例

本文整理汇总了Python中interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient.read_stream_definition方法的典型用法代码示例。如果您正苦于以下问题:Python PubsubManagementServiceProcessClient.read_stream_definition方法的具体用法?Python PubsubManagementServiceProcessClient.read_stream_definition怎么用?Python PubsubManagementServiceProcessClient.read_stream_definition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient的用法示例。


在下文中一共展示了PubsubManagementServiceProcessClient.read_stream_definition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        '''
        Starts the process
        '''
        log.info('Replay Process Started')
        super(ReplayProcess,self).on_start()
        dsm_cli = DatasetManagementServiceProcessClient(process=self)
        pubsub  = PubsubManagementServiceProcessClient(process=self)

        self.dataset_id      = self.CFG.get_safe('process.dataset_id', None)
        self.delivery_format = self.CFG.get_safe('process.delivery_format',{})
        self.start_time      = self.CFG.get_safe('process.query.start_time', None)
        self.end_time        = self.CFG.get_safe('process.query.end_time', None)
        self.stride_time     = self.CFG.get_safe('process.query.stride_time', None)
        self.parameters      = self.CFG.get_safe('process.query.parameters',None)
        self.publish_limit   = self.CFG.get_safe('process.query.publish_limit', 10)
        self.tdoa            = self.CFG.get_safe('process.query.tdoa',None)
        self.stream_id       = self.CFG.get_safe('process.publish_streams.output', '')
        self.stream_def      = pubsub.read_stream_definition(stream_id=self.stream_id)
        self.stream_def_id   = self.stream_def._id

        self.publishing.clear()
        self.play.set()
        self.end.clear()

        if self.dataset_id is None:
            raise BadRequest('dataset_id not specified')

        self.dataset = dsm_cli.read_dataset(self.dataset_id)
        self.pubsub = PubsubManagementServiceProcessClient(process=self)
开发者ID:swarbhanu,项目名称:coi-services,代码行数:32,代码来源:replay_process.py

示例2: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(SalinityTransform, self).on_start()

        self.sal_stream = self.CFG.process.publish_streams.values()[0]

        # Read the parameter dict from the stream def of the stream
        pubsub = PubsubManagementServiceProcessClient(process=self)
        self.stream_definition = pubsub.read_stream_definition(stream_id=self.sal_stream)
开发者ID:Bobfrat,项目名称:coi-services,代码行数:10,代码来源:ctd_L2_salinity.py

示例3: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(EventTriggeredTransform_A, self).on_start()

        self.awake = False

        self.cond_stream = self.CFG.process.publish_streams.values()[0]

        # Read the parameter dict from the stream def of the stream
        pubsub = PubsubManagementServiceProcessClient(process=self)
        self.stream_definition = pubsub.read_stream_definition(stream_id=self.cond_stream)
开发者ID:jamie-cyber1,项目名称:coi-services,代码行数:12,代码来源:event_triggered_transform.py

示例4: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(CTDL1ConductivityTransform, self).on_start()

        if not self.CFG.process.publish_streams.has_key('conductivity'):
            raise BadRequest("For CTD transforms, please send the stream_id using "
                             "a special keyword (ex: conductivity)")
        self.cond_stream = self.CFG.process.publish_streams.conductivity

        # Read the parameter dict from the stream def of the stream
        pubsub = PubsubManagementServiceProcessClient(process=self)
        self.stream_definition = pubsub.read_stream_definition(stream_id=self.cond_stream)
开发者ID:blazetopher,项目名称:coi-services,代码行数:13,代码来源:ctd_L1_conductivity.py

示例5: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(PresfL1Transform, self).on_start()

        if not self.CFG.process.publish_streams.has_key('seafloor_pressure'):
            raise BadRequest("For the PresfL1Transform, please send the stream_id using "
                             "a special keyword (ex: seafloor_pressure)")

        self.pres_stream = self.CFG.process.publish_streams.seafloor_pressure

        # Read the parameter dict from the stream def of the stream
        pubsub = PubsubManagementServiceProcessClient(process=self)
        self.stream_definition = pubsub.read_stream_definition(stream_id=self.pres_stream)
开发者ID:blazetopher,项目名称:coi-services,代码行数:14,代码来源:presf_L1.py

示例6: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(CTDL1TemperatureTransform, self).on_start()

        if not self.CFG.process.publish_streams.has_key('temperature'):
            raise BadRequest("For CTD transforms, please send the stream_id using a "
                                 "special keyword (ex: temperature)")

        self.temp_stream = self.CFG.process.publish_streams.temperature

        # Read the parameter dict from the stream def of the stream
        pubsub = PubsubManagementServiceProcessClient(process=self)
        self.stream_definition = pubsub.read_stream_definition(stream_id=self.temp_stream)
开发者ID:blazetopher,项目名称:coi-services,代码行数:14,代码来源:ctd_L1_temperature.py

示例7: VizTransformGoogleDT

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
class VizTransformGoogleDT(TransformDataProcess):

    """
    This class is used for  converting incoming data from CDM format to JSON style Google DataTables

    Note: One behaviour that this class is expected to achieve specifically is to determine if its supposed
        to work as a realtime transform (exists indefinitely and maintains a sliding window of data) or as
        a replay transform (one-shot).

        [2] This transform behaves as an instantaneous forwarder. There is no waiting for the entire stream
            to create the complete datatable. As the granules come in, they are translated to the datatable
            'components'. Components, because we are not creating the actual datatable in this code. That's the job
            of the viz service to put all the components of a datatable together in JSON format before sending it
            to the client

        [3] The time stamp in the incoming stream can't be converted to the datetime object here because
            the Raw stream definition only expects regular primitives (strings, floats, ints etc)

    Usage: https://gist.github.com/3834918

    """

    output_bindings = ['google_dt_components']


    def __init__(self):
        super(VizTransformGoogleDT, self).__init__()

    def on_start(self):
        self.pubsub_management = PubsubManagementServiceProcessClient(process=self)

        self.stream_info  = self.CFG.get_safe('process.publish_streams', {})
        self.stream_names = self.stream_info.keys()
        self.stream_ids   = self.stream_info.values()
        if not self.stream_names:
            raise BadRequest('Google DT Transform has no output streams.')

        super(VizTransformGoogleDT,self).on_start()



    def recv_packet(self, packet, in_stream_route, in_stream_id):
        log.info('Received packet')
        outgoing = VizTransformGoogleDTAlgorithm.execute(packet, params=self.get_stream_definition())
        for stream_name in self.stream_names:
            publisher = getattr(self, stream_name)
            publisher.publish(outgoing)


    def get_stream_definition(self):
        stream_id = self.stream_ids[0]
        self.stream_def = self.pubsub_management.read_stream_definition(stream_id=stream_id)
        return self.stream_def._id
开发者ID:tomoreilly,项目名称:coi-services,代码行数:55,代码来源:google_dt.py

示例8: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):

        pubsub = PubsubManagementServiceProcessClient(process=self)
        if self.CFG.process.publish_streams.has_key("salinity"):
            self.sal_stream = self.CFG.process.publish_streams.salinity
        elif self.CFG.process.publish_streams.has_key("output"):
            self.sal_stream = self.CFG.process.publish_streams.output
            self.salinity = self.output
        self.CFG.process.stream_id = self.sal_stream
        self.stream_id = self.sal_stream
        self.stream_def = pubsub.read_stream_definition(stream_id=self.sal_stream)

        super(SalinityDoubler, self).on_start()
开发者ID:newbrough,项目名称:coi-services,代码行数:15,代码来源:example_double_salinity.py

示例9: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(CTDBP_L1_Transform, self).on_start()

        self.L1_stream_id = self.CFG.process.publish_streams.values()[0]

        # Read the parameter dict from the stream def of the stream
        pubsub = PubsubManagementServiceProcessClient(process=self)
        stream_def = pubsub.read_stream_definition(stream_id=self.L1_stream_id)
        self.stream_definition_id = stream_def._id

        self.temp_calibration_coeffs = self.CFG.process.calibration_coeffs['temp_calibration_coeffs']
        self.pres_calibration_coeffs = self.CFG.process.calibration_coeffs['pres_calibration_coeffs']
        self.cond_calibration_coeffs = self.CFG.process.calibration_coeffs['cond_calibration_coeffs']
开发者ID:Bobfrat,项目名称:coi-services,代码行数:15,代码来源:ctdbp_L1.py

示例10: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(CTDBP_L0_all, self).on_start()

        self.L0_stream_id = self.CFG.process.publish_streams.values()[0]

        log.debug("the output stream: %s", self.L0_stream_id)

        pubsub = PubsubManagementServiceProcessClient(process=self)
        self.stream_def_L0 = pubsub.read_stream_definition(stream_id=self.L0_stream_id)

        self.params = {'L0_stream' : self.stream_def_L0._id }

        log.debug("the params: %s", self.params)
开发者ID:Bobfrat,项目名称:coi-services,代码行数:15,代码来源:ctdbp_L0.py

示例11: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(EventTriggeredTransform_B, self).on_start()

        self.awake = False

        if not self.CFG.process.publish_streams.has_key('output'):
            raise BadRequest("For event triggered transform, please send the stream_id "
                             "using the special keyword, output")

        self.output = self.CFG.process.publish_streams.output

        # Read the parameter dict from the stream def of the stream
        pubsub = PubsubManagementServiceProcessClient(process=self)
        self.stream_definition = pubsub.read_stream_definition(stream_id=self.output)
开发者ID:kerfoot,项目名称:coi-services,代码行数:16,代码来源:event_triggered_transform.py

示例12: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(SimpleCtdPublisher,self).on_start()
        pubsub_cli = PubsubManagementServiceProcessClient(process=self)
        self.stream_id = self.CFG.get_safe('process.stream_id',{})
        self.interval  = self.CFG.get_safe('process.interval', 1.0)
        #self.last_time = self.CFG.get_safe('process.last_time', 0)

        self.stream_def = pubsub_cli.read_stream_definition(stream_id=self.stream_id)
        self.pdict      = self.stream_def.parameter_dictionary


        self.finished = gevent.event.Event()
        self.greenlet = gevent.spawn(self.publish_loop)
        self._stats['publish_count'] = 0
        log.info('SimpleCTDPublisher started, publishing to %s', self.publisher.stream_route.__dict__)
开发者ID:Bobfrat,项目名称:coi-services,代码行数:17,代码来源:ctd_stream_publisher.py

示例13: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(CTDBP_L0_all, self).on_start()

        if not self.CFG.process.publish_streams.has_key('L0_stream'):
            raise BadRequest("For CTD transforms, please send the stream_id for the L0_stream using "
                             "a special keyword (L0_stream)")
        self.L0_stream_id = self.CFG.process.publish_streams.L0_stream

        log.debug("the output stream: %s", self.L0_stream_id)

        pubsub = PubsubManagementServiceProcessClient(process=self)
        self.stream_def_L0 = pubsub.read_stream_definition(stream_id=self.L0_stream_id)

        self.params = {'L0_stream' : self.stream_def_L0._id }

        log.debug("the params: %s", self.params)
开发者ID:mbarry02,项目名称:coi-services,代码行数:18,代码来源:ctdbp_L0.py

示例14: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(CTDBP_DensityTransform, self).on_start()

        self.dens_stream_id = self.CFG.process.publish_streams.values()[0]

        lat = self.CFG.get_safe('process.lat',None)
        if lat is None:
            raise BadRequest('Latitude is required to determine density')
        lon = self.CFG.get_safe('process.lon',None)
        if lon is None:
            raise BadRequest('Longitude is required to determine density')

        # Read the parameter dict from the stream def of the stream
        pubsub = PubsubManagementServiceProcessClient(process=self)
        self.stream_definition = pubsub.read_stream_definition(stream_id=self.dens_stream_id)

        self.params = {'stream_def' : self.stream_definition._id, 'lat': lat, 'lon' : lon}
开发者ID:Bobfrat,项目名称:coi-services,代码行数:19,代码来源:ctdbp_L2_density.py

示例15: on_start

# 需要导入模块: from interface.services.dm.ipubsub_management_service import PubsubManagementServiceProcessClient [as 别名]
# 或者: from interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient import read_stream_definition [as 别名]
    def on_start(self):
        super(CTDBP_L1_Transform, self).on_start()

        #  Validate the CFG used to launch the transform has all the required fields
        if not self.CFG.process.publish_streams.has_key('L1_stream'):
            raise BadRequest("For CTDBP transforms, please send the stream_id for the L1_stream using "
                     "a special keyword (L1_stream)")

        self.L1_stream_id = self.CFG.process.publish_streams.L1_stream

        # Read the parameter dict from the stream def of the stream
        pubsub = PubsubManagementServiceProcessClient(process=self)
        stream_def = pubsub.read_stream_definition(stream_id=self.L1_stream_id)
        self.stream_definition_id = stream_def._id

        self.temp_calibration_coeffs = self.CFG.process.calibration_coeffs['temp_calibration_coeffs']
        self.pres_calibration_coeffs = self.CFG.process.calibration_coeffs['pres_calibration_coeffs']
        self.cond_calibration_coeffs = self.CFG.process.calibration_coeffs['cond_calibration_coeffs']
开发者ID:mbarry02,项目名称:coi-services,代码行数:20,代码来源:ctdbp_L1.py


注:本文中的interface.services.dm.ipubsub_management_service.PubsubManagementServiceProcessClient.read_stream_definition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。