Search in sources :

Example 6 with ResultMetaData

use of org.hsqldb_voltpatches.result.ResultMetaData in project voltdb by VoltDB.

the class LobManager method deleteLob.

public Result deleteLob(long lobID) {
    Session session = this.sysLobSession;
    ResultMetaData meta = deleteLob.getParametersMetaData();
    Object[] params = new Object[meta.getColumnCount()];
    params[0] = Long.valueOf(lobID);
    params[1] = Long.valueOf(0);
    Result result = session.executeCompiledStatement(deleteLob, params);
    return result;
}
Also used : ResultMetaData(org.hsqldb_voltpatches.result.ResultMetaData) Session(org.hsqldb_voltpatches.Session) Result(org.hsqldb_voltpatches.result.Result)

Example 7 with ResultMetaData

use of org.hsqldb_voltpatches.result.ResultMetaData in project voltdb by VoltDB.

the class LobManager method divideBlockAddresses.

void divideBlockAddresses(Session session, long lobID, int offset) {
    ResultMetaData meta = divideLobPart.getParametersMetaData();
    Object[] params = new Object[meta.getColumnCount()];
    params[0] = Long.valueOf(lobID);
    params[1] = Integer.valueOf(offset);
    Result result = session.executeCompiledStatement(divideLobPart, params);
}
Also used : ResultMetaData(org.hsqldb_voltpatches.result.ResultMetaData) Result(org.hsqldb_voltpatches.result.Result)

Example 8 with ResultMetaData

use of org.hsqldb_voltpatches.result.ResultMetaData in project voltdb by VoltDB.

the class LobManager method truncate.

public Result truncate(Session session, long lobID, long offset) {
    Object[] data = getLobHeader(session, lobID);
    if (data == null) {
        return Result.newErrorResult(Error.error(ErrorCode.X_0F502));
    }
    /** @todo 1.9.0 - double offset for clob */
    long length = ((Long) data[1]).longValue();
    int blockOffset = (int) (offset / lobBlockSize);
    int blockLimit = (int) ((offset + length) / lobBlockSize);
    int byteLimitOffset = (int) ((offset + length) % lobBlockSize);
    if (byteLimitOffset != 0) {
        blockLimit++;
    }
    ResultMetaData meta = deleteLobPart.getParametersMetaData();
    Object[] params = new Object[meta.getColumnCount()];
    params[0] = Long.valueOf(lobID);
    params[1] = Integer.valueOf(blockOffset);
    params[2] = Integer.valueOf(blockLimit);
    params[3] = Long.valueOf(session.getTransactionTimestamp());
    Result result = session.executeCompiledStatement(deleteLobPart, params);
    setLength(session, lobID, offset);
    return ResultLob.newLobTruncateResponse(lobID);
}
Also used : ResultMetaData(org.hsqldb_voltpatches.result.ResultMetaData) Result(org.hsqldb_voltpatches.result.Result)

Example 9 with ResultMetaData

use of org.hsqldb_voltpatches.result.ResultMetaData in project voltdb by VoltDB.

the class LobManager method deleteBlockAddresses.

void deleteBlockAddresses(Session session, long lobID, int offset, int count) {
    ResultMetaData meta = deleteLobPart.getParametersMetaData();
    Object[] params = new Object[meta.getColumnCount()];
    params[0] = Long.valueOf(lobID);
    params[1] = Integer.valueOf(offset);
    params[2] = Integer.valueOf(count);
    Result result = session.executeCompiledStatement(deleteLobPart, params);
}
Also used : ResultMetaData(org.hsqldb_voltpatches.result.ResultMetaData) Result(org.hsqldb_voltpatches.result.Result)

Example 10 with ResultMetaData

use of org.hsqldb_voltpatches.result.ResultMetaData in project voltdb by VoltDB.

the class LobManager method createBlockAddresses.

void createBlockAddresses(Session session, long lobID, int offset, int count) {
    ResultMetaData meta = createLobPart.getParametersMetaData();
    Object[] params = new Object[meta.getColumnCount()];
    params[ALLOC_BLOCKS.BLOCK_COUNT] = Integer.valueOf(count);
    params[ALLOC_BLOCKS.BLOCK_OFFSET] = Integer.valueOf(offset);
    params[ALLOC_BLOCKS.LOB_ID] = Long.valueOf(lobID);
    Result result = session.executeCompiledStatement(createLobPart, params);
}
Also used : ResultMetaData(org.hsqldb_voltpatches.result.ResultMetaData) Result(org.hsqldb_voltpatches.result.Result)

Aggregations

Result (org.hsqldb_voltpatches.result.Result)11 ResultMetaData (org.hsqldb_voltpatches.result.ResultMetaData)11 RowSetNavigator (org.hsqldb_voltpatches.navigator.RowSetNavigator)2 Session (org.hsqldb_voltpatches.Session)1