[docs]deflog_table(namespace:str,table_name:str,table:Table,columnPartition:str,internalPartition:str=None,applicationVersion:int=None,zone:str=None,useLas:bool=True,logDir:str=None):""" 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. :param namespace: the namespace of the table :param table_name: the name of the table :param table: the table to log :param columnPartition: the column partition to log to, if None then uses the current date :param internalPartition: the internal partition, if None an internal partition is generated :param applicationVersion: the application version, if None defaults to zero :param zone: the time zone ID (as interpreted by java.time.ZoneId.of) :param useLas: use the log aggregator service (defaults to true) :param logDir: the directory for writing binary log files (useLas must be false) """j_db=deephaven_enterprise.database.db.j_dbopts=j_stl.newOptionsBuilder()ifcolumnPartitionisNone:opts.currentDateColumnPartition(True)else:opts.fixedColumnPartition(columnPartition)ifinternalPartitionisnotNone:opts.internalPartition(internalPartition)ifapplicationVersionisnotNone:opts.applicationVersion(applicationVersion)ifzoneisnotNone:opts.zoneId(j_zoneid.of(zone))opts.useLas(useLas)iflogDirisnotNone:opts.logDirectory(logDir)j_stl.logTable(j_db,namespace,table_name,table.j_table,opts.build())
[docs]deflog_table_incremental(namespace:str,table_name:str,table:Table,columnPartition:str,internalPartition:str=None,applicationVersion:int=None,zone:str=None,useLas:bool=True,logDir:str=None):""" 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. :param namespace: the namespace of the table :param table_name: the name of the table :param table: the table to log :param columnPartition: the column partition to log to, if None then uses the current date :param internalPartition: the internal partition, if None an internal partition is generated :param applicationVersion: the application version, if None defaults to zero :param zone: the time zone ID (as interpreted by java.time.ZoneId.of) :param useLas: use the log aggregator service (defaults to true) :param logDir: the directory for writing binary log files (useLas must be false) :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. """j_db=deephaven_enterprise.database.db.j_dbopts=j_stl.newOptionsBuilder()ifcolumnPartitionisNone:opts.currentDateColumnPartition(True)else:opts.fixedColumnPartition(columnPartition)ifinternalPartitionisnotNone:opts.internalPartition(internalPartition)ifapplicationVersionisnotNone:opts.applicationVersion(applicationVersion)ifzoneisnotNone:opts.zoneId(j_zoneid.of(zone))opts.useLas(useLas)iflogDirisnotNone:opts.logDirectory(logDir)closeable=j_stl.logTableIncremental(j_db,namespace,table_name,table.j_table,opts.build())classCleanup:def__enter__(self):returnselfdefclose(self):closeable.close()def__exit__(self,exc_type,exc_value,traceback):self.close()returnFalsedef__del__(self):self.close()returnCleanup()