mirror of
https://github.com/apache/sqoop.git
synced 2025-05-10 22:13:07 +08:00
SQOOP-2523: Sqoop2: Findbugs: Fix warning in server module
(Colin Ma via Jarek Jarcec Cecho)
This commit is contained in:
parent
9f076edb02
commit
4014c7fbf3
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
@InterfaceAudience.Private
|
@InterfaceAudience.Private
|
||||||
@InterfaceStability.Unstable
|
@InterfaceStability.Unstable
|
||||||
public class VersionBean implements JsonBean {
|
public class VersionBean implements JsonBean, java.io.Serializable {
|
||||||
|
|
||||||
public static final String BUILD_VERSION = "build-version";
|
public static final String BUILD_VERSION = "build-version";
|
||||||
public static final String SOURCE_REVISION = "source-revision";
|
public static final String SOURCE_REVISION = "source-revision";
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class AuthorizationRequestHandler implements RequestHandler {
|
public class AuthorizationRequestHandler implements RequestHandler {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
/**
|
/**
|
||||||
* enum for representing the actions supported on the authorization
|
* enum for representing the actions supported on the authorization
|
||||||
*/
|
*/
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
import org.apache.sqoop.server.common.ServerError;
|
import org.apache.sqoop.server.common.ServerError;
|
||||||
|
|
||||||
public class ConnectorRequestHandler implements RequestHandler {
|
public class ConnectorRequestHandler implements RequestHandler {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger LOG = Logger.getLogger(ConnectorRequestHandler.class);
|
private static final Logger LOG = Logger.getLogger(ConnectorRequestHandler.class);
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
import org.apache.sqoop.server.common.ServerError;
|
import org.apache.sqoop.server.common.ServerError;
|
||||||
|
|
||||||
public class DriverRequestHandler implements RequestHandler {
|
public class DriverRequestHandler implements RequestHandler {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger LOG =
|
private static final Logger LOG =
|
||||||
Logger.getLogger(DriverRequestHandler.class);
|
Logger.getLogger(DriverRequestHandler.class);
|
||||||
|
@ -38,7 +38,7 @@ public static long getJobIdFromIdentifier(String identifier) {
|
|||||||
jobId = job.getPersistenceId();
|
jobId = job.getPersistenceId();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
jobId = Long.valueOf(identifier);
|
jobId = Long.parseLong(identifier);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
// this means name nor Id existed and we want to throw a user friendly
|
// this means name nor Id existed and we want to throw a user friendly
|
||||||
// message than a number format exception
|
// message than a number format exception
|
||||||
@ -60,7 +60,7 @@ public static long getLinkIdFromIdentifier(String identifier) {
|
|||||||
linkId = link.getPersistenceId();
|
linkId = link.getPersistenceId();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
linkId = Long.valueOf(identifier);
|
linkId = Long.parseLong(identifier);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
// this means name nor Id existed and we want to throw a user friendly
|
// this means name nor Id existed and we want to throw a user friendly
|
||||||
// message than a number format exception
|
// message than a number format exception
|
||||||
@ -79,7 +79,7 @@ public static long getConnectorIdFromIdentifier(String identifier) {
|
|||||||
connectorId = connector.getPersistenceId();
|
connectorId = connector.getPersistenceId();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
connectorId = Long.valueOf(identifier);
|
connectorId = Long.parseLong(identifier);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
// this means name nor Id existed and we want to throw a user friendly
|
// this means name nor Id existed and we want to throw a user friendly
|
||||||
// message than a number format exception
|
// message than a number format exception
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
|
|
||||||
public class JobRequestHandler implements RequestHandler {
|
public class JobRequestHandler implements RequestHandler {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** enum for representing the actions supported on the job resource*/
|
/** enum for representing the actions supported on the job resource*/
|
||||||
enum JobAction {
|
enum JobAction {
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
|
|
||||||
public class LinkRequestHandler implements RequestHandler {
|
public class LinkRequestHandler implements RequestHandler {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger LOG = Logger.getLogger(LinkRequestHandler.class);
|
private static final Logger LOG = Logger.getLogger(LinkRequestHandler.class);
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
import org.apache.sqoop.server.common.ServerError;
|
import org.apache.sqoop.server.common.ServerError;
|
||||||
|
|
||||||
public class SubmissionRequestHandler implements RequestHandler {
|
public class SubmissionRequestHandler implements RequestHandler {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger LOG = Logger.getLogger(SubmissionRequestHandler.class);
|
private static final Logger LOG = Logger.getLogger(SubmissionRequestHandler.class);
|
||||||
|
|
||||||
@ -48,11 +49,10 @@ public JsonBean handleEvent(RequestContext ctx) {
|
|||||||
throw new SqoopException(ServerError.SERVER_0002, "Unsupported HTTP method for connector:"
|
throw new SqoopException(ServerError.SERVER_0002, "Unsupported HTTP method for connector:"
|
||||||
+ ctx.getMethod());
|
+ ctx.getMethod());
|
||||||
}
|
}
|
||||||
String jobIdentifier = ctx.getLastURLElement();
|
|
||||||
// submissions per job are ordered by update time
|
// submissions per job are ordered by update time
|
||||||
// hence the latest submission is on the top
|
// hence the latest submission is on the top
|
||||||
if (ctx.getParameterValue(JOB_NAME_QUERY_PARAM) != null) {
|
if (ctx.getParameterValue(JOB_NAME_QUERY_PARAM) != null) {
|
||||||
jobIdentifier = ctx.getParameterValue(JOB_NAME_QUERY_PARAM);
|
String jobIdentifier = ctx.getParameterValue(JOB_NAME_QUERY_PARAM);
|
||||||
AuditLoggerManager.getInstance().logAuditEvent(ctx.getUserName(),
|
AuditLoggerManager.getInstance().logAuditEvent(ctx.getUserName(),
|
||||||
ctx.getRequest().getRemoteAddr(), "get", "submissionsByJob", jobIdentifier);
|
ctx.getRequest().getRemoteAddr(), "get", "submissionsByJob", jobIdentifier);
|
||||||
long jobId = HandlerUtils.getJobIdFromIdentifier(jobIdentifier);
|
long jobId = HandlerUtils.getJobIdFromIdentifier(jobIdentifier);
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
* Get server version and supported protocol versions.
|
* Get server version and supported protocol versions.
|
||||||
*/
|
*/
|
||||||
public class VersionRequestHandler implements RequestHandler {
|
public class VersionRequestHandler implements RequestHandler {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger LOG =
|
private static final Logger LOG =
|
||||||
Logger.getLogger(VersionRequestHandler.class);
|
Logger.getLogger(VersionRequestHandler.class);
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
import org.apache.sqoop.json.JsonBean;
|
import org.apache.sqoop.json.JsonBean;
|
||||||
|
|
||||||
public interface RequestHandler {
|
public interface RequestHandler extends java.io.Serializable {
|
||||||
|
|
||||||
static final String CONNECTOR_NAME_QUERY_PARAM = "cname";
|
static final String CONNECTOR_NAME_QUERY_PARAM = "cname";
|
||||||
static final String JOB_NAME_QUERY_PARAM = "jname";
|
static final String JOB_NAME_QUERY_PARAM = "jname";
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class SqoopProtocolServlet extends HttpServlet {
|
public class SqoopProtocolServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger LOG =
|
private static final Logger LOG =
|
||||||
Logger.getLogger(SqoopProtocolServlet.class);
|
Logger.getLogger(SqoopProtocolServlet.class);
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class VersionServlet extends SqoopProtocolServlet {
|
public class VersionServlet extends SqoopProtocolServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private RequestHandler versionRequestHandler;
|
private RequestHandler versionRequestHandler;
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class AuthorizationServlet extends SqoopProtocolServlet {
|
public class AuthorizationServlet extends SqoopProtocolServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private RequestHandler authorizationRequestHandler;
|
private RequestHandler authorizationRequestHandler;
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class ConfigurableServlet extends SqoopProtocolServlet {
|
public class ConfigurableServlet extends SqoopProtocolServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private RequestHandler configurableRequestHandler;
|
private RequestHandler configurableRequestHandler;
|
||||||
private static String CONNECTOR_CONFIGURABLE = "connector";
|
private static String CONNECTOR_CONFIGURABLE = "connector";
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class ConnectorServlet extends SqoopProtocolServlet {
|
public class ConnectorServlet extends SqoopProtocolServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private RequestHandler connectorRequestHandler;
|
private RequestHandler connectorRequestHandler;
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class ConnectorsServlet extends SqoopProtocolServlet {
|
public class ConnectorsServlet extends SqoopProtocolServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private RequestHandler connectorRequestHandler;
|
private RequestHandler connectorRequestHandler;
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class DriverServlet extends SqoopProtocolServlet {
|
public class DriverServlet extends SqoopProtocolServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private RequestHandler driverRequestHandler;
|
private RequestHandler driverRequestHandler;
|
||||||
|
|
||||||
public DriverServlet() {
|
public DriverServlet() {
|
||||||
|
@ -74,6 +74,7 @@
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class JobServlet extends SqoopProtocolServlet {
|
public class JobServlet extends SqoopProtocolServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private RequestHandler jobRequestHandler;
|
private RequestHandler jobRequestHandler;
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class JobsServlet extends SqoopProtocolServlet {
|
public class JobsServlet extends SqoopProtocolServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private RequestHandler jobRequestHandler;
|
private RequestHandler jobRequestHandler;
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class LinkServlet extends SqoopProtocolServlet {
|
public class LinkServlet extends SqoopProtocolServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private RequestHandler linkRequestHandler;
|
private RequestHandler linkRequestHandler;
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class LinksServlet extends SqoopProtocolServlet {
|
public class LinksServlet extends SqoopProtocolServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private RequestHandler linkRequestHandler;
|
private RequestHandler linkRequestHandler;
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class SubmissionsServlet extends SqoopProtocolServlet {
|
public class SubmissionsServlet extends SqoopProtocolServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private RequestHandler submissionRequestHandler;
|
private RequestHandler submissionRequestHandler;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user