Skip to content

Commit

Permalink
0003690: Add cluster.staging.enabled to indicate whether a shared
Browse files Browse the repository at this point in the history
staging area is being used. ** Upgrade Alert **
  • Loading branch information
chenson42 committed Aug 24, 2018
1 parent 2fcafce commit df823e2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Expand Up @@ -286,6 +286,7 @@ private ParameterConstants() {

public final static String CLUSTER_SERVER_ID = "cluster.server.id";
public final static String CLUSTER_LOCKING_ENABLED = "cluster.lock.enabled";
public final static String CLUSTER_STAGING_ENABLED = "cluster.staging.enabled";
public final static String CLUSTER_LOCK_TIMEOUT_MS = "cluster.lock.timeout.ms";
public final static String CLUSTER_LOCK_REFRESH_MS = "cluster.lock.refresh.ms";
public final static String LOCK_TIMEOUT_MS = "lock.timeout.ms";
Expand Down
Expand Up @@ -37,7 +37,8 @@ protected Map<String, Long> getBiggestBatchIds(List<BatchId> batches) {
@Override
public long clean(long ttlInMs) {
try {
if (!engine.getClusterService().lock(ClusterConstants.STAGE_MANAGEMENT)) {
boolean clusterStagingEnabled = engine.getParameterService().is(ParameterConstants.CLUSTER_STAGING_ENABLED, false);
if (clusterStagingEnabled && !engine.getClusterService().lock(ClusterConstants.STAGE_MANAGEMENT)) {
log.debug("Could not get a lock to run stage management");
return 0;
}
Expand Down
Expand Up @@ -742,6 +742,14 @@ datareload.batch.insert.transactional=true
# Type: boolean
cluster.lock.enabled=false


# Set this to true if you are sharing your staging directory with multiple instances of SymmetricDS
#
# DatabaseOverridable: true
# Tags: jobs
# Type: boolean
cluster.staging.enabled=false

# Set this if you want to give your server a unique name to be used to identify which server did what action. Typically useful when running in
# a clustered environment. This is currently used by the ClusterService when locking for a node.
#
Expand Down
Expand Up @@ -43,7 +43,7 @@ public class CsvUtils {

public static CsvReader getCsvReader(Reader reader) {
CsvReader csvReader = new CsvReader(reader);
csvReader.setEscapeMode(CsvReader.ESCAPE_MODE_BACKSLASH);
csvReader.setEscapeMode(CsvReader.ESCAPE_MODE_DOUBLED);
csvReader.setSafetySwitch(false);
csvReader.setCaptureRawRecord(false);
return csvReader;
Expand Down

0 comments on commit df823e2

Please sign in to comment.