com.thomsonreuters.upa.codec.Qos类的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中com.thomsonreuters.upa.codec.Qos类的一些代码示例,展示了Qos类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Qos类的具体详情如下:
包路径:com.thomsonreuters.upa.codec.Qos
类名称:Qos

Qos介绍

[英]UPA Quality of Service class contains information rate and/or timeliness information. Timeliness conveys information about the age of data. Rate conveys information about the data's period of change. Some timeliness or rate values may allow for additional time or rate information to be provided. A consumer can use RequestMsg to indicate the desired QoS for its streams. This can be a request for a specific QoS or a range of qualities of service, where any value within the range will satisfy the request. The RefreshMsg includes QoS used to indicate the QoS being provided for a stream. When issuing a request, the QoS specified on the request typically matches the advertised QoS of the service, as conveyed via the Source Directory domain model.

  • An initial request containing only RequestMsg#qos() indicates a request for the specified QoS. If a provider cannot satisfy this QoS, the request should be rejected.
  • An initial request containing both RequestMsg#qos() and RequestMsg#worstQos() sets the range of acceptable QoSs.

Any QoS within the range, inclusive of the specified qos and worstQos, will satisfy the request. If a provider cannot provide a QoS within the range, the provider should reject the request. When a provider responds to an initial request, the RefreshMsg#qos() should contain the actual QoS being provided to the stream. Subsequent requests should not specify a range as the QoS has been established for the stream. Because QoS information is mostly optional on a RequestMsg (Some components may require qos on initial request and reissue messages):

  • If neither qos nor worstQos are specified on an initial request to open a stream, it is assumed that any QoS will satisfy the request. Additionally, it will have a timeliness of QosTimeliness#REALTIME and a rate of QosRates#TICK_BY_TICK
  • If QoS information is absent on a subsequent reissue request, it is assumed that QoS, timeliness, and rate conform to the stream's currently established settings
    .
    [中]UPA服务质量等级包含信息率和/或及时性信息。及时性传递有关数据时代的信息。速率传递有关数据更改周期的信息。某些及时性或费率值可能允许提供额外的时间或费率信息。消费者可以使用RequestMsg来指示其流所需的QoS。这可以是对特定QoS或服务质量范围的请求,该范围内的任何值都将满足请求。RefreshMsg包括QoS,用于指示为流提供的QoS。发出请求时,请求上指定的QoS通常与通过源目录域模型传递的服务的公布QoS相匹配。
    *仅包含RequestMsg#qos()的初始请求表示对指定qos的请求。如果提供者不能满足此QoS,则应拒绝请求。
    *包含RequestMsg#qos()和RequestMsg#worstQos()的初始请求设置可接受qos的范围。
    范围内的任何QoS(包括指定的QoS和最坏的QoS)都将满足请求。如果提供商无法在该范围内提供QoS,则提供商应拒绝该请求。当提供者响应初始请求时,RefreshMsg#qos()应该包含提供给流的实际qos。后续请求不应指定范围,因为已经为流建立了QoS。因为QoS信息在RequestMsg上主要是可选的(一些组件在初始请求和重新发布消息时可能需要QoS):
    *如果在打开流的初始请求中既没有指定qos也没有指定worstQos,则假定任何qos都将满足该请求。此外,它还将具有实时的QosTimeliness和逐点的QosRates
    *如果后续重新发布请求中缺少QoS信息,则假定QoS、及时性和速率符合流的当前设置
    .

代码示例

代码示例来源:origin: Refinitiv/Elektron-SDK

void decode(com.thomsonreuters.upa.codec.Qos rsslQos)
{
  if (rsslQos != null)
  {
    _dataCode = DataCode.NO_CODE;
    
    _rsslQos.rate(rsslQos.rate());
    _rsslQos.timeliness(rsslQos.timeliness());
    _rsslQos.dynamic(rsslQos.isDynamic());
    _rsslQos.timeInfo(rsslQos.timeInfo());
    _rsslQos.rateInfo(rsslQos.rateInfo());
  }
  else
  {
    _dataCode = DataCode.BLANK;
    
    _rsslQos.clear();
  }
}

代码示例来源:origin: Refinitiv/Elektron-SDK

if (serviceQos.equals(qos))
        serviceQos.copy(matchedQos);
        break;
      if (serviceQos.isInRange(qos, worstQos))
        if (serviceQos.isBetter(matchedQos))
          serviceQos.copy(matchedQos);
    ret = _defaultQos.equals(qos);
    ret = _defaultQos.isInRange(qos, worstQos);
    _defaultQos.copy(matchedQos);
matchedQos.dynamic(qos.isDynamic());

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
void decode(com.thomsonreuters.upa.codec.Buffer rsslBuffer, com.thomsonreuters.upa.codec.DecodeIterator dIter)
{
  _rsslBuffer = rsslBuffer;
  if (com.thomsonreuters.upa.codec.CodecReturnCodes.SUCCESS == _rsslQos.decode(dIter))
    _dataCode = DataCode.NO_CODE;
  else
  {
    _dataCode = DataCode.BLANK;
    _rsslQos.clear();
  }
}

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
public int timeliness()
{
  int timeliness = OmmQos.Timeliness.INEXACT_DELAYED;
  switch( _rsslQos.timeliness() )
  {
  case com.thomsonreuters.upa.codec.QosTimeliness.REALTIME:
    timeliness = OmmQos.Timeliness.REALTIME;
    break;
  case com.thomsonreuters.upa.codec.QosTimeliness.DELAYED_UNKNOWN :
    timeliness = OmmQos.Timeliness.INEXACT_DELAYED;
    break;
  case com.thomsonreuters.upa.codec.QosTimeliness.DELAYED:
    timeliness = _rsslQos.timeInfo();
    break;
  default:
    break;
  }
  return timeliness;
}

代码示例来源:origin: Refinitiv/Elektron-SDK

/**
 * Instantiates a new directory provider.
 */
public DirectoryProvider()
{
  _directoryRefresh = (DirectoryRefresh)DirectoryMsgFactory.createMsg();
  _directoryRefresh.rdmMsgType(DirectoryMsgType.REFRESH);
  _service = DirectoryMsgFactory.createService();
  _qos = CodecFactory.createQos();
  _directoryRefresh.rdmMsgType(DirectoryMsgType.REFRESH);
  
  _qos.dynamic(false);
  _qos.rate(QosRates.TICK_BY_TICK);
  _qos.timeliness(QosTimeliness.REALTIME);
  
  _encodeIter = CodecFactory.createEncodeIterator();
}

代码示例来源:origin: Refinitiv/Elektron-SDK

chnlInfo.symbolListHandler.qos().dynamic(qos.isDynamic());
chnlInfo.symbolListHandler.qos().rate(qos.rate());
chnlInfo.symbolListHandler.qos().timeliness(qos.timeliness());
chnlInfo.symbolListHandler.qos().dynamic(false);
chnlInfo.symbolListHandler.qos().rate(QosRates.TICK_BY_TICK);
chnlInfo.symbolListHandler.qos().timeliness(QosTimeliness.REALTIME);

代码示例来源:origin: Refinitiv/Elektron-SDK

retval = qoS.decode(dIter);
      if (retval != CodecReturnCodes.SUCCESS && retval != CodecReturnCodes.BLANK_DATA)
    qoS.copy(serviceQos);
    serviceDiscoveryInfo_qoS.add(serviceQos);
serviceDiscoveryInfo_qoS.get(arrayCount).timeliness(QosTimeliness.REALTIME);
serviceDiscoveryInfo_qoS.get(arrayCount).rate(QosRates.TICK_BY_TICK);
serviceDiscoveryInfo_qoS.get(arrayCount).dynamic(false);

代码示例来源:origin: Refinitiv/Elektron-SDK

assertFalse(qos1.isBetter(qos2));
qos1.rate(QosRates.TICK_BY_TICK);
assertTrue(qos1.isBetter(qos2));
qos1.clear();
assertFalse(qos1.isBetter(qos2));
qos1.rate(QosRates.JIT_CONFLATED);
assertTrue(qos1.isBetter(qos2));
qos1.clear();
assertFalse(qos1.isBetter(qos2));
qos1.rate(QosRates.TIME_CONFLATED);
assertTrue(qos1.isBetter(qos2));
qos1.clear();
assertFalse(qos1.isBetter(qos2));
qos1.timeliness(QosTimeliness.REALTIME);
assertTrue(qos1.isBetter(qos2));
qos1.clear();
assertFalse(qos1.isBetter(qos2));
qos1.timeliness(QosTimeliness.DELAYED_UNKNOWN);
assertTrue(qos1.isBetter(qos2));
qos1.clear();
assertFalse(qos1.isBetter(qos2));
qos1.timeliness(QosTimeliness.DELAYED);
assertTrue(qos1.isBetter(qos2));
qos1.clear();
assertFalse(qos1.isBetter(qos2));
qos1.rate(QosRates.TIME_CONFLATED);
qos1.rateInfo(1000);
assertTrue(qos1.isBetter(qos2));
qos1.clear();

代码示例来源:origin: Refinitiv/Elektron-SDK

providerQos.clear();
providerQos.dynamic(false); /* @brief If _TRUE,  Qos is dynamic (used to describe the changeability of the quality of service, typically over the life of a data stream) */
providerQos.rate(QosRates.TICK_BY_TICK);/* Rate is Tick By Tick, indicates every change to information is conveyed */
providerQos.timeliness(QosTimeliness.REALTIME);/* Timeliness is Realtime, indicates information is updated as soon as new information becomes available */

代码示例来源:origin: Refinitiv/Elektron-SDK

if ( qosList.get(index).isInRange(requestMsg.qos(), requestMsg.worstQos()))
     qos.rate(QosRates.TICK_BY_TICK);
     qos.timeliness(QosTimeliness.REALTIME);
     if ( qos.isInRange(requestMsg.qos(), requestMsg.worstQos()))
    if ( qosList.get(index).equals(requestMsg.qos()) )
   qos.rate(QosRates.TICK_BY_TICK);
   qos.timeliness(QosTimeliness.REALTIME);
   if ( qos.equals(requestMsg.qos()) )
qos.rate(QosRates.TICK_BY_TICK);
qos.timeliness(QosTimeliness.REALTIME);
    if ( qosList.get(index).equals(qos) )

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
public int rate()
{
  int rate = OmmQos.Rate.JUST_IN_TIME_CONFLATED;
  switch( _rsslQos.rate() )
  {
  case com.thomsonreuters.upa.codec.QosRates.TICK_BY_TICK:
    rate = OmmQos.Rate.TICK_BY_TICK;
    break;
  case com.thomsonreuters.upa.codec.QosRates.JIT_CONFLATED:
    rate = OmmQos.Rate.JUST_IN_TIME_CONFLATED;
    break;
  case com.thomsonreuters.upa.codec.QosRates.TIME_CONFLATED:
    rate = _rsslQos.rateInfo();
    break;
  default:
    break;
  }
  return rate;
}

代码示例来源:origin: Refinitiv/Elektron-SDK

WlItemHandler(Watchlist watchlist)
{
  _watchlist = watchlist;
  _defaultQos.clear();
  _defaultQos.timeliness(QosTimeliness.REALTIME);
  _defaultQos.rate(QosRates.TICK_BY_TICK);
  _statusMsg.msgClass(MsgClasses.STATUS);
  _wlViewHandler = new WlViewHandler(watchlist);
  _itemAggregationKeytoWlStreamTable = new HashMap<WlItemAggregationKey,WlStream>(_watchlist.role().watchlistOptions().itemCountHint() + 10, 1);
}

代码示例来源:origin: Refinitiv/Elektron-SDK

assertEquals(false, msg.qos().isDynamic());
assertEquals(QosTimeliness.REALTIME, msg.qos().timeliness());
assertEquals(QosRates.TICK_BY_TICK, msg.qos().rate());

代码示例来源:origin: Refinitiv/Elektron-SDK

(msg.flags() & RequestMsgFlags.HAS_QOS) != 0)
if (!((RequestMsg)msg).qos().isInRange(((RequestMsg)msg).worstQos(), _providerQos))
if (!((RequestMsg)msg).qos().equals(_providerQos))

代码示例来源:origin: Refinitiv/Elektron-SDK

void clear()
  {
    _dataCode = DataCode.NO_CODE;
    _rsslQos.clear();
  }
}

代码示例来源:origin: Refinitiv/Elektron-SDK

ret = fidQosValue.decode(dIter);
if (ret == CodecReturnCodes.SUCCESS)
  fieldValue.append(fidQosValue.toString());

代码示例来源:origin: Refinitiv/Elektron-SDK

(requestMsg.qos().timeliness() == QosTimeliness.UNSPECIFIED ||
requestMsg.qos().rate() == QosRates.UNSPECIFIED ||
requestMsg.qos().timeliness() > QosTimeliness.DELAYED ||
requestMsg.qos().rate() > QosRates.TIME_CONFLATED))
                       "Request has invalid QoS (Timeliness: " + requestMsg.qos().timeliness() + 
                       ", Rate: " + requestMsg.qos().rate() + ").");
(requestMsg.worstQos().timeliness() == QosTimeliness.UNSPECIFIED ||
requestMsg.worstQos().rate() == QosRates.UNSPECIFIED ||
requestMsg.worstQos().timeliness() > QosTimeliness.DELAYED ||
requestMsg.worstQos().rate() > QosRates.TIME_CONFLATED))
                       "Request has invalid worst QoS (Timeliness: " + requestMsg.worstQos().timeliness() + 
                       ", Rate: " + requestMsg.worstQos().rate() + ").");

代码示例来源:origin: Refinitiv/Elektron-SDK

assertFalse(qos.isInRange(bestQos, worstQos));
((QosImpl)qos)._rate = QosRates.TIME_CONFLATED;
((QosImpl)qos)._rateInfo = 65531;
((QosImpl)qos)._timeliness = QosTimeliness.DELAYED;
((QosImpl)qos)._timeInfo = 65532;
assertFalse(qos.isInRange(bestQos, worstQos));
((QosImpl)qos)._rate = QosRates.TIME_CONFLATED;
((QosImpl)qos)._rateInfo = 65535;
((QosImpl)qos)._timeliness = QosTimeliness.DELAYED;
((QosImpl)qos)._timeInfo = 65536;
assertFalse(qos.isInRange(bestQos, worstQos));
qos.clear();
assertFalse(qos.isInRange(bestQos, worstQos));
((QosImpl)qos)._rate = QosRates.TIME_CONFLATED;
((QosImpl)qos)._rateInfo = 65532;
((QosImpl)qos)._timeliness = QosTimeliness.DELAYED;
((QosImpl)qos)._timeInfo = 65533;
assertTrue(qos.isInRange(bestQos, worstQos));
qos.clear();
assertFalse(qos.isInRange(bestQos, worstQos));
((QosImpl)qos)._rate = QosRates.TIME_CONFLATED;
((QosImpl)qos)._rateInfo = 65533;
((QosImpl)qos)._timeliness = QosTimeliness.DELAYED;
((QosImpl)qos)._timeInfo = 65534;
assertTrue(qos.isInRange(bestQos, worstQos));
qos.clear();
assertFalse(qos.isInRange(bestQos, worstQos));
((QosImpl)qos)._rate = QosRates.TIME_CONFLATED;
((QosImpl)qos)._rateInfo = 65534;

代码示例来源:origin: Refinitiv/Elektron-SDK

break;
case DataTypes.QOS:
  if ((ret = _fidQosValue.decode(iter)) < CodecReturnCodes.SUCCESS)
    return ret;
  break;

代码示例来源:origin: Refinitiv/Elektron-SDK

if (bestQos.equals(worstQos))
  return bestQos.equals(this);

相关文章