Search in sources :

Example 1 with IllegalRowStoreOperationException

use of io.dingodb.store.row.errors.IllegalRowStoreOperationException in project dingo by dingodb.

the class KVStoreStateMachine method batchApplyAndRecycle.

private int batchApplyAndRecycle(final byte opByte, final KVStateOutputList kvStates) {
    try {
        final int size = kvStates.size();
        if (size == 0) {
            return 0;
        }
        if (!KVOperation.isValidOp(opByte)) {
            throw new IllegalRowStoreOperationException("Unknown operation: " + opByte);
        }
        // metrics: op qps
        final Meter opApplyMeter = KVMetrics.meter(STATE_MACHINE_APPLY_QPS, String.valueOf(this.region.getId()), KVOperation.opName(opByte));
        opApplyMeter.mark(size);
        this.batchWriteHistogram.update(size);
        // do batch apply
        batchApply(opByte, kvStates);
        return size;
    } finally {
        RecycleUtil.recycle(kvStates);
    }
}
Also used : IllegalRowStoreOperationException(io.dingodb.store.row.errors.IllegalRowStoreOperationException) Meter(com.codahale.metrics.Meter)

Aggregations

Meter (com.codahale.metrics.Meter)1 IllegalRowStoreOperationException (io.dingodb.store.row.errors.IllegalRowStoreOperationException)1