Skip to content

Commit

Permalink
0002291: Manage > Nodes screen can be inconsistent across multiple in…
Browse files Browse the repository at this point in the history
…stances of a cluster.
  • Loading branch information
chenson42 committed May 6, 2015
1 parent 80e3a09 commit 7d42b34
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
Expand Up @@ -33,6 +33,8 @@
* This service provides an API to access to the incoming batch table.
*/
public interface IIncomingBatchService {

public List<String> getNodesInError();

public int countIncomingBatchesInError();

Expand Down
Expand Up @@ -34,6 +34,8 @@
* This service provides an API to access to the outgoing batch table.
*/
public interface IOutgoingBatchService {

public List<String> getNodesInError();

public void markAllAsSentForNode(String nodeId, boolean includeConfigChannel);

Expand Down
Expand Up @@ -33,6 +33,7 @@
import org.jumpmind.db.sql.Row;
import org.jumpmind.db.sql.UniqueKeyException;
import org.jumpmind.db.sql.mapper.DateMapper;
import org.jumpmind.db.sql.mapper.StringMapper;
import org.jumpmind.symmetric.common.ParameterConstants;
import org.jumpmind.symmetric.db.ISymmetricDialect;
import org.jumpmind.symmetric.model.BatchId;
Expand All @@ -50,6 +51,11 @@ public class IncomingBatchService extends AbstractService implements IIncomingBa

protected IClusterService clusterService;

@Override
public List<String> getNodesInError() {
return sqlTemplate.query(getSql("selectNodesInErrorSql"), new StringMapper());
}

public IncomingBatchService(IParameterService parameterService,
ISymmetricDialect symmetricDialect, IClusterService clusterService) {
super(parameterService, symmetricDialect);
Expand Down
Expand Up @@ -30,6 +30,8 @@ public IncomingBatchServiceSqlMap(IDatabasePlatform platform, Map<String, String
super(platform, replacementTokens);

// @formatter:off

putSql("selectNodesInErrorSql", "select distinct node_id from $(incoming_batch) where error_flag=1");

putSql("selectIncomingBatchPrefixSql" ,"" +
"select batch_id, node_id, channel_id, status, network_millis, filter_millis, database_millis, failed_row_number, failed_line_number, byte_count, " +
Expand Down
Expand Up @@ -459,6 +459,10 @@ public OutgoingBatches getOutgoingBatchErrors(int maxRows) {
return batches;
}

public List<String> getNodesInError() {
return sqlTemplate.query(getSql("selectNodesInErrorSql"), new StringMapper());
}

public List<OutgoingBatch> getNextOutgoingBatchForEachNode() {
return sqlTemplate.query(
getSql("getNextOutgoingBatchForEachNodeSql"),
Expand Down
Expand Up @@ -29,6 +29,8 @@ public class OutgoingBatchServiceSqlMap extends AbstractSqlMap {
public OutgoingBatchServiceSqlMap(IDatabasePlatform platform,
Map<String, String> replacementTokens) {
super(platform, replacementTokens);

putSql("selectNodesInErrorSql", "select distinct node_id from $(outgoing_batch) where error_flag=1");

putSql("initialLoadStatusSql", ""
+ "select status from $(outgoing_batch) where node_id=? and load_flag=? ");
Expand Down

0 comments on commit 7d42b34

Please sign in to comment.