public final class MessageUtil extends Object
ProgramRunInfo from a given Message.| Modifier and Type | Method and Description |
|---|---|
static ProgramRunInfo |
constructAndGetProgramRunInfo(Message message,
Notification notification)
Based on the
Message and its ProgramStatus,
construct by setting the fields of ProgramRunInfo and return that. |
static String |
findMessageId(org.apache.twill.filesystem.Location baseLocation)
For each of the namespace at the base location, find the latest file under that namespace and from
the last written record, find the latest messageId for that namespace,
return the overall max messageId across the namespaces, if no namespace is found, return null
|
static boolean |
isCDAPVersionCompatible(Notification notification)
CDAP_VERSION key was added only on CDAP 5.0 and Reporting app only works after CDAP 5.0 and we want
to skip pre 5.0 records.
|
static Notification |
messageToNotification(Message message)
Deserialize TMS message into
Notification |
@Nullable public static String findMessageId(org.apache.twill.filesystem.Location baseLocation) throws InterruptedException
baseLocation - base location for all the namespaces under reporting filesetInterruptedExceptionpublic static Notification messageToNotification(Message message)
Notificationmessage - public static boolean isCDAPVersionCompatible(Notification notification)
notification - public static ProgramRunInfo constructAndGetProgramRunInfo(Message message, Notification notification) throws IOException
Message and its ProgramStatus,
construct by setting the fields of ProgramRunInfo and return that.message - TMS messagenotification - ProgramRunInfoIOExceptionCopyright © 2018 Cask Data, Inc. Licensed under the Apache License, Version 2.0.