deephaven_enterprise.system_table_logger

class Codec(j_codec)[source]

Bases: object

A Simple wrapper class around io.deephaven.util.codec.ObjectCodec

byte_array_codec()[source]

Create a new byte array codec

Returns:

a new byte array codec

char_array_codec()[source]

Create a new char array codec

Returns:

a new char array codec

codec(codec)[source]

Create a Codec instance for use with log_table and log_table_incremental

Parameters:

codec (Union[str, ObjectCodec]) – the codec as either a string representing the fully qualified java class, or an instance of a java io.deephaven.util.codec.ObjectCodec

Return type:

Codec

Returns:

a new codec

double_array_codec()[source]

Create a new double array codec

Returns:

a new double array codec

float_array_codec()[source]

Create a new float array codec

Returns:

a new float array codec

int_array_codec()[source]

Create a new int array codec

Returns:

a new int array codec

log_table(namespace, table_name, table, columnPartition, internalPartition=None, applicationVersion=None, zone=None, useLas=True, logDir=None, codecs=None)[source]

Write tableToLog to System storage.

The table is logged to Intraday storage and can be retrieved with db.live_table. Historical tables should be written using a merge process.

Parameters:
  • namespace (str) – the namespace of the table

  • table_name (str) – the name of the table

  • table (Table) – the table to log

  • columnPartition (str) – the column partition to log to, if None then uses the current date

  • internalPartition (Optional[str]) – the internal partition, if None an internal partition is generated

  • applicationVersion (Optional[int]) – the application version, if None defaults to zero

  • zone (Optional[str]) – the time zone ID (as interpreted by java.time.ZoneId.of)

  • useLas (bool) – use the log aggregator service (defaults to true)

  • logDir (Optional[str]) – the directory for writing binary log files (useLas must be false)

  • codecs (Optional[Dict[str, Codec]]) – an optional map of column name to Codec for encoding the values

log_table_incremental(namespace, table_name, table, columnPartition, internalPartition=None, applicationVersion=None, zone=None, useLas=True, logDir=None, codecs=None)[source]

Write tableToLog to System storage.

The table is logged to Intraday storage and can be retrieved with db.live_table. Historical tables should be written using a merge process.

No rows should be removed or modified in tableToLog. Modifications are an error. If the table is not a <i>blink</i> table, then removals are an error.

Parameters:
  • namespace (str) – the namespace of the table

  • table_name (str) – the name of the table

  • table (Table) – the table to log

  • columnPartition (str) – the column partition to log to, if None then uses the current date

  • internalPartition (Optional[str]) – the internal partition, if None an internal partition is generated

  • applicationVersion (Optional[int]) – the application version, if None defaults to zero

  • zone (Optional[str]) – the time zone ID (as interpreted by java.time.ZoneId.of)

  • useLas (bool) – use the log aggregator service (defaults to true)

  • logDir (Optional[str]) – the directory for writing binary log files (useLas must be false)

  • codecs (Optional[Dict[str, Codec]]) – an optional map of column name to Codec for encoding the values

Returns:

a context manager that can be used in a with statement, or alternatively you can call close() when complete.

Users should hold this return value to ensure liveness for writing.

long_array_codec()[source]

Create a new long array codec

Returns:

a new long array codec

short_array_codec()[source]

Create a new short array codec

Returns:

a new short array codec

string_array_codec()[source]

Create a new string array codec

Returns:

a new string array codec