Esempio n. 1
0
 @Benchmark
 long OmmFind(int reps) {
   long dummy = 0;
   for (int i = 0; i < reps; ++i) {
     final OMMFieldList fieldlist = (OMMFieldList) msg.getPayload();
     dummy |=
         fieldlist.find(biddef.getFieldId()).getData(biddef.getOMMType()).toString().hashCode();
     dummy |=
         fieldlist.find(askdef.getFieldId()).getData(askdef.getOMMType()).toString().hashCode();
   }
   return dummy;
 }
  private static final void parseAggregateHeader(OMMData data, PrintStream ps, int tabLevel) {
    dumpIndent(ps, tabLevel);
    short dataType = data.getType();
    ps.println(OMMTypes.toString(dataType));
    switch (dataType) {
      case OMMTypes.FIELD_LIST:
        {
          // set DICTIONARY to the dictId for this field list
          OMMFieldList fieldList = (OMMFieldList) data;
          int dictId = fieldList.getDictId();
          CURRENT_DICTIONARY = getDictionary(dictId);
        }
        break;
      case OMMTypes.SERIES:
        {
          OMMSeries s = (OMMSeries) data;
          if (s.has(OMMSeries.HAS_SUMMARY_DATA)) {
            dumpIndent(ps, tabLevel + 1);
            ps.println("SUMMARY");
            parseData(s.getSummaryData(), ps, tabLevel + 1);
          }
          if (s.has(OMMSeries.HAS_DATA_DEFINITIONS)) {
            dumpIndent(ps, tabLevel + 1);
            short dbtype =
                s.getDataType() == OMMTypes.FIELD_LIST
                    ? OMMTypes.FIELD_LIST_DEF_DB
                    : OMMTypes.ELEMENT_LIST_DEF_DB;
            parseDataDefinition(s.getDataDefs(), dbtype, ps, tabLevel + 1);
          }
        }
        break;
      case OMMTypes.MAP:
        {
          OMMMap s = (OMMMap) data;

          String flagsString = ExampleUtil.mapFlagsString(s);
          dumpIndent(ps, tabLevel);
          ps.print("flags: ");
          ps.println(flagsString);

          if (s.has(OMMMap.HAS_SUMMARY_DATA)) {
            dumpIndent(ps, tabLevel + 1);
            ps.println("SUMMARY");
            parseData(s.getSummaryData(), ps, tabLevel + 1);
          }
        }
        break;
      case OMMTypes.VECTOR:
        {
          OMMVector s = (OMMVector) data;

          String flagsString = ExampleUtil.vectorFlagsString(s);
          dumpIndent(ps, tabLevel);
          ps.print("flags: ");
          ps.println(flagsString);

          if (s.has(OMMVector.HAS_SUMMARY_DATA)) {
            dumpIndent(ps, tabLevel + 1);
            ps.println("SUMMARY");
            parseData(s.getSummaryData(), ps, tabLevel + 1);
          }
        }
        break;
      case OMMTypes.FILTER_LIST:
        {
          OMMFilterList s = (OMMFilterList) data;

          String flagsString = ExampleUtil.filterListFlagsString(s);
          dumpIndent(ps, tabLevel);
          ps.print("flags: ");
          ps.println(flagsString);
        }
        break;
    }
  }