Package com.activequant.domainmodel

Examples of com.activequant.domainmodel.TimeStamp


                    SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd");
                    String dateTime = yyyyMMdd.format(d);
                    dateTime += " " + time;

                    final Iterator<Entry<String, String>> it = event.entrySet().iterator();
                    TimeStamp ts;
                    try {
                        if (dateTime.indexOf("-") != -1)
                            ts = new TimeStamp(sdf2.parse(dateTime));
                        else
                            ts = new TimeStamp(sdf.parse(dateTime));

                        while (it.hasNext()) {
                            Entry<String, String> entry = it.next();
                            String key = entry.getKey();
                            if (key.toUpperCase().equals("DATE"))
                                continue;
                            if (key.toUpperCase().equals("TIME"))
                                continue;

                            MarketDataInstrument mdi = mdiDao.findByProvId(mdprovider, key);
                            if (mdi == null)
                                continue;
                            if (entry.getValue().equals("#"))
                                continue;
                            System.out.println("Importing : " + ts.getDate() + " - " + key + " - " + entry.getValue());
                            iaw.write(mdi.getId(), ts, "PX_SETTLE", Double.parseDouble(entry.getValue()));
                            if (lineCounter++ > 100) {
                                lineCounter = 0;
                                try {
                                    iaw.commit();
View Full Code Here


       
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        Date midnightThisMorning = sdf.parse(sdf.format(new Date()));
       
        // dump instruments and MDIs that were generated today.
        String[] mdiids = mdiDao.findIDsWhereCreationDateBetween(new TimeStamp(midnightThisMorning), new TimeStamp());
        StringBuffer mailBody = new StringBuffer("<h1>General information</h1>"+sendMail.generateHtmlTable(new String[]{"Property", "Value"}, data));
       
        mailBody.append("<h1>New MDIs</h1>");
        for(String id : mdiids)
        {
            mailBody.append(id + "<br/>");
        }
       
        String[] instruments = idao.findIDsWhereCreationDateBetween(new TimeStamp(midnightThisMorning), new TimeStamp());
        mailBody.append("<h1>New Instruments</h1>");
        for(String id : instruments)
        {
            mailBody.append(id + "<br/>");
        }
View Full Code Here

      }
    } else {
      throw new AssertionError("input dates are out-of-order : "+inputInMilliseconds+" is lower than "+lastMillis);
    }

    return new TimeStamp(lastMillis * AMBIGUATION_UNITS_IN_MILLIS + nanos); // disambiguate
  }
View Full Code Here

                if (rr.containsColumn("numbers".getBytes(), value.getBytes())) {
                    byte[] valB = rr.getValue("numbers".getBytes(), value.getBytes());
                    byte[] tsB = rr.getValue("numbers".getBytes(), "ts".getBytes());
                    Double val = Bytes.toDouble(valB);
                    Long ts = Bytes.toLong(tsB);
                    timeStamps.add(new TimeStamp(ts));
                    values.add(val);
                }
            }
        } finally {
            scanner.close();
View Full Code Here

                    if (rr.containsColumn("numbers".getBytes(), key.getBytes())) {
                        byte[] valB = rr.getValue("numbers".getBytes(), key.getBytes());
                        byte[] tsB = rr.getValue("numbers".getBytes(), "ts".getBytes());
                        Double val = Bytes.toDouble(valB);
                        Long ts = Bytes.toLong(tsB);
                        return new Tuple<TimeStamp, Double>(new TimeStamp(ts), val);
                    }
                    return null;
                } else {
                    scanner.close();
                }
View Full Code Here

           
                if (rr != null) {
                    NavigableMap<byte[],NavigableMap<byte[],byte[]>> valueMap = rr.getNoVersionMap();
                    byte[] tsB = rr.getValue("numbers".getBytes(), "ts".getBytes());
                    Long ts = Bytes.toLong(tsB);
                    TimeStamp timeStamp = new TimeStamp(ts);
                    resultTuple.setA(timeStamp);
                   
                   
                    NavigableMap<byte[], byte[]> numbersMap = valueMap.get("numbers".getBytes());
                    Iterator<Entry<byte[], byte[]>> numbersIt = numbersMap.entrySet().iterator();
View Full Code Here

TOP

Related Classes of com.activequant.domainmodel.TimeStamp

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.