public class MVTable extends TableBase
Modifier and Type | Field and Description |
---|---|
static DebuggingThreadLocal<ArrayList<String>> |
EXCLUSIVE_LOCKS
The table names this thread has exclusively locked.
|
static DebuggingThreadLocal<ArrayList<String>> |
SHARED_LOCKS
The tables names this thread has a shared lock on.
|
static DebuggingThreadLocal<String> |
WAITING_FOR_LOCK
The table name this thread is waiting to lock.
|
columns, compareMode, isHidden, TYPE_CACHED, TYPE_MEMORY
comment, database, trace
AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE
Constructor and Description |
---|
MVTable(CreateTableData data,
MVTableEngine.Store store) |
Modifier and Type | Method and Description |
---|---|
Index |
addIndex(Session session,
String indexName,
int indexId,
IndexColumn[] cols,
IndexType indexType,
boolean create,
String indexComment)
Create an index for this table
|
void |
addRow(Session session,
Row row)
Add a row to the table and all indexes.
|
boolean |
canDrop()
Check if this table can be dropped.
|
boolean |
canGetRowCount()
Check if the row count can be retrieved quickly.
|
boolean |
canTruncate()
Check if this table can be truncated.
|
ArrayList<Session> |
checkDeadlock(Session session,
Session clash,
Set<Session> visited)
Check if a deadlock occurred.
|
void |
checkRename()
Check if this object can be renamed.
|
void |
checkSupportAlter()
Check if this table supports ALTER TABLE.
|
void |
close(Session session)
Close the table object and flush changes.
|
void |
commit()
Mark the transaction as committed, so that the modification counter of
the database is incremented.
|
boolean |
getContainsLargeObject() |
long |
getDiskSpaceUsed() |
ArrayList<Index> |
getIndexes()
Get all indexes for this table.
|
String |
getMapName() |
long |
getMaxDataModificationId()
Get the last data modification id.
|
Row |
getRow(Session session,
long key)
Get the given row.
|
long |
getRowCount(Session session)
Get the row count for this table.
|
long |
getRowCountApproximation()
Get the approximated row count for this table.
|
Column |
getRowIdColumn()
Get the row id column if this table has one.
|
Index |
getScanIndex(Session session)
Get the scan index to iterate through all rows.
|
TableType |
getTableType()
Get the table type name
|
Index |
getUniqueIndex()
Get any unique index for this table if one exists.
|
boolean |
isDeterministic()
Check if the table is deterministic.
|
boolean |
isLockedExclusively()
Check if this table is locked exclusively.
|
boolean |
isLockedExclusivelyBy(Session session)
Check if the table is exclusively locked by this session.
|
boolean |
isMVStore() |
boolean |
lock(Session session,
boolean exclusive,
boolean forceLockEvenInMvcc)
Lock the table for the given session.
|
void |
removeChildrenAndResources(Session session)
Remove all dependent objects and free all resources (files, blocks in
files) of this object.
|
void |
removeRow(Session session,
Row row)
Remove a row from the table and all indexes.
|
String |
toString() |
void |
truncate(Session session)
Remove all rows from the table and indexes.
|
void |
unlock(Session s)
Release the lock for this session.
|
getCreateSQL, getDropSQL, isGlobalTemporary
addConstraint, addDependencies, addDependentView, addSequence, addSynonym, addTrigger, canReference, checkWritingAllowed, commit, compareTypeSafe, doesColumnExist, dropMultipleColumnsConstraintsAndIndexes, findPrimaryKey, fire, fireAfterRow, fireBeforeRow, fireRow, getBestPlanItem, getCheckForeignKeyConstraints, getChildren, getColumn, getColumn, getColumns, getCompareMode, getConstraints, getCreateSQLForCopy, getDefaultValue, getDependentViews, getIndex, getIndexForColumn, getOnCommitDrop, getOnCommitTruncate, getOnUpdateValue, getPrimaryKey, getScanIndex, getTemplateRow, getTemplateSimpleRow, getType, hasSelectTrigger, isHidden, isPersistData, isPersistIndexes, isQueryComparable, isTableExpression, isView, removeConstraint, removeDependentView, removeIndex, removeIndexOrTransferOwnership, removeSequence, removeSynonym, removeTrigger, rename, renameColumn, setCheckForeignKeyConstraints, setColumns, setHidden, setOnCommitDrop, setOnCommitTruncate, setTableExpression, updateRows, validateConvertUpdateSequence
getSchema, getSQL, initSchemaObjectBase
getComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComment, getDatabase, getId, getName, isTemporary, setComment, setTemporary
public static final DebuggingThreadLocal<String> WAITING_FOR_LOCK
public static final DebuggingThreadLocal<ArrayList<String>> EXCLUSIVE_LOCKS
public static final DebuggingThreadLocal<ArrayList<String>> SHARED_LOCKS
public MVTable(CreateTableData data, MVTableEngine.Store store)
public String getMapName()
public boolean lock(Session session, boolean exclusive, boolean forceLockEvenInMvcc)
Table
public ArrayList<Session> checkDeadlock(Session session, Session clash, Set<Session> visited)
Table
checkDeadlock
in class Table
session
- the session to be tested forclash
- set with sessions already visited, and null when starting
verificationvisited
- set with sessions already visited, and null when starting
verificationpublic boolean isLockedExclusively()
Table
isLockedExclusively
in class Table
public boolean isLockedExclusivelyBy(Session session)
Table
isLockedExclusivelyBy
in class Table
session
- the sessionpublic void unlock(Session s)
Table
public boolean canTruncate()
Table
canTruncate
in class Table
public void close(Session session)
Table
public Row getRow(Session session, long key)
Table
public Index addIndex(Session session, String indexName, int indexId, IndexColumn[] cols, IndexType indexType, boolean create, String indexComment)
Table
public void removeRow(Session session, Row row)
Table
public void truncate(Session session)
Table
public void addRow(Session session, Row row)
Table
public void checkSupportAlter()
Table
checkSupportAlter
in class Table
public TableType getTableType()
Table
getTableType
in class Table
public Index getScanIndex(Session session)
Table
getScanIndex
in class Table
session
- the sessionpublic Index getUniqueIndex()
Table
getUniqueIndex
in class Table
public ArrayList<Index> getIndexes()
Table
getIndexes
in class Table
public long getMaxDataModificationId()
Table
getMaxDataModificationId
in class Table
public boolean getContainsLargeObject()
public boolean isDeterministic()
Table
isDeterministic
in class Table
public boolean canGetRowCount()
Table
canGetRowCount
in class Table
public boolean canDrop()
Table
public void removeChildrenAndResources(Session session)
DbObjectBase
removeChildrenAndResources
in interface DbObject
removeChildrenAndResources
in class Table
session
- the sessionpublic long getRowCount(Session session)
Table
getRowCount
in class Table
session
- the sessionpublic long getRowCountApproximation()
Table
getRowCountApproximation
in class Table
public long getDiskSpaceUsed()
getDiskSpaceUsed
in class Table
public void checkRename()
DbObjectBase
checkRename
in interface DbObject
checkRename
in class DbObjectBase
public Column getRowIdColumn()
Table
getRowIdColumn
in class Table
public String toString()
toString
in class DbObjectBase
public void commit()
Copyright © 2020 JBoss by Red Hat. All rights reserved.