Package com.activequant.archive

Examples of com.activequant.archive.TSContainer


                if (!instrumentMap.containsKey(field))
                    instrumentMap.put(field, new HashMap<TimeStamp, Double>());
                fieldMap = instrumentMap.get(field);
                TimeStamp t1 = new TimeStamp(parser.getNanoseconds(startDate8Time6));
                TimeStamp t2 = new TimeStamp(parser.getNanoseconds(endDate8Time6));
                TSContainer ts = archiveFactory.getReader(tf).getTimeSeries(instrument, field, t1, t2);
                if (ts.timeStamps.length > 0) {
                    for (int k = 0; k < ts.timeStamps.length; k++) {
                        TimeStamp timeStamp = ts.timeStamps[k];
                        Double value = ts.values[k];
                        // TODO: have to reduce the granularity.
View Full Code Here


        TimeStamp stopTS = new TimeStamp(sdf.parse(stopDate));

        IArchiveReader iar = archiveFactory.getReader(inTimeFrame);

        for (String value : fields) {
            TSContainer container = iar.getTimeSeries(mdiId, value, startTS, stopTS);
            TimeSeriesIterator iterator = iar.getTimeSeriesStream(mdiId, value, startTS, stopTS);
            while (iterator.hasNext()) {
                Tuple<TimeStamp, Double> val = iterator.next();
                System.out.println(val.getA().getNanoseconds() + "," + val.getB());
            }
View Full Code Here

        TimeStamp now = new TimeStamp(new Date());
        double value = Math.random();
        iwr.write("TEST",now,"PX_SETTLE", value);
        iwr.commit();
       
        TSContainer container = iar.getTimeSeries("TEST", "PX_SETTLE", now);
        if(container!=null && container.timeStamps.length==1 && container.values[0] == value)
          System.out.println("All ok.");       
        else{
            System.out.println("Received: " + container.timeStamps.length + " values. ");
        }
View Full Code Here

                }
            }
        } finally {
            scanner.close();
        }
        TSContainer ret = new TSContainer(timeStamps.toArray(new TimeStamp[] {}), values.toArray(new Double[] {}));
        return ret;
    }
View Full Code Here

TOP

Related Classes of com.activequant.archive.TSContainer

Copyright © 2018 www.massapicom. 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.