public class Table extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected Column[] |
columns |
protected String |
name |
protected long |
shardSizeMillis |
protected long |
shardSizeSecs |
Constructor and Description |
---|
Table(Column[] columns,
long shardSizeMillis,
String name)
Initialize a new timeseries table.
|
Table(Session session,
String name)
Initialize a new timeseries table.
|
Modifier and Type | Method and Description |
---|---|
static AutoFlushWriter |
asyncAutoFlushWriter(Session session,
String name)
Initializes new writer for a timeseries table that periodically flushes
its local cache, and makes use of high-speed buffered writes.
|
static AutoFlushWriter |
asyncAutoFlushWriter(Session session,
String name,
long threshold)
Initializes new writer for a timeseries table that periodically flushes
its local cache, and makes use of high-speed buffered writes.
|
static AutoFlushWriter |
asyncAutoFlushWriter(Session session,
Table table)
Initializes new writer for a timeseries table that periodically flushes
its local cache, and makes use of high-speed buffered writes.
|
static AutoFlushWriter |
asyncAutoFlushWriter(Session session,
Table table,
long threshold)
Initializes new writer for a timeseries table that periodically flushes
its local cache, and makes use of high-speed buffered writes.
|
static Writer |
asyncWriter(Session session,
String name)
Initializes new writer for a single timeseries table using
high-speed buffered writes.
|
static Writer |
asyncWriter(Session session,
Table table)
Initializes new writer for a timeseries table using high-speed
buffered writes.
|
static void |
attachTag(Session session,
String tableName,
String tag)
Attaches a tag to an existing table.
|
static void |
attachTag(Session session,
Table table,
String tag)
Attaches a tag to an existing table.
|
static void |
attachTags(Session session,
String tableName,
List<String> tags)
Attaches tags to an existing table.
|
static void |
attachTags(Session session,
Table table,
List<String> tags)
Attaches tags to an existing table.
|
static AutoFlushWriter |
autoFlushWriter(Session session,
String name)
Initializes new writer for a timeseries table that periodically flushes
its local cache.
|
static AutoFlushWriter |
autoFlushWriter(Session session,
String name,
long threshold)
Initializes new writer for a timeseries table that periodically flushes
its local cache.
|
static AutoFlushWriter |
autoFlushWriter(Session session,
Table table)
Initializes new writer for a timeseries table that periodically flushes
its local cache.
|
static AutoFlushWriter |
autoFlushWriter(Session session,
Table table,
long threshold)
Initializes new writer for a timeseries table that periodically flushes
its local cache.
|
int |
columnIndexById(String id)
Utility function that looks up a column's index by its id.
|
static Table |
create(Session session,
String name,
Column[] columns)
Create new timeseries table with a default shard size.
|
static Table |
create(Session session,
String name,
Column[] columns,
long shardSize)
Create new timeseries table.
|
static Table |
create(Session session,
String name,
Table skeleton)
Create new timeseries table by copying a 'skeleton' table's schema and using
the default shard size.
|
static Table |
create(Session session,
String name,
Table skeleton,
long shardSize)
Create new timeseries table by copying a 'skeleton' table's schema.
|
static Writer |
expAsyncWriter(Session session,
String name)
Initializes new, experimental high-performance exp columns writer
with asynchronous push mode.
|
static Writer |
expAsyncWriter(Session session,
Table table)
Initializes new, experimental high-performance exp columns writer
with asynchronous push mode.
|
static Writer |
expFastWriter(Session session,
String name)
Initializes new writer for a single table that makes use of
in-place updates rather than copy-on-write.
|
static Writer |
expFastWriter(Session session,
Table table)
Initializes new writer for a single table that makes use of
in-place updates rather than copy-on-write.
|
static Writer |
expTruncateWriter(Session session,
String name)
Initializes new, experimental high-performance exp columns writer.
|
static Writer |
expTruncateWriter(Session session,
Table table)
Initializes new, experimental high-performance exp columns writer.
|
static Writer |
expWriter(Session session,
String name)
Initializes new, experimental high-performance writer.
|
static Writer |
expWriter(Session session,
Table table)
Initializes new, experimental high-performance writer.
|
static AutoFlushWriter |
fastAutoFlushWriter(Session session,
String name)
Initializes new writer for a timeseries table that periodically flushes
its local cache, and makes use of high-speed buffered writes.
|
static AutoFlushWriter |
fastAutoFlushWriter(Session session,
String name,
long threshold)
Initializes new writer for a timeseries table that periodically flushes
its local cache, and makes use of high-speed buffered writes.
|
static AutoFlushWriter |
fastAutoFlushWriter(Session session,
Table table)
Initializes new writer for a timeseries table that periodically flushes
its local cache, and makes use of high-speed buffered writes.
|
static AutoFlushWriter |
fastAutoFlushWriter(Session session,
Table table,
long threshold)
Initializes new writer for a timeseries table that periodically flushes
its local cache, and makes use of high-speed buffered writes.
|
static Writer |
fastWriter(Session session,
String name)
Initializes new writer for a single table that makes use of
in-place updates rather than copy-on-write.
|
static Writer |
fastWriter(Session session,
Table table)
Initializes new writer for a single table that makes use of
in-place updates rather than copy-on-write.
|
Column[] |
getColumns()
Returns column representation of this table.
|
static Column[] |
getColumns(Session session,
String name)
Returns column layout of table.
|
Value.Type[] |
getColumnTypes()
Returns the types of each of the columns.
|
String |
getName()
Returns the table name.
|
long |
getShardSize()
Returns this table's shard size (in seconds)
|
static long |
getShardSize(Session session,
String tableName)
Returns the shard size (in milliseconds) of the table.
|
static long |
getShardSize(Session session,
Table table)
Returns the shard size (in seconds) of the table.
|
long |
getShardSizeMillis()
Returns this table's shard size (in milliseconds)
|
static long |
getShardSizeMillis(Session session,
Table table)
Returns the shard size (in milliseconds) of the table.
|
static Table |
likeOther(Table other,
String name)
Creates a new table object with the exact same structure and shard size
as another table.
|
static Writer |
pinnedAsyncWriter(Session session,
String name)
Initializes new, experimental high-performance pinned columns writer
with asynchronous push mode.
|
static Writer |
pinnedAsyncWriter(Session session,
Table table)
Initializes new, experimental high-performance pinned columns writer
with asynchronous push mode.
|
static Writer |
pinnedFastWriter(Session session,
String name)
Initializes new writer for a single table that makes use of
in-place updates rather than copy-on-write.
|
static Writer |
pinnedFastWriter(Session session,
Table table)
Initializes new writer for a single table that makes use of
in-place updates rather than copy-on-write.
|
static Writer |
pinnedTruncateWriter(Session session,
String name)
Initializes new, experimental high-performance pinned columns writer.
|
static Writer |
pinnedTruncateWriter(Session session,
Table table)
Initializes new, experimental high-performance pinned columns writer.
|
static Writer |
pinnedWriter(Session session,
String name)
Initializes new, experimental high-performance pinned columns writer.
|
static Writer |
pinnedWriter(Session session,
Table table)
Initializes new, experimental high-performance pinned columns writer.
|
static Reader |
reader(Session session,
String name,
TimeRange[] ranges)
Initializes new reader for a timeseries table.
|
static Reader |
reader(Session session,
Table table,
TimeRange[] ranges)
Initializes new reader for a timeseries table.
|
static void |
remove(Session session,
String name)
Remove existing timeseries table.
|
static void |
remove(Session session,
Table table)
Remove existing timeseries table.
|
String |
toString() |
static Writer |
truncateWriter(Session session,
String name)
Initializes new writer for a single table that replaces any
existing data with the new data, rather than just adding.
|
static Writer |
truncateWriter(Session session,
Table table)
Initializes new writer for a single table that replaces any
existing data with the new data, rather than just adding.
|
static Writer |
writer(Session session,
String name)
Initializes new writer for a single timeseries table.
|
static Writer |
writer(Session session,
Table table)
Initializes new writer for a timeseries table.
|
protected String name
protected long shardSizeMillis
protected long shardSizeSecs
protected Column[] columns
public Table(Session session, String name)
session
- Active connection with the QdbClustername
- Timeseries name. Must already exist.public static Table likeOther(Table other, String name)
other
- Table to use the schema and shard size ofname
- Name of the new table to be initialized.public static Table create(Session session, String name, Table skeleton)
session
- Active session with the QuasarDB cluster.name
- Unique identifier for this timeseries table.skeleton
- Skeleton table's schema to be copied.public static Table create(Session session, String name, Table skeleton, long shardSize)
session
- Active session with the QuasarDB cluster.name
- Unique identifier for this timeseries table.skeleton
- Skeleton table's schema to be copied.shardSize
- The size of the shards in ms.public static Table create(Session session, String name, Column[] columns)
session
- Active session with the QuasarDB cluster.name
- Unique identifier for this timeseries table.columns
- Column definitions of this table. The ordering of the array will persist
through the table definition and cannot be changed after creation.public static Table create(Session session, String name, Column[] columns, long shardSize)
session
- Active session with the QuasarDB cluster.name
- Unique identifier for this timeseries table.columns
- Column definitions of this table. The ordering of the array will persist
through the table definition and cannot be changed after creation.shardSize
- The size of the shards in ms.public static void remove(Session session, String name)
session
- Active session with the QuasarDB clustername
- Unique identifier for this timeseries table.public static void remove(Session session, Table table)
session
- Active session with the QuasarDB clustertable
- Table to removepublic static Writer writer(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer writer(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.public static Writer pinnedWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer pinnedWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.public static Writer expWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer expWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.public static Writer pinnedTruncateWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer pinnedTruncateWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.public static Writer expTruncateWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer expTruncateWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.public static Writer asyncWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer asyncWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.public static Writer pinnedAsyncWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer pinnedAsyncWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.public static Writer expAsyncWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer expAsyncWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.public static Writer fastWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer fastWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Table to insert into.public static Writer pinnedFastWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer pinnedFastWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Table to insert into.public static Writer expFastWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer expFastWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Table to insert into.public static Writer truncateWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static Writer truncateWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Table to insert into.public static AutoFlushWriter autoFlushWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static AutoFlushWriter autoFlushWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.public static AutoFlushWriter autoFlushWriter(Session session, String name, long threshold)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.threshold
- The amount of rows to keep in local buffer before automatic flushing occurs.public static AutoFlushWriter autoFlushWriter(Session session, Table table, long threshold)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.threshold
- The amount of rows to keep in local buffer before automatic flushing occurs.public static AutoFlushWriter asyncAutoFlushWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static AutoFlushWriter asyncAutoFlushWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.public static AutoFlushWriter asyncAutoFlushWriter(Session session, String name, long threshold)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.threshold
- The amount of rows to keep in local buffer before automatic flushing occurs.public static AutoFlushWriter asyncAutoFlushWriter(Session session, Table table, long threshold)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.threshold
- The amount of rows to keep in local buffer before automatic flushing occurs.public static AutoFlushWriter fastAutoFlushWriter(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.public static AutoFlushWriter fastAutoFlushWriter(Session session, Table table)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.public static AutoFlushWriter fastAutoFlushWriter(Session session, String name, long threshold)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.threshold
- The amount of rows to keep in local buffer before automatic flushing occurs.public static AutoFlushWriter fastAutoFlushWriter(Session session, Table table, long threshold)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.threshold
- The amount of rows to keep in local buffer before automatic flushing occurs.public static Reader reader(Session session, String name, TimeRange[] ranges)
session
- Active session with the QuasarDB cluster.name
- Timeseries table name. Must already exist.ranges
- Time ranges to look for.public static Reader reader(Session session, Table table, TimeRange[] ranges)
session
- Active session with the QuasarDB cluster.table
- Timeseries table.ranges
- Time time ranges to look for.public static void attachTag(Session session, Table table, String tag)
session
- Active session with the QuasarDB clustertable
- Timeseries tabletag
- Tag to attachpublic static void attachTag(Session session, String tableName, String tag)
session
- Active session with the QuasarDB clustertableName
- Name of the timeseries tabletag
- Tag to attachpublic static void attachTags(Session session, Table table, List<String> tags)
session
- Active session with the QuasarDB clustertable
- Timeseries tabletags
- Tags to attachpublic static void attachTags(Session session, String tableName, List<String> tags)
session
- Active session with the QuasarDB clustertableName
- Name of the timeseries tabletags
- Tags to attachpublic String getName()
public long getShardSizeMillis()
public long getShardSize()
public static long getShardSizeMillis(Session session, Table table)
public static long getShardSize(Session session, Table table)
public static long getShardSize(Session session, String tableName)
public static Column[] getColumns(Session session, String name)
session
- Active session with the QuasarDB cluster.name
- Unique identifier for this timeseries table.public Column[] getColumns()
public Value.Type[] getColumnTypes()
public int columnIndexById(String id)
id
- String identifier of the column.Copyright © 2021. All rights reserved.