Examples of InstrumentDefinition


Examples of com.barchart.proto.buf.inst.InstrumentDefinition

    byte[] key = guid.toString().getBytes();
    DatabaseEntry result = new DatabaseEntry();
    db.get(txn, new DatabaseEntry(key), result, null);
    txn.commit();
   
    InstrumentDefinition resInst;
    byte[] resData = result.getData();
   
    if(resData == null || resData.length == 0) {
      return Instrument.NULL;
    }
View Full Code Here

Examples of com.barchart.proto.buf.inst.InstrumentDefinition

        inStream = zFile.getInputStream(entry);
       
        map.clear();
       
        long counter = 0;
        InstrumentDefinition def = null;
        while(true) {
          def = null;
         
          try {
            def = InstrumentDefinition.
                parseDelimitedFrom(inStream);
          } catch (final Exception e) {
            break;
          }
         
          if(def!= null) {
           
            if(def.hasSymbol()) {
              map.put(def.getSymbol(), def);
            }
           
            if(counter % 100000 == 0) {
              log.debug("Instrument DB build count " + counter);
            }
View Full Code Here

Examples of com.barchart.proto.buf.inst.InstrumentDefinition

   
    if(instrument != null) {
      return instrument;
    }
   
    final InstrumentDefinition instDef = db.get(symbol.toString());
   
    if(cache.size() % 10000 == 0) {
      log.debug("Cache size = {}", cache.size());
    }
   
View Full Code Here

Examples of com.barchart.proto.buf.inst.InstrumentDefinition

 
  private void populateDB(final InputStream inStream) {
   
    long counter = 0;
    while(true) {
      InstrumentDefinition def;
     
      try {
        def = InstrumentDefinition.
            parseDelimitedFrom(inStream);
      } catch (Exception e) {
        e.printStackTrace();
        break;
      }
     
      if(def!= null) {
       
        if(def.hasSymbol()) {
          map.put(def.getSymbol(), def);
        }
       
        if(counter % 10000 == 0) {
          System.out.println("Build count " + counter);
        }
View Full Code Here

Examples of com.barchart.proto.buf.inst.InstrumentDefinition

    byte[] key = guid.toString().getBytes();
    DatabaseEntry result = new DatabaseEntry();
    db.get(txn, new DatabaseEntry(key), result, null);
    txn.commit();
   
    InstrumentDefinition resInst;
    byte[] resData = result.getData();
   
    if(resData == null || resData.length == 0) {
      return Instrument.NULL;
    }
View Full Code Here

Examples of com.barchart.proto.buf.inst.InstrumentDefinition

        final ZipFile zFile= new ZipFile(instDef);
        final ZipEntry entry = zFile.entries().nextElement();
        inStream = zFile.getInputStream(entry);
       
        long counter = 0;
        InstrumentDefinition def = null;
        while(true) {
          def = null;
         
          try {
            def = InstrumentDefinition.
                parseDelimitedFrom(inStream);
          } catch (final Exception e) {
            break;
          }
         
          if(def!= null) {
           
            if(def.hasSymbol()) {
              map.put(def.getSymbol(), def);
            }
           
            if(counter % 100000 == 0) {
              log.debug("Instrument DB build count " + counter);
            }
View Full Code Here

Examples of com.barchart.proto.buf.inst.InstrumentDefinition

   
    if(instrument != null) {
      return instrument;
    }
   
    final InstrumentDefinition instDef = db.get(symbol.toString());
   
    if(cache.size() % 10000 == 0) {
      log.debug("Cache size = {}", cache.size());
    }
   
View Full Code Here

Examples of com.barchart.proto.buf.inst.InstrumentDefinition

 
  private void populateDB(final InputStream inStream) {
   
    long counter = 0;
    while(true) {
      InstrumentDefinition def;
     
      try {
        def = InstrumentDefinition.
            parseDelimitedFrom(inStream);
      } catch (Exception e) {
        e.printStackTrace();
        break;
      }
     
      if(def!= null) {
       
        if(def.hasSymbol()) {
          map.put(def.getSymbol(), def);
        }
       
        if(counter % 10000 == 0) {
          System.out.println("Build count " + counter);
        }
View Full Code Here

Examples of org.openfeed.proto.inst.InstrumentDefinition

          log.debug("Starting remote lookup for {}", lookup);
         
          final String symbolURI = urlInstrumentLookup(lookup);
          final Element root = HelperXML.xmlDocumentDecode(symbolURI);
          final Element tag = xmlFirstChild(root, "instrument", XML_STOP);
          final InstrumentDefinition instDOM = InstrumentXML.decodeXML(tag);
         
          if(instDOM == null || instDOM == InstrumentDefinition.getDefaultInstance()) {
            log.trace("Empty instrument def returned from remote lookup: {}", lookup);
            failedRemoteQueue.add(lookup);
            return InstrumentDefinition.getDefaultInstance();
View Full Code Here

Examples of org.openfeed.proto.inst.InstrumentDefinition

         
          for(final Future<Map<String, InstrumentDefinition>> f : futures) {
           
            for(final Entry<String, InstrumentDefinition> e : f.get().entrySet()) {
             
              final InstrumentDefinition def = e.getValue();
             
              if(def == null || def == InstrumentDefinition.getDefaultInstance()) {
                observer.onNext(new InstDefResult(e.getKey(),
                    new Throwable("Could not find " + e.getKey())));
              } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.