Package oracle.kv.table
Class TableUtils
- java.lang.Object
-
- oracle.kv.table.TableUtils
-
public class TableUtils extends Object
TableUtils is a utility class that encapsulates a number of useful functions that do not belong in any specific interface.- Since:
- 3.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getDataSize(Row row)
Returns the size of the serialized data for the row.static long
getId(Table table)
Get the table's ID.static String
getIdString(Table table)
Get the table's ID as a String.static int
getKeySize(IndexKey key)
Returns the size of the serialized index key.static int
getKeySize(Row row)
Returns the size of the serialized primary key for this row.
-
-
-
Method Detail
-
getDataSize
public static int getDataSize(Row row)
Returns the size of the serialized data for the row. This includes only the value portion of the record and not the key and is the length of the byte array that will be put as a database record.- Parameters:
row
- the Row to use for the operation- Returns:
- the size of the data portion of the serialized row, in bytes
- Throws:
IllegalArgumentException
- if called with aPrimaryKey
which has not data size
-
getKeySize
public static int getKeySize(Row row)
Returns the size of the serialized primary key for this row. It is the length of the byte array that is used as the database key for this row. If the key is not fully specified the value returned is that of the partial key.- Parameters:
row
- the Row to use for the operation- Returns:
- the size of the key portion serialized row, in bytes
-
getKeySize
public static int getKeySize(IndexKey key)
Returns the size of the serialized index key. It is the length of the byte array that is used as the database key for this row. If the key is not fully specified the value returned is that of the partial key.- Parameters:
key
- the IndexKey to use for the operation- Returns:
- the size of the key portion serialized row, in bytes
-
getId
public static long getId(Table table)
Get the table's ID. The ID is a system generated identifier used to create short keys for the table. It is not of general interest to applications other than browers and introspective applications.- Returns:
- the numeric id value
-
getIdString
public static String getIdString(Table table)
Get the table's ID as a String. This is the string that is used in keys generated for this table. It is not of general interest to applications other than browers and introspective applications. Because of the serialization format this value may not be human readable.- Returns:
- the string version of the id or the table name
-
-