01: /*
02:
03: Derby - Class org.apache.derby.iapi.store.raw.LogicalUndoable
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: package org.apache.derby.iapi.store.raw;
23:
24: import org.apache.derby.iapi.error.StandardException;
25:
26: import org.apache.derby.iapi.store.access.conglomerate.LogicalUndo;
27:
28: import org.apache.derby.iapi.types.DataValueDescriptor;
29:
30: import org.apache.derby.iapi.services.io.LimitObjectInput;
31: import java.io.IOException;
32:
33: /**
34: A LogicalUndoable is a log operation that operates on the content of a page
35: and the log operation needs logical undo. This interface is used by
36: LogicalUndo to extract information out of the log record, and to pass back
37: to the logging system the real location where the roll back should happen.
38: <P>
39: It has specific page information such as its segment Id, container Id, page
40: number, and it knows how to restore a storable row from the information
41: stored in the log record.
42:
43: @see org.apache.derby.iapi.store.access.conglomerate.LogicalUndo
44: */
45: public interface LogicalUndoable extends Undoable {
46: /**
47: Return the containerHandle used by this log operation. Logical cannot
48: change container identity between roll forward and roll back. This
49: method should only be called by LogicalUndo to extract information from
50: the log record.
51:
52: @exception StandardException Standard Cloudscape error policy
53: */
54: public ContainerHandle getContainer() throws StandardException;
55:
56: /**
57: Return the recordHandle stored in the log operation that correspond to
58: the record that was changed in the rollforward. This method should
59: only be called by LogicalUndo to extract information from the log
60: record.
61:
62: */
63: public RecordHandle getRecordHandle();
64:
65: /**
66: Restore the row stored in the log operation. This method should only
67: be called by LogicalUndo to extract information from the log record.
68:
69: @param row an IN/OUT parameter, caller passed in the row with
70: the correct column number and type, the log operation will restore the
71: row with the optional data stored in the log record.
72:
73: @exception StandardException Standard Cloudscape error policy
74: @exception IOException Method may read from in
75:
76: @see LogicalUndo
77: */
78: public void restoreLoggedRow(Object[] row, LimitObjectInput in)
79: throws StandardException, IOException;
80:
81: /**
82: If the row has moved, reset the record handle that the undo should be applied on.
83:
84: @param rh the RecordHandle that represents the row's new location
85: */
86: public void resetRecordHandle(RecordHandle rh);
87: }
|