Package com.activequant.archive

Examples of com.activequant.archive.IArchiveReader


        System.out.println(d2.getTime());
        //
        TimeStamp startTS = new TimeStamp(sdf.parse(startDate));
        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


public class ArchiveTestCall {

  public static void main(String[] args) throws Exception{
       
      HBaseArchiveFactory fac = new HBaseArchiveFactory(args[0]);
        IArchiveReader iar = fac.getReader(TimeFrame.EOD);
        IArchiveWriter iwr = fac.getWriter(TimeFrame.EOD);
       
        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

    }
   
    public synchronized IArchiveReader getReader(TimeFrame tf) {
        if (readers.get(tf) == null)
            try {
                IArchiveReader reader = new HBaseArchiveReader(zookeeperHost, zookeeperPort, tf);
                readers.put(tf, reader);

            } catch (IOException e) {
                e.printStackTrace();
            }
View Full Code Here

TOP

Related Classes of com.activequant.archive.IArchiveReader

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.