forked from alibaba/DataX
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
intend to remove BasicTISSinkFactory.DTOSinkFunc
- Loading branch information
1 parent
bb79c34
commit fe30cb3
Showing
4 changed files
with
86 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
import com.alibaba.datax.common.util.Configuration; | ||
import com.qlangtech.tis.plugin.ds.DataType; | ||
import com.qlangtech.tis.plugin.ds.IColMetaGetter; | ||
|
||
import java.io.Serializable; | ||
import java.util.ArrayList; | ||
|
@@ -12,7 +13,7 @@ | |
* @author: 百岁([email protected]) | ||
* @create: 2022-02-18 15:47 | ||
**/ | ||
public class HdfsColMeta implements Serializable { | ||
public class HdfsColMeta implements Serializable, IColMetaGetter { | ||
|
||
public static final String KEY_COLUMN = "column"; | ||
public static final String KEY_NAME = "name"; | ||
|
@@ -50,6 +51,16 @@ public HdfsColMeta(String colName, Boolean nullable, Boolean pk, DataType dataTy | |
this.pk = pk; | ||
} | ||
|
||
@Override | ||
public boolean isPk() { | ||
return this.pk; | ||
} | ||
|
||
@Override | ||
public DataType getType() { | ||
return this.type; | ||
} | ||
|
||
public String getName() { | ||
return this.colName; | ||
} | ||
|
34 changes: 34 additions & 0 deletions
34
datax-config/src/main/java/com/qlangtech/tis/plugin/ds/ColMeta.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.qlangtech.tis.plugin.ds; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @author: 百岁([email protected]) | ||
* @create: 2022-08-25 17:45 | ||
**/ | ||
public class ColMeta implements IColMetaGetter, Serializable { | ||
public final String name; | ||
public final DataType type; | ||
public final boolean pk; | ||
|
||
public ColMeta(String name, DataType type, boolean pk) { | ||
this.name = name; | ||
this.type = type; | ||
this.pk = pk; | ||
} | ||
|
||
@Override | ||
public boolean isPk() { | ||
return this.pk; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public DataType getType() { | ||
return type; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
datax-config/src/main/java/com/qlangtech/tis/plugin/ds/IColMetaGetter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.qlangtech.tis.plugin.ds; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* @author: 百岁([email protected]) | ||
* @create: 2022-08-25 21:05 | ||
**/ | ||
public interface IColMetaGetter { | ||
|
||
public static IColMetaGetter create(String name, DataType type) { | ||
return create(name, type, false); | ||
} | ||
|
||
public static IColMetaGetter create(String name, DataType type, boolean pk) { | ||
return new ColMeta(name, type, pk); | ||
} | ||
|
||
public String getName(); | ||
|
||
public DataType getType(); | ||
|
||
public boolean isPk(); | ||
|
||
|
||
} |