Project

General

Profile

« Previous | Next » 

Revision 7337

added logging debug statements to see where the replication timeout might be occurring.

View differences:

src/edu/ucsb/nceas/metacat/replication/ReplicationService.java
119 119
	private static int CLIENTTIMEOUT = 30000;
120 120

  
121 121
	public static final String REPLICATION_LOG_FILE_NAME = "metacatreplication.log";
122

  
123
	private static Object DATA_FILE_FLAG = null;
122 124
	public static String METACAT_REPL_ERROR_MSG = null;
123 125
	private static Logger logReplication = Logger.getLogger("ReplicationLogging");
124 126
	private static Logger logMetacat = Logger.getLogger(ReplicationService.class);
......
133 135
			// just use default
134 136
			logReplication.warn("No custom client timeout specified in configuration, using default." + e.getMessage());
135 137
		}
138
		try {
139
			DATA_FILE_FLAG = PropertyService.getProperty("replication.datafileflag");
140
		} catch (PropertyNotFoundException e) {
141
			logReplication.error("No 'replication.datafileflag' specified in configuration." + e.getMessage());
142
		}
143

  
136 144
	}
137 145
	
138 146
	private ReplicationService() throws ServiceException {
......
1462 1470
							doclist.append("</docid><rev>").append(rs.getInt(2));
1463 1471
							doclist.append("</rev>");
1464 1472
							doclist.append("<datafile>");
1465
							doclist.append(PropertyService
1466
									.getProperty("replication.datafileflag"));
1473
							doclist.append(DATA_FILE_FLAG);
1467 1474
							doclist.append("</datafile>");
1468 1475
							doclist.append("</updatedDocument>");
1469 1476
						}//else
......
1614 1621
		pstmt.execute();
1615 1622
		ResultSet rs = pstmt.getResultSet();
1616 1623
		boolean tablehasrows = rs.next();
1624
		logReplication.warn("Processing replication revision for documents");
1617 1625
		while (tablehasrows) {
1618 1626
			String recordDoctype = rs.getString(3);
1619 1627

  
......
1622 1630
				// do nothing
1623 1631
				continue;
1624 1632
			} else {
1633
				String docid = rs.getString(1);
1634
				int rev = rs.getInt(2);
1635
				logMetacat.debug("Processing replication revision for docid: " + docid + "." + rev);
1625 1636

  
1626 1637
				revDocList.append("<revisionDocument>");
1627
				revDocList.append("<docid>").append(rs.getString(1));
1628
				revDocList.append("</docid><rev>").append(rs.getInt(2));
1638
				revDocList.append("<docid>").append(docid);
1639
				revDocList.append("</docid><rev>").append(rev);
1629 1640
				revDocList.append("</rev>");
1630 1641
				// data file
1631 1642
				if (recordDoctype.equals("BIN")) {
1632 1643
					revDocList.append("<datafile>");
1633
					revDocList.append(PropertyService
1634
							.getProperty("replication.datafileflag"));
1644
					revDocList.append(DATA_FILE_FLAG);
1635 1645
					revDocList.append("</datafile>");
1636 1646
				}
1637 1647
				revDocList.append("</revisionDocument>");

Also available in: Unified diff