Github user xuchuanyin commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2885#discussion_r229603657
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/package.scala
---
@@ -60,21 +63,71 @@ trait DataProcessOperation {
def processData(sparkSession: SparkSession): Seq[Row]
}
+/**
+ * An utility that run the command with audit log
+ */
+trait Auditable {
+ // operation id that will be written in audit log
+ private val operationId: String = String.valueOf(System.nanoTime())
+
+ // extra info to be written in audit log, set by subclass of
AtomicRunnableCommand
+ private var auditInfo: java.util.Map[String, String] = new
java.util.HashMap[String, String]()
+
+ // holds the dbName and tableName for which this command is executed for
+ // used for audit log, set by subclass of AtomicRunnableCommand
+ private var table: String = _
+
+ // implement by subclass, return the operation name that record in audit
log
+ protected def opName: String
+
+ protected def opTime(startTime: Long) = s"${(System.nanoTime() -
startTime) / 1000L / 1000L} ms"
--- End diff --
Why not use millisecond directly?
---