mirror of
https://github.com/apache/sqoop.git
synced 2025-05-08 03:40:00 +08:00
SQOOP-2710. Sqoop2: Move user from context classes to parent TransferableContext
(Jarcec via Hari)
This commit is contained in:
parent
cde1c3ac9e
commit
e2fc4a75e8
@ -35,13 +35,10 @@ public class DestroyerContext extends TransferableContext {
|
|||||||
|
|
||||||
private Schema schema;
|
private Schema schema;
|
||||||
|
|
||||||
private String user;
|
|
||||||
|
|
||||||
public DestroyerContext(ImmutableContext context, boolean success, Schema schema, String user) {
|
public DestroyerContext(ImmutableContext context, boolean success, Schema schema, String user) {
|
||||||
super(context);
|
super(context, user);
|
||||||
this.success = success;
|
this.success = success;
|
||||||
this.schema = schema;
|
this.schema = schema;
|
||||||
this.user = user;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,12 +59,4 @@ public Schema getSchema() {
|
|||||||
return schema;
|
return schema;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return user associated with this step.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getUser() {
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -36,13 +36,10 @@ public class ExtractorContext extends TransferableContext {
|
|||||||
|
|
||||||
private final Schema schema;
|
private final Schema schema;
|
||||||
|
|
||||||
private final String user;
|
|
||||||
|
|
||||||
public ExtractorContext(ImmutableContext context, DataWriter writer, Schema schema, String user) {
|
public ExtractorContext(ImmutableContext context, DataWriter writer, Schema schema, String user) {
|
||||||
super(context);
|
super(context, user);
|
||||||
this.writer = writer;
|
this.writer = writer;
|
||||||
this.schema = schema;
|
this.schema = schema;
|
||||||
this.user = user;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,13 +58,4 @@ public DataWriter getDataWriter() {
|
|||||||
public Schema getSchema() {
|
public Schema getSchema() {
|
||||||
return schema;
|
return schema;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Return the user
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getUser() {
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,11 +31,8 @@
|
|||||||
@InterfaceStability.Unstable
|
@InterfaceStability.Unstable
|
||||||
public class InitializerContext extends TransferableContext {
|
public class InitializerContext extends TransferableContext {
|
||||||
|
|
||||||
private String user;
|
|
||||||
|
|
||||||
public InitializerContext(MutableContext context, String user) {
|
public InitializerContext(MutableContext context, String user) {
|
||||||
super(context);
|
super(context, user);
|
||||||
this.user = user;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,12 +48,4 @@ public MutableContext getContext() {
|
|||||||
return (MutableContext)super.getContext();
|
return (MutableContext)super.getContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the user
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getUser() {
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -36,13 +36,10 @@ public class LoaderContext extends TransferableContext {
|
|||||||
|
|
||||||
private final Schema schema;
|
private final Schema schema;
|
||||||
|
|
||||||
private final String user;
|
|
||||||
|
|
||||||
public LoaderContext(ImmutableContext context, DataReader reader, Schema schema, String user) {
|
public LoaderContext(ImmutableContext context, DataReader reader, Schema schema, String user) {
|
||||||
super(context);
|
super(context, user);
|
||||||
this.reader = reader;
|
this.reader = reader;
|
||||||
this.schema = schema;
|
this.schema = schema;
|
||||||
this.user = user;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,14 +59,4 @@ public DataReader getDataReader() {
|
|||||||
public Schema getSchema() {
|
public Schema getSchema() {
|
||||||
return schema;
|
return schema;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the String representing the user.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getUser() {
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,13 +37,10 @@ public class PartitionerContext extends TransferableContext {
|
|||||||
|
|
||||||
private boolean skipMaxPartitionCheck = false;
|
private boolean skipMaxPartitionCheck = false;
|
||||||
|
|
||||||
private String user;
|
|
||||||
|
|
||||||
public PartitionerContext(ImmutableContext context, long maxPartitions, Schema schema, String user) {
|
public PartitionerContext(ImmutableContext context, long maxPartitions, Schema schema, String user) {
|
||||||
super(context);
|
super(context, user);
|
||||||
this.maxPartitions = maxPartitions;
|
this.maxPartitions = maxPartitions;
|
||||||
this.schema = schema;
|
this.schema = schema;
|
||||||
this.user = user;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -92,13 +89,4 @@ public boolean getSkipMaxPartitionCheck() {
|
|||||||
public Schema getSchema() {
|
public Schema getSchema() {
|
||||||
return schema;
|
return schema;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return user that submitted job
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getUser() {
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,11 @@ public abstract class TransferableContext {
|
|||||||
|
|
||||||
ImmutableContext context;
|
ImmutableContext context;
|
||||||
|
|
||||||
public TransferableContext(ImmutableContext context) {
|
private String user;
|
||||||
|
|
||||||
|
public TransferableContext(ImmutableContext context, String user) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
|
this.user = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,4 +80,11 @@ public int getInt(String key, int defaultValue) {
|
|||||||
public boolean getBoolean(String key, boolean defaultValue) {
|
public boolean getBoolean(String key, boolean defaultValue) {
|
||||||
return context.getBoolean(key, defaultValue);
|
return context.getBoolean(key, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return user who started this job (e.g. the one who run "start job" in shell)
|
||||||
|
*/
|
||||||
|
public String getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user