Package io.github.mfvanek.pg.model.table
Class TableWithMissingIndex
java.lang.Object
io.github.mfvanek.pg.model.table.TableWithMissingIndex
- All Implemented Interfaces:
DbObject
,TableNameAware
,TableSizeAware
,Comparable<TableWithMissingIndex>
@Immutable
public class TableWithMissingIndex
extends Object
implements Comparable<TableWithMissingIndex>
Representation of a table in a database with additional information on reads amount via index or sequential scans.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(TableWithMissingIndex other) final boolean
long
final String
getName()
Gets database object name.long
final String
Gets table name.final long
Gets table size in bytes.final int
hashCode()
static TableWithMissingIndex
Constructs aTableWithMissingIndex
object.static TableWithMissingIndex
Constructs aTableWithMissingIndex
object.toString()
-
Field Details
-
table
-
-
Method Details
-
getSeqScans
public long getSeqScans() -
getIndexScans
public long getIndexScans() -
toString
-
equals
-
hashCode
public final int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<TableWithMissingIndex>
-
of
public static TableWithMissingIndex of(@Nonnull String tableName, long tableSizeInBytes, long seqScans, long indexScans) Constructs aTableWithMissingIndex
object.- Parameters:
tableName
- table name; should be non-blank.tableSizeInBytes
- table size in bytes; should be positive or zero.seqScans
- number of sequential scans initiated on this table; should be non-negative.indexScans
- number of index scans initiated on this table; should be non-negative.- Returns:
TableWithMissingIndex
-
of
Constructs aTableWithMissingIndex
object.- Parameters:
table
- table; should be non-null.seqScans
- number of sequential scans initiated on this table; should be non-negative.indexScans
- number of index scans initiated on this table; should be non-negative.- Returns:
TableWithMissingIndex
- Since:
- 0.7.0
-
getName
Gets database object name. -
getTableName
Gets table name.- Specified by:
getTableName
in interfaceTableNameAware
- Returns:
- table name
-
getTableSizeInBytes
public final long getTableSizeInBytes()Gets table size in bytes.- Specified by:
getTableSizeInBytes
in interfaceTableSizeAware
- Returns:
- table size in bytes
-