예제 #1
0
 private ReadResult translate(Column current) {
   byte[] name = current.getName();
   byte[] value = current.getValue();
   Object time = meta.getIdColumnMeta().convertFromStorage2(name);
   Object val = colMeta.convertFromStorage2(value);
   // TODO:  parameterize timeColumn and valueColumn from options
   TSRelational tv = new TSRelational("time", "value");
   tv.put("time", time);
   tv.put(colMeta.getColumnName(), val);
   return new ReadResult(url, tv);
 }
예제 #2
0
  private void runNewCode(NoSqlEntityManager mgr, PlayOrmCronJob mon) {
    TableMonitor tableMon = TableMonitor.copy(mon);
    if (log.isInfoEnabled()) log.info("monitor firing(new version)=" + tableMon);

    String tableName = tableMon.getTableName();
    RawProcessor p = new RawProcessor(true);
    VisitorInfo visitor = new VisitorInfo(null, null, true, mgr);
    String path = "rawdataV1/" + tableName + "/0/null";
    HashMap<String, String> options = new HashMap<String, String>();
    p.init(path, null, visitor, options);

    DateTime now = new DateTime();
    ReadResult res = p.read();
    if (res.isEndOfStream()) {
      fireEmailStreamIsDown("new", null, now, tableMon);
      return;
    }

    TSRelational row = res.getRow();
    long timestamp = row.getTime();

    runDataCheck("new", tableMon, now, timestamp);
  }