|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.filter.OptimizeUpdatesFilter
public class OptimizeUpdatesFilter
Removes "SET key1=value1" parts of an UPDATE if the values updated are the
same as current values in the key part. Eg.:
Original statement:
- SQL(0) =
- ACTION = UPDATE
- TABLE = c
- ROW# = 0
- COL(1: null) = 1
- COL(2: null) = 100
- COL(3: null) = Ten
- KEY(1: null) = 1
- KEY(2: null) = 10
- KEY(3: null) = Ten
Transformed statement:
- SQL(0) =
- ACTION = UPDATE
- TABLE = c
- ROW# = 0
- COL(2: null) = 100
- KEY(1: null) = 1
- KEY(2: null) = 10
- KEY(3: null) = Ten
NOTE: if all columns are static (Issue 355), all are left intact (not
removed). In this corner case, we can't remove the event completely, because
if there are triggers (eg. which count UPDATEs), they would not fire. Hence,
instead, we leave the event unchanged and unoptimized.
| Constructor Summary | |
|---|---|
OptimizeUpdatesFilter()
|
|
| Method Summary | |
|---|---|
void |
configure(PluginContext context)
Complete plug-in configuration. |
ReplDBMSEvent |
filter(ReplDBMSEvent event)
Filter the event. |
void |
prepare(PluginContext context)
Prepare plug-in for use. |
void |
release(PluginContext context)
Release all resources used by plug-in. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OptimizeUpdatesFilter()
| Method Detail |
|---|
public void configure(PluginContext context)
throws ReplicatorException
configure in interface ReplicatorPluginReplicatorException - Thrown if configuration is incomplete or
failsReplicatorPlugin.configure(com.continuent.tungsten.replicator.plugin.PluginContext)
public void prepare(PluginContext context)
throws ReplicatorException
prepare in interface ReplicatorPluginReplicatorException - Thrown if resource allocation failsReplicatorPlugin.prepare(com.continuent.tungsten.replicator.plugin.PluginContext)
public void release(PluginContext context)
throws ReplicatorException
release in interface ReplicatorPluginReplicatorException - Thrown if resource deallocation failsReplicatorPlugin.release(com.continuent.tungsten.replicator.plugin.PluginContext)
public ReplDBMSEvent filter(ReplDBMSEvent event)
throws ReplicatorException,
java.lang.InterruptedException
filter in interface Filterevent - An event to be filtered
ReplicatorException - Thrown if there is a processing error
java.lang.InterruptedException - Must be thrown if the filter is interrupted
or the replicator may hangFilter.filter(com.continuent.tungsten.replicator.event.ReplDBMSEvent)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||