class AuditTableFile extends AuditTable with Logging
Implementation of the AuditTable which is backed up by append only block storage like HDFS.
Created by Alexei Perelighin on 2018/03/03
- Alphabetic
- By Inheritance
- AuditTableFile
- Logging
- AuditTable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
AuditTableFile(tableInfo: AuditTableInfo, regions: Seq[AuditTableRegionInfo], storageOps: FileStorageOps, baseFolder: Path, newRegionID: (AuditTableFile) ⇒ String)
- tableInfo
static details about the table, with custom metadata
- regions
list of region details
- storageOps
object that actually interacts with the physical storage
- baseFolder
parent folder which contains folders with table names
- newRegionID
function that generates region ids
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
activeRegionIDs(): Option[Seq[String]]
Returns regions ids for all active regions.
-
def
allBetween(from: Option[Timestamp], to: Option[Timestamp]): Option[Dataset[_]]
Include all records between the given timestamps.
Include all records between the given timestamps.
- returns
if no data in storage layer, return None
- Definition Classes
- AuditTableFile → AuditTable
-
def
append(ds: Dataset[_], lastUpdated: Column, appendTS: Timestamp): Try[(AuditTable, Long)]
Appends a new set of records to the audit table.
Appends a new set of records to the audit table.
Fails when is called second time on same instance.
- ds
records to append
- lastUpdated
column that returns java.sql.Timestamp that will be used for de-duplication on the primary keys
- appendTS
timestamp of when the append has happened. It will not be used for de-duplications
- returns
(new state of the AuditTable, count of appended records) or error
- Definition Classes
- AuditTableFile → AuditTable
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val baseFolder: Path
-
def
calcRegionStats(ds: Dataset[_]): (Long, Timestamp)
- Attributes
- protected
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
val
coldPath: Path
- Attributes
- protected
-
def
compact(compactTS: Timestamp, trashMaxAge: Duration, smallRegionRowThreshold: Long, compactionPartitioner: CompactionPartitioner, recompactAll: Boolean): Try[AuditTable]
Request optimisation of the storage layer.
Request optimisation of the storage layer.
Fails when is called second time on same instance.
- compactTS
timestamp of when the compaction is requested, will not be used for any filtering of the data
- trashMaxAge
Maximum age of old region files kept in the .Trash folder after a compaction has happened.
- smallRegionRowThreshold
the row number threshold to use for determining small regions to be compacted. Default is 50000000
- compactionPartitioner
a partitioner object that dictates how many partitions should be generated for a given region
- recompactAll
Whether to recompact all regions regardless of size (i.e. ignore smallRegionRowThreshold)
- returns
new state of the AuditTable
- Definition Classes
- AuditTableFile → AuditTable
-
def
compactRegions(toCompact: Seq[AuditTableRegionInfo], compactTS: Timestamp, compactionPartitioner: CompactionPartitioner): Try[AuditTableFile]
- Attributes
- protected
- def deduplicate(ds: Dataset[_]): Dataset[_]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getLatestTimestamp(): Option[Timestamp]
Returns latest timestamp of records stored in the audit table.
Returns latest timestamp of records stored in the audit table.
- Definition Classes
- AuditTableFile → AuditTable
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
val
hotPath: Path
- Attributes
- protected
-
def
initNewTable(): Try[AuditTableFile.this.type]
Initializes audit table in the storage layer.
Initializes audit table in the storage layer. It will also persist all of the metadata (name, primary keys, custom meta) to the storage layer.
- returns
new state of the table or error
- Definition Classes
- AuditTableFile → AuditTable
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
logAndReturn[A](a: A, msg: String, level: Level): A
- Definition Classes
- Logging
-
def
logAndReturn[A](a: A, message: (A) ⇒ String, level: Level): A
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logName: String
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
markToUpdate(): Unit
Each function that modifies the state of the storage layer must call this function in the first line.
Each function that modifies the state of the storage layer must call this function in the first line. As audit's table state can be modified only once.
- Attributes
- protected
-
def
meta: Map[String, String]
Custom attributes assigned by the client application during table creation.
Custom attributes assigned by the client application during table creation.
- Definition Classes
- AuditTableFile → AuditTable
-
val
metaBasePath: Path
- Attributes
- protected
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val newRegionID: (AuditTableFile) ⇒ String
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
val
regionInfoBasePath: Path
- Attributes
- protected[storage]
-
val
regions: Seq[AuditTableRegionInfo]
- Definition Classes
- AuditTableFile → AuditTable
-
def
regionsToCompact(smallRegionRowThreshold: Long, recompactAll: Boolean): Seq[AuditTableRegionInfo]
- Attributes
- protected
-
def
snapshot(ts: Timestamp): Option[Dataset[_]]
Generates snapshot that contains only the latest records for the given timestamp.
Generates snapshot that contains only the latest records for the given timestamp. De-duplication happens on the primary keys.
- ts
use records that are closest to this timestamp
- returns
if no data in storage layer, return None
- Definition Classes
- AuditTableFile → AuditTable
- val storageOps: FileStorageOps
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val tableInfo: AuditTableInfo
-
def
tableName: String
Name of the table.
Name of the table.
- Definition Classes
- AuditTableFile → AuditTable
-
val
tablePath: Path
- Attributes
- protected[storage]
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
updateTableInfo(tableInfo: AuditTableInfo): Try[AuditTable]
Update the metadata for this table
Update the metadata for this table
- tableInfo
the new metadata
- returns
new state of the AuditTable
- Definition Classes
- AuditTableFile → AuditTable
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
var
wasModified: Boolean
Not thread safe.
Not thread safe. Protection against using mutator functions more than one time.
- Attributes
- protected