mirror of
https://github.com/apache/sqoop.git
synced 2025-05-10 21:10:58 +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
|
||||
@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 SOURCE_REVISION = "source-revision";
|
||||
|
@ -40,7 +40,7 @@
|
||||
import java.util.List;
|
||||
|
||||
public class AuthorizationRequestHandler implements RequestHandler {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* enum for representing the actions supported on the authorization
|
||||
*/
|
||||
|
@ -40,6 +40,7 @@
|
||||
import org.apache.sqoop.server.common.ServerError;
|
||||
|
||||
public class ConnectorRequestHandler implements RequestHandler {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(ConnectorRequestHandler.class);
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
import org.apache.sqoop.server.common.ServerError;
|
||||
|
||||
public class DriverRequestHandler implements RequestHandler {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final Logger LOG =
|
||||
Logger.getLogger(DriverRequestHandler.class);
|
||||
|
@ -38,7 +38,7 @@ public static long getJobIdFromIdentifier(String identifier) {
|
||||
jobId = job.getPersistenceId();
|
||||
} else {
|
||||
try {
|
||||
jobId = Long.valueOf(identifier);
|
||||
jobId = Long.parseLong(identifier);
|
||||
} catch (NumberFormatException ex) {
|
||||
// this means name nor Id existed and we want to throw a user friendly
|
||||
// message than a number format exception
|
||||
@ -60,7 +60,7 @@ public static long getLinkIdFromIdentifier(String identifier) {
|
||||
linkId = link.getPersistenceId();
|
||||
} else {
|
||||
try {
|
||||
linkId = Long.valueOf(identifier);
|
||||
linkId = Long.parseLong(identifier);
|
||||
} catch (NumberFormatException ex) {
|
||||
// this means name nor Id existed and we want to throw a user friendly
|
||||
// message than a number format exception
|
||||
@ -79,7 +79,7 @@ public static long getConnectorIdFromIdentifier(String identifier) {
|
||||
connectorId = connector.getPersistenceId();
|
||||
} else {
|
||||
try {
|
||||
connectorId = Long.valueOf(identifier);
|
||||
connectorId = Long.parseLong(identifier);
|
||||
} catch (NumberFormatException ex) {
|
||||
// this means name nor Id existed and we want to throw a user friendly
|
||||
// message than a number format exception
|
||||
|
@ -57,6 +57,7 @@
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class JobRequestHandler implements RequestHandler {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** enum for representing the actions supported on the job resource*/
|
||||
enum JobAction {
|
||||
|
@ -48,6 +48,7 @@
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class LinkRequestHandler implements RequestHandler {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(LinkRequestHandler.class);
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
import org.apache.sqoop.server.common.ServerError;
|
||||
|
||||
public class SubmissionRequestHandler implements RequestHandler {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
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:"
|
||||
+ ctx.getMethod());
|
||||
}
|
||||
String jobIdentifier = ctx.getLastURLElement();
|
||||
// submissions per job are ordered by update time
|
||||
// hence the latest submission is on the top
|
||||
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(),
|
||||
ctx.getRequest().getRemoteAddr(), "get", "submissionsByJob", jobIdentifier);
|
||||
long jobId = HandlerUtils.getJobIdFromIdentifier(jobIdentifier);
|
||||
|
@ -34,6 +34,7 @@
|
||||
* Get server version and supported protocol versions.
|
||||
*/
|
||||
public class VersionRequestHandler implements RequestHandler {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final Logger LOG =
|
||||
Logger.getLogger(VersionRequestHandler.class);
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
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 JOB_NAME_QUERY_PARAM = "jname";
|
||||
|
@ -35,6 +35,7 @@
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class SqoopProtocolServlet extends HttpServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final Logger LOG =
|
||||
Logger.getLogger(SqoopProtocolServlet.class);
|
||||
|
@ -26,6 +26,7 @@
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class VersionServlet extends SqoopProtocolServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RequestHandler versionRequestHandler;
|
||||
|
||||
|
@ -63,6 +63,7 @@
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class AuthorizationServlet extends SqoopProtocolServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RequestHandler authorizationRequestHandler;
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ConfigurableServlet extends SqoopProtocolServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RequestHandler configurableRequestHandler;
|
||||
private static String CONNECTOR_CONFIGURABLE = "connector";
|
||||
|
@ -37,6 +37,7 @@
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ConnectorServlet extends SqoopProtocolServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RequestHandler connectorRequestHandler;
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ConnectorsServlet extends SqoopProtocolServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RequestHandler connectorRequestHandler;
|
||||
|
||||
|
@ -31,6 +31,8 @@
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class DriverServlet extends SqoopProtocolServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RequestHandler driverRequestHandler;
|
||||
|
||||
public DriverServlet() {
|
||||
|
@ -74,6 +74,7 @@
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class JobServlet extends SqoopProtocolServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RequestHandler jobRequestHandler;
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class JobsServlet extends SqoopProtocolServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RequestHandler jobRequestHandler;
|
||||
|
||||
|
@ -55,6 +55,7 @@
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class LinkServlet extends SqoopProtocolServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RequestHandler linkRequestHandler;
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class LinksServlet extends SqoopProtocolServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RequestHandler linkRequestHandler;
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class SubmissionsServlet extends SqoopProtocolServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RequestHandler submissionRequestHandler;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user