Interface IStatsFileDatabaseLevel
- 
 public interface IStatsFileDatabaseLevel
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleandeleteRows(int row)Deletes all rows equal to and greater than supplied row.booleandeleteRowsAll()Deletes all data in level.voiddropIndexData()As time and records are read/written some storage is used to speed operation.booleanfindTime(long time, com.wowza.wms.stats.database.file.StatsFileDatabaseTime timeResult)Find the closest row with a given time.intgetBytesPerField()Get the number of bytes per-fieldintgetFieldCount()Get the number of fields per-row.booleangetFirstTime(com.wowza.wms.stats.database.file.StatsFileDatabaseTime timeResult)Get the time of row 0intgetFlags()Get flagsbooleangetLastTime(com.wowza.wms.stats.database.file.StatsFileDatabaseTime timeResult)Get the time of last rowlonggetLastWriteTime()Get the time of the last row written.intgetLevelIndex()Get level indexintgetRowCountCurrent()Get the current number of rows in the levelintgetRowCountMax()Get the maximum number of rows for this levelintgetRowStorageSize()Get the storage size in bytes for a single row of data.intgetTableCount()Get the number of tablesbooleangetTime(int row, com.wowza.wms.stats.database.file.StatsFileDatabaseTime timeResult)Get time associdated with a given row.intgetTimeIncrement()Get the time increment for this level (only informational)intgetTimeIndexFactor()Not really used - may use in the futureintgetTimes(int row, int count, long[] time)Get time for a range or rows.intgetVersion()Get versionbooleanreadRows(int table, int row, int count, byte[] rowBytes, int offset)Read the data for a range of rows.voidsetBytesPerField(int bytesPerField)Set the number of bytes per-fied (only when creating empty database)voidsetFieldCount(int fieldCount)Set the number of fields per-row (only when creating empty database)voidsetRowCountMax(int rowCountMax)Get the max number of rows (only when creating empty database)voidsetTableCount(int tableCount)Set number of tables (only when creating empty database)voidsetTimeIncrement(int timeIncrement)Set the time increment for this level vvoidsetTimeIndexFactor(int timeIndexFactor)Not really used - may use in the futurebooleanwriteRow(long timecode, int[] fields)Write a row to the level.booleanwriteRow(long timecode, int[][] fieldsArr)Write a row to the level.
 
- 
- 
- 
Method Detail- 
getLevelIndexint getLevelIndex() Get level index- Returns:
- level index
 
 - 
dropIndexDatavoid dropIndexData() As time and records are read/written some storage is used to speed operation. This will dump the storage. It will be re-created if needed by underlying APIs.
 - 
findTimeboolean findTime(long time, com.wowza.wms.stats.database.file.StatsFileDatabaseTime timeResult)Find the closest row with a given time. If the time is greater then the last row false will be returned. If the level is empty false will be returned. It will find closets time not greater then the requested time.- Parameters:
- time-
- timeResult-
- Returns:
- returns false if time is greater than last row in level or level is empty
 
 - 
getFirstTimeboolean getFirstTime(com.wowza.wms.stats.database.file.StatsFileDatabaseTime timeResult) Get the time of row 0- Parameters:
- timeResult-
- Returns:
- returns false if level is empty
 
 - 
getLastTimeboolean getLastTime(com.wowza.wms.stats.database.file.StatsFileDatabaseTime timeResult) Get the time of last row- Parameters:
- timeResult-
- Returns:
- returns false if level is empty
 
 - 
getTimeboolean getTime(int row, com.wowza.wms.stats.database.file.StatsFileDatabaseTime timeResult)Get time associdated with a given row.- Parameters:
- row-
- timeResult-
- Returns:
- returns false if row is greater then total row count or level is empty
 
 - 
getTimesint getTimes(int row, int count, long[] time)Get time for a range or rows. If count = -1 it will get times for all rows to end of table.- Parameters:
- row-
- count-
- time-
- Returns:
- returns false if row+count is greater then total row count or level is empty
 
 - 
getLastWriteTimelong getLastWriteTime() Get the time of the last row written. writeRow will fail if try to write row using timecode less than this value. If returns -1 means level is empty.- Returns:
- time of the last row written (milliseconds)
 
 - 
deleteRowsAllboolean deleteRowsAll() Deletes all data in level.- Returns:
- true, if rows deleted
 
 - 
deleteRowsboolean deleteRows(int row) Deletes all rows equal to and greater than supplied row.- Parameters:
- row-
- Returns:
- true, if rows deleted
 
 - 
getRowStorageSizeint getRowStorageSize() Get the storage size in bytes for a single row of data.- Returns:
- storage size in bytes
 
 - 
readRowsboolean readRows(int table, int row, int count, byte[] rowBytes, int offset)Read the data for a range of rows. If count = -1 will read from row to the end of the level.- Parameters:
- table-
- row-
- count-
- rowBytes-
- offset-
- Returns:
- true if successful
 
 - 
writeRowboolean writeRow(long timecode, int[] fields)Write a row to the level. This is for writing the level with only a single table's worth of data.- Parameters:
- timecode-
- fields-
- Returns:
- true if successful
 
 - 
writeRowboolean writeRow(long timecode, int[][] fieldsArr)Write a row to the level. This is for writing to a level with more than one table (avg, min, max)- Parameters:
- timecode-
- fieldsArr-
- Returns:
- true if successful
 
 - 
getRowCountMaxint getRowCountMax() Get the maximum number of rows for this level- Returns:
- maximum number of rows for this level
 
 - 
setRowCountMaxvoid setRowCountMax(int rowCountMax) Get the max number of rows (only when creating empty database)- Parameters:
- rowCountMax-
 
 - 
getRowCountCurrentint getRowCountCurrent() Get the current number of rows in the level- Returns:
- current number of rows in the level
 
 - 
getFieldCountint getFieldCount() Get the number of fields per-row.- Returns:
- number of fields per-row
 
 - 
setFieldCountvoid setFieldCount(int fieldCount) Set the number of fields per-row (only when creating empty database)- Parameters:
- fieldCount-
 
 - 
getTableCountint getTableCount() Get the number of tables- Returns:
- number of tables
 
 - 
setTableCountvoid setTableCount(int tableCount) Set number of tables (only when creating empty database)- Parameters:
- tableCount-
 
 - 
getBytesPerFieldint getBytesPerField() Get the number of bytes per-field- Returns:
- number of bytes per-field
 
 - 
setBytesPerFieldvoid setBytesPerField(int bytesPerField) Set the number of bytes per-fied (only when creating empty database)- Parameters:
- bytesPerField-
 
 - 
getTimeIncrementint getTimeIncrement() Get the time increment for this level (only informational)- Returns:
- time increment for this level
 
 - 
setTimeIncrementvoid setTimeIncrement(int timeIncrement) Set the time increment for this level v- Parameters:
- timeIncrement-
 
 - 
getTimeIndexFactorint getTimeIndexFactor() Not really used - may use in the future- Returns:
- not used
 
 - 
setTimeIndexFactorvoid setTimeIndexFactor(int timeIndexFactor) Not really used - may use in the future- Parameters:
- timeIndexFactor-
 
 - 
getVersionint getVersion() Get version- Returns:
- version
 
 - 
getFlagsint getFlags() Get flags- Returns:
- flags
 
 
- 
 
-