Skip to content

Commit

Permalink
dev checkin. fix pom.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Mar 6, 2012
1 parent da6c7db commit 4c33291
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 49 deletions.
2 changes: 1 addition & 1 deletion symmetric/symmetric-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</execution>
</executions>
<configuration>
<outputDirectory>${basedir}\target</outputDirectory>
<outputDirectory>${basedir}/target</outputDirectory>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion symmetric/symmetric-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</execution>
</executions>
<configuration>
<outputDirectory>${basedir}\target</outputDirectory>
<outputDirectory>${basedir}/target</outputDirectory>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@
</table>

<table name="conflict_event" description="Identifies rows that were in conflict and how the conflicts were resolved.">
<column name="batch_id" type="INTEGER" size="50" required="true" primaryKey="true" description="The id of the outgoing_batch that is being loaded." />
<column name="batch_id" type="INTEGER" required="true" primaryKey="true" description="The id of the outgoing_batch that is being loaded." />
<column name="node_id" type="VARCHAR" size="50" required="true" primaryKey="true" description="The node_id of the source of the batch being loaded." />
<column name="failed_row_number" type="BIGINT" required="true" primaryKey="true" description="This is the row number in the batch for the data that was being processed when the batch failed." />
<column name="conflict_id" type="VARCHAR" size="50" required="true" primaryKey="true" description="Unique identifier of a specific conflict resolver." />
Expand Down
2 changes: 1 addition & 1 deletion symmetric/symmetric-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</execution>
</executions>
<configuration>
<outputDirectory>${basedir}\target</outputDirectory>
<outputDirectory>${basedir}/target</outputDirectory>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion symmetric/symmetric-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</execution>
</executions>
<configuration>
<outputDirectory>${basedir}\target</outputDirectory>
<outputDirectory>${basedir}/target</outputDirectory>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,61 +8,68 @@
import org.slf4j.LoggerFactory;

public class DefaultDatabaseWriterConflictResolver implements IDatabaseWriterConflictResolver {

protected Logger log = LoggerFactory.getLogger(getClass());

protected boolean autoRegister;

public void reportConflict(DatabaseWriter writer, DatabaseWriterSettings writerSettings,
CsvData data, ConflictEvent conflictEvent) {

}

public void needsResolved(DatabaseWriter writer, DatabaseWriterSettings writerSettings, CsvData data) {
public void needsResolved(DatabaseWriter writer, DatabaseWriterSettings writerSettings,
CsvData data) {
DataEventType originalEventType = data.getDataEventType();
ConflictSettings conflictSetting = writerSettings.getConflictSettings(writer.getTargetTable(), writer.getBatch());
ConflictSettings conflictSetting = writerSettings.getConflictSettings(
writer.getTargetTable(), writer.getBatch());
switch (originalEventType) {
case INSERT:
switch (conflictSetting.getResolveInsertType()) {
case MANUAL:
throw new ConflictException(data, writer.getTargetTable(), false);
case BLINK_FALLBACK:
performFallbackToUpdate(writer, data);
break;
case NEWER_WINS:
// TODO
throw new NotImplementedException();
case IGNORE:
default:
case INSERT:
switch (conflictSetting.getResolveInsertType()) {
case MANUAL:
throw new ConflictException(data, writer.getTargetTable(), false);
case BLINK_FALLBACK:
performFallbackToUpdate(writer, data);
break;
case NEWER_WINS:
// TODO
throw new NotImplementedException();
case IGNORE:
default:
break;
}
break;
}
break;

case UPDATE:
switch (conflictSetting.getResolveUpdateType()) {
case MANUAL:
throw new ConflictException(data, writer.getTargetTable(), false);
case BLINK_FALLBACK:
performFallbackToInsert(writer, data);
case UPDATE:
switch (conflictSetting.getResolveUpdateType()) {
case MANUAL:
throw new ConflictException(data, writer.getTargetTable(), false);
case BLINK_FALLBACK:
performFallbackToInsert(writer, data);
break;
case NEWER_WINS:
// TODO
throw new NotImplementedException();
case IGNORE:
default:
break;
}
break;
case NEWER_WINS:
// TODO
throw new NotImplementedException();
case IGNORE:
default:

case DELETE:
switch (conflictSetting.getResolveDeleteType()) {
case MANUAL:
throw new ConflictException(data, writer.getTargetTable(), false);
default:
case IGNORE:
writer.getStatistics().get(writer.getBatch())
.increment(DataWriterStatisticConstants.MISSINGDELETECOUNT);
break;
}
break;
}
break;

case DELETE:
switch (conflictSetting.getResolveDeleteType()) {
case MANUAL:
throw new ConflictException(data, writer.getTargetTable(), false);
default:
case IGNORE:
writer.getStatistics().get(writer.getBatch())
.increment(DataWriterStatisticConstants.MISSINGDELETECOUNT);
break;
}
break;

default:
break;
}
}

Expand All @@ -87,5 +94,5 @@ protected void performFallbackToInsert(DatabaseWriter writer, CsvData csvData) {
public void setAutoRegister(boolean autoRegister) {
this.autoRegister = autoRegister;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
public interface IDatabaseWriterConflictResolver extends IExtensionPoint {

public void needsResolved(DatabaseWriter writer, DatabaseWriterSettings writerSettings, CsvData data);

public void reportConflict(DatabaseWriter writer, DatabaseWriterSettings writerSettings, CsvData data, ConflictEvent conflictEvent);

}
2 changes: 1 addition & 1 deletion symmetric/symmetric-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</execution>
</executions>
<configuration>
<outputDirectory>${basedir}\target</outputDirectory>
<outputDirectory>${basedir}/target</outputDirectory>
</configuration>
</plugin>
</plugins>
Expand Down

0 comments on commit 4c33291

Please sign in to comment.