Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ abstract class EventLogFileWriter(
/** writes JSON format of event to file */
def writeEvent(eventJson: String, flushLogger: Boolean = false): Unit

/** Writes key/value pair to HDFS Extended attribute */
def writeToXAttr(attrName: String, attrValue: String): Unit = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No one is calling this method ?


/** stops writer - indicating the application has been completed */
def stop(): Unit

Expand Down Expand Up @@ -229,6 +232,17 @@ class SingleEventLogFileWriter(
writeLine(eventJson, flushLogger)
}

override def writeToXAttr(attrName: String, attrValue: String): Unit = {
try {
fileSystem.setXAttr(new Path(inProgressPath), attrName, attrValue.getBytes())
} catch {
case _: IOException =>
logWarning(s"Failed to set extended attribute ${attrName}")
case _: UnsupportedOperationException =>
logWarning("setXAttr not supported by filesystem")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make these INFO ?

}
}

/**
* Stop logging events. The event log file will be renamed so that it loses the
* ".inprogress" suffix.
Expand Down
Loading