mirror of
https://github.com/apache/sqoop.git
synced 2025-05-06 21:53:44 +08:00
SQOOP-1044: Sqoop2: Improve logging in metadata upgrade methods
(Jarek Jarcec Cecho via Kate Ting)
This commit is contained in:
parent
344fa01636
commit
b3ebfdda61
@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.sqoop.repository;
|
package org.apache.sqoop.repository;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.sqoop.common.SqoopException;
|
import org.apache.sqoop.common.SqoopException;
|
||||||
import org.apache.sqoop.connector.ConnectorManager;
|
import org.apache.sqoop.connector.ConnectorManager;
|
||||||
import org.apache.sqoop.connector.spi.MetadataUpgrader;
|
import org.apache.sqoop.connector.spi.MetadataUpgrader;
|
||||||
@ -49,6 +50,8 @@
|
|||||||
*/
|
*/
|
||||||
public abstract class Repository {
|
public abstract class Repository {
|
||||||
|
|
||||||
|
private static final Logger LOG = Logger.getLogger(Repository.class);
|
||||||
|
|
||||||
public abstract RepositoryTransaction getTransaction();
|
public abstract RepositoryTransaction getTransaction();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -321,8 +324,8 @@ private void deleteConnectionsAndJobs(List<MConnection> connections,
|
|||||||
* @param newConnector New properties for the Connector that should be
|
* @param newConnector New properties for the Connector that should be
|
||||||
* upgraded.
|
* upgraded.
|
||||||
*/
|
*/
|
||||||
public final void upgradeConnector(MConnector oldConnector,
|
public final void upgradeConnector(MConnector oldConnector, MConnector newConnector) {
|
||||||
MConnector newConnector) {
|
LOG.info("Upgrading metadata for connector: " + oldConnector.getUniqueName());
|
||||||
long connectorID = oldConnector.getPersistenceId();
|
long connectorID = oldConnector.getPersistenceId();
|
||||||
newConnector.setPersistenceId(connectorID);
|
newConnector.setPersistenceId(connectorID);
|
||||||
/* Algorithms:
|
/* Algorithms:
|
||||||
@ -388,10 +391,12 @@ public final void upgradeConnector(MConnector oldConnector,
|
|||||||
if(tx != null) {
|
if(tx != null) {
|
||||||
tx.close();
|
tx.close();
|
||||||
}
|
}
|
||||||
|
LOG.info("Metadata upgrade finished for connector: " + oldConnector.getUniqueName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void upgradeFramework(MFramework framework) {
|
public final void upgradeFramework(MFramework framework) {
|
||||||
|
LOG.info("Upgrading framework metadata");
|
||||||
RepositoryTransaction tx = null;
|
RepositoryTransaction tx = null;
|
||||||
try {
|
try {
|
||||||
MetadataUpgrader upgrader = FrameworkManager.getInstance()
|
MetadataUpgrader upgrader = FrameworkManager.getInstance()
|
||||||
@ -441,6 +446,7 @@ public final void upgradeFramework(MFramework framework) {
|
|||||||
if(tx != null) {
|
if(tx != null) {
|
||||||
tx.close();
|
tx.close();
|
||||||
}
|
}
|
||||||
|
LOG.info("Framework metadata upgrade finished");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user