Package com.google.appengine.api.log

Examples of com.google.appengine.api.log.LogQuery$Version


     * @param ver HL7 version
     * @return package path of the version
     * @throws HL7Exception if the HL7 version is unknown
   */
  public static String getVersionPackagePath(String ver) throws HL7Exception {
    Version v = Version.versionOf(ver);
      if (v == null) {
          throw new HL7Exception("The HL7 version " + ver + " is unknown", ErrorCode.UNSUPPORTED_VERSION_ID);
      }
      String pkg = v.modelPackageName();
      return pkg.replace('.', '/');
  }
View Full Code Here


        version = getVersion(message);
      } catch (Exception e) { /* use the default */
      }

      if (version == null) {
        Version availableVersion = Version.highestAvailableVersionOrDefault();
        version = availableVersion.getVersion();
      }

      Segment msh = Parser.makeControlMSH(version, getFactory());
      Terser.set(msh, 1, 0, 1, 1, String.valueOf(fieldSep));
      Terser.set(msh, 2, 0, 1, 1, encChars);
View Full Code Here

  private Message instantiateACK() throws HL7Exception {
    ModelClassFactory mcf = getParser() != null ?
        getParser().getFactory() :
        new DefaultModelClassFactory();
    Version version = Version.versionOf(getVersion());
    Message out = null;
    if (version != null && version.available()) {
      Class<? extends Message> clazz = mcf.getMessageClass("ACK", version.getVersion(), false);
      if (clazz != null) {
          out = ReflectionUtil.instantiateMessage(clazz, mcf);
      }
    }
    if (out == null) {
View Full Code Here

    Terser.set(mshOut, 7, 0, 1, 1, CommonTS.toHl7TSFormat(now));
    Terser.set(mshOut, 9, 0, 1, 1, "ACK");
    Terser.set(mshOut, 9, 0, 2, 1, Terser.get(mshIn, 9, 0, 2, 1));
    String v = mshOut.getMessage().getVersion();
    if (v != null) {
      Version version = Version.versionOf(v);
      if (version != null && !Version.V25.isGreaterThan(version)) {
        Terser.set(mshOut, 9, 0, 3, 1, "ACK");
      }
    }
    Terser.set(mshOut, 10, 0, 1, 1, mshIn.getMessage().getParser().getParserConfiguration().getIdGenerator().getID());
View Full Code Here

        Terser.set(msh, 12, 0, 1, 1, getVersion());
       
        // Add structure information if version is 2.4 or better
        if (!Version.V24.isGreaterThan(Version.versionOf(getVersion()))) {
          if (this instanceof SuperStructure) {
            Version version = Version.versionOf(getVersion());
            Map<String, String> eventMap = new DefaultModelClassFactory().getEventMapForVersion(version);
            if (StringUtil.isNotBlank(messageCode) && StringUtil.isNotBlank(messageTriggerEvent)) {
              String structure = eventMap.get(messageCode + "_" + messageTriggerEvent);
              Terser.set(msh, 9, 0, 3, 1, structure);
            }           
View Full Code Here

    super.tearDown();
  }

  private static void runTest(
      long timeOffset, long startTimeUsec, long endTimeUsec, int numShards, long[] startTimes) {
    LogQuery logQuery = LogQuery.Builder.withDefaults();
    logQuery.startTimeUsec(timeOffset + startTimeUsec);
    logQuery.endTimeUsec(timeOffset + endTimeUsec);
    LogInput input = new LogInput(logQuery, numShards);
    List<? extends InputReader<RequestLogs>> readers = input.createReaders();
    assertEquals("Incorrect number of readers", startTimes.length, readers.size());
    for (int i = 0; i < startTimes.length; i++) {
      LogInputReader reader = (LogInputReader) readers.get(i);
View Full Code Here

      // We intentionally perform one extra fetch to ensure there are no extra logs
    }
  }

  private LogInputReader createReader(long startTimeUsec, long endTimeUsec) {
    LogQuery logQuery = LogQuery.Builder.withDefaults();
    logQuery.startTimeUsec(startTimeUsec);
    logQuery.endTimeUsec(endTimeUsec);
    ArrayList<String> versionList = new ArrayList<>();
    versionList.add(VERSION_ID);
    logQuery.majorVersionIds(versionList);
    return new LogInputReader(logQuery);
  }
View Full Code Here

    log.warning(resultsCount + " rows exported");
  }

  public Iterable<RequestLogs> queryForLogs(long logRangeStartMs, long logRangeEndMs, LogsExportConfiguration exportConfig, LogsFieldExporterSet exporterSet) {
    LogService ls = LogServiceFactory.getLogService();
    LogQuery lq = new LogQuery();
    lq = lq.startTimeMillis(logRangeStartMs)
        .endTimeMillis(logRangeEndMs)
        .includeAppLogs(true);

    if (exportConfig.getLogLevel() != null) {
      lq = lq.minLogLevel(exportConfig.getLogLevel());
    }
   
    List<Version> appVersions = exporterSet.applicationVersionsToExport();
    if (appVersions != null && appVersions.size() > 0) {
      lq = lq.versions(appVersions);
    }

    Iterable<RequestLogs> logs = ls.fetch(lq);
    return logs;
  }
View Full Code Here

        break;
      }
      long curEndTimeUsec = Math.round(startTimeUsec + (i * perShardTimeUsec));
      // Ensure we do not go past the end time due to rounding
      curEndTimeUsec = (curEndTimeUsec > endTimeUsec) ? endTimeUsec : curEndTimeUsec;
      LogQuery readerLogQuery = logQuery.clone();
      readerLogQuery.startTimeUsec(curStartTimeUsec);
      readerLogQuery.endTimeUsec(curEndTimeUsec);
      LogInputReader reader = new LogInputReader(readerLogQuery);
      readers.add(reader);
      curStartTimeUsec = curEndTimeUsec;
    }
    return readers;
View Full Code Here

    }
  }

  private static boolean wasRequestCompleted(String requestId) {
    if (requestId != null) {
      LogQuery query = LogQuery.Builder.withRequestIds(Collections.singletonList(requestId));
      for (RequestLogs requestLog : LOG_SERVICE.fetch(query)) {
        if (requestLog.isFinished()) {
          log.info("Previous un-released lock for request " + requestId + " has finished");
          return true;
        }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.log.LogQuery$Version

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.