@Override public boolean isLargeObject() { return _delegate.isLargeObject(); }
@Override public boolean isLargeObject() { return _delegate.isLargeObject(); }
/** * Gets the size (in bytes) of a column with a specific {@link ColumnType} * and size */ private int getSize(ColumnType type, int columnSize) { final int baseSize; if (type.isBinary()) { baseSize = 1; } else if (type.isBoolean()) { baseSize = 1; } else if (type.isLiteral()) { baseSize = 2; } else if (type.isNumber()) { baseSize = 16; } else { baseSize = DEFAULT_COLUMN_SIZE; } int result = baseSize * columnSize; if (type.isLargeObject()) { // assign at least 4KB for LOBs. result = Math.max(result, 4 * KB); } return result; }
/** * Gets the size (in bytes) of a column with a specific {@link ColumnType} * and size */ private int getSize(ColumnType type, int columnSize) { final int baseSize; if (type.isBinary()) { baseSize = 1; } else if (type.isBoolean()) { baseSize = 1; } else if (type.isLiteral()) { baseSize = 2; } else if (type.isNumber()) { baseSize = 16; } else { baseSize = DEFAULT_COLUMN_SIZE; } int result = baseSize * columnSize; if (type.isLargeObject()) { // assign at least 4KB for LOBs. result = Math.max(result, 4 * KB); } return result; }
/** * Gets the (approximate) size (in bytes) of a column with a specific * {@link ColumnType}. */ private int getSize(ColumnType type) { if (type.isBinary()) { return 4 * KB; } else if (type.isBoolean()) { return 2; } else if (type.isLargeObject()) { return 4 * KB; } else if (type.isLiteral()) { return KB; } else if (type.isNumber()) { return 16; } else { return DEFAULT_COLUMN_SIZE; } } }
/** * Gets the (approximate) size (in bytes) of a column with a specific * {@link ColumnType}. */ private int getSize(ColumnType type) { if (type.isBinary()) { return 4 * KB; } else if (type.isBoolean()) { return 2; } else if (type.isLargeObject()) { return 4 * KB; } else if (type.isLiteral()) { return KB; } else if (type.isNumber()) { return 16; } else { return DEFAULT_COLUMN_SIZE; } } }
/** * Gets the size (in bytes) of a single {@link Column} */ protected int getValueSize(Column column) { ColumnType type = column.getType(); if (type == null) { return DEFAULT_COLUMN_SIZE; } else { Integer columnSize = column.getColumnSize(); if (columnSize == null) { // if column size is missing, then use // size-indifferent approach return getSize(type); } else if (columnSize > 10000 && !type.isLargeObject()) { // if column size is unrealistically high, then use // size-indifferent approach return getSize(type); } else { return getSize(type, columnSize); } } }
/** * Gets the size (in bytes) of a single {@link Column} */ protected int getValueSize(Column column) { ColumnType type = column.getType(); if (type == null) { return DEFAULT_COLUMN_SIZE; } else { Integer columnSize = column.getColumnSize(); if (columnSize == null) { // if column size is missing, then use // size-indifferent approach return getSize(type); } else if (columnSize > 10000 && !type.isLargeObject()) { // if column size is unrealistically high, then use // size-indifferent approach return getSize(type); } else { return getSize(type, columnSize); } } }