My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/**
* Tungsten Scale-Out Stack
* Copyright (C) 2007-2011 Continuent Inc.
* Contact: tungsten@continuent.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* Initial developer(s): Teemu Ollakka
* Contributor(s): Robert Hodges, Stephane Giron
*/

package com.continuent.tungsten.replicator.applier;

import com.continuent.tungsten.replicator.ReplicatorException;
import com.continuent.tungsten.replicator.consistency.ConsistencyException;
import com.continuent.tungsten.replicator.event.DBMSEvent;
import com.continuent.tungsten.replicator.event.ReplDBMSHeader;
import com.continuent.tungsten.replicator.plugin.ReplicatorPlugin;

/**
* Denotes an applier, which is responsible for applying raw DBMS events to a
* database or other replication target. Appliers must be prepared to be
* interrupted, which mechanism is used to cancel processing.
*
* @author <a href="mailto:teemu.ollakka@continuent.com">Teemu Ollakka</a>
* @version 1.0
*/
public interface RawApplier extends ReplicatorPlugin
{
/**
* Sets the ID of the task using this raw applier.
*
* @param id Task ID
*/
public void setTaskId(int id);

/**
* Apply the proffered event to the replication target.
*
* @param event Event to be applied
* @param header Header data corresponding to event
* @param doCommit Boolean flag indicating whether this is the last part of
* multi-part event
* @param doRollback Boolean flag indicating whether this transaction should
* rollback
* @throws ReplicatorException Thrown if applier processing fails
* @throws ConsistencyException Thrown if the applier detects that a
* consistency check has failed
* @throws InterruptedException Thrown if the applier is interrupted
*/
public void apply(DBMSEvent event, ReplDBMSHeader header, boolean doCommit,
boolean doRollback) throws ReplicatorException,
ConsistencyException, InterruptedException;

/**
* Commits current open transaction to ensure data applied up to current
* point are durable.
*
* @throws ReplicatorException Thrown if applier processing fails
* @throws InterruptedException Thrown if the applier is interrupted
*/
public void commit() throws ReplicatorException, InterruptedException;

/**
* Rolls back any current work.
*
* @throws InterruptedException Thrown if the applier is interrupted.
*/
public void rollback() throws InterruptedException;

/**
* Return header information corresponding to last committed event.
*
* @return Header data for last committed event.
* @throws ReplicatorException Thrown if getting sequence number fails
* @throws InterruptedException Thrown if the applier is interrupted
*/
public ReplDBMSHeader getLastEvent() throws ReplicatorException,
InterruptedException;
}

Change log

r353 by stephane...@continuent.com on Jul 29, 2011   Diff
Related to  issue #153 
Throwing ReplicatorException instead of
ApplierException
Go to: 
Project members, sign in to write a code review

Older revisions

r236 by stephane...@continuent.com on Jun 21, 2011   Diff
Fixes issue #39 and  issue #127 
- Now handling rollback correctly by :
        committing before fragmented
transactions
        committing before a
...
r1 by gilles.rayrat on Mar 17, 2011   Diff
Initial import
All revisions of this file

File info

Size: 3558 bytes, 91 lines
Powered by Google Project Hosting