-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #490 from Kabimon/dev-1.2.0
Dev-1.2.0-assets+warehourse+model
- Loading branch information
Showing
810 changed files
with
56,821 additions
and
597 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
dss-apps/dss-dataasset-management/data-assets-client/pom.xml
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,58 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>dss-dataasset-management</artifactId> | ||
<groupId>com.webank.wedatasphere.dss</groupId> | ||
<version>1.0.1</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>data-assets-client</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.source>8</maven.compiler.source> | ||
<maven.compiler.target>8</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.linkis</groupId> | ||
<artifactId>linkis-gateway-httpclient-support</artifactId> | ||
<version>${linkis.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<version>1.18.16</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>net.alchim31.maven</groupId> | ||
<artifactId>scala-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
</resource> | ||
</resources> | ||
<finalName>${project.artifactId}-${project.version}</finalName> | ||
</build> | ||
|
||
</project> |
77 changes: 77 additions & 0 deletions
77
.../main/java/com/webank/wedatasphere/dss/data/governance/entity/ClassificationConstant.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,77 @@ | ||
package com.webank.wedatasphere.dss.data.governance.entity; | ||
|
||
|
||
import org.apache.commons.lang.StringUtils; | ||
|
||
import java.util.Optional; | ||
|
||
public enum ClassificationConstant { | ||
/** | ||
* 指标 | ||
*/ | ||
INDICATOR(1, "indicator"), | ||
/** | ||
* 度量 | ||
*/ | ||
MEASURE(2,"measure"), | ||
/** | ||
* 维度 | ||
*/ | ||
DIMENSION(0, "dimension"), | ||
/** | ||
* 主题 | ||
*/ | ||
THEME(3, "theme"), | ||
/** | ||
* 分层 | ||
*/ | ||
LAYER(4, "layer"); | ||
|
||
private int type; | ||
|
||
public static final String SEPARATOR = "_"; | ||
|
||
private String typeCode; | ||
|
||
ClassificationConstant(int type, String typeCode) { | ||
this.type = type; | ||
|
||
this.typeCode = typeCode; | ||
} | ||
|
||
public static boolean isTypeScope(int type) { | ||
return type >= 0 && type < values().length; | ||
} | ||
|
||
public static boolean isTypeScope(String type) { | ||
return getClassificationConstantByTypeCode(type).isPresent(); | ||
} | ||
|
||
public static Optional<ClassificationConstant> getClassificationConstantByTypeCode(String typeCode) { | ||
for (ClassificationConstant c : values()) { | ||
if (StringUtils.equals(c.typeCode,typeCode)) { | ||
return Optional.of(c); | ||
} | ||
} | ||
return Optional.empty(); | ||
} | ||
|
||
public static Optional<ClassificationConstant> getClassificationConstantByType(int type) { | ||
for (ClassificationConstant c : values()) { | ||
if (c.type == type) { | ||
return Optional.of(c); | ||
} | ||
} | ||
return Optional.empty(); | ||
} | ||
|
||
|
||
|
||
public int getType() { | ||
return type; | ||
} | ||
|
||
public String getTypeCode() { | ||
return typeCode; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ent/src/main/java/com/webank/wedatasphere/dss/data/governance/entity/CreateLabelInfo.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,10 @@ | ||
package com.webank.wedatasphere.dss.data.governance.entity; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class CreateLabelInfo { | ||
private String name; | ||
|
||
private String guid; | ||
} |
12 changes: 12 additions & 0 deletions
12
...src/main/java/com/webank/wedatasphere/dss/data/governance/entity/CreateModelTypeInfo.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,12 @@ | ||
package com.webank.wedatasphere.dss.data.governance.entity; | ||
|
||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class CreateModelTypeInfo { | ||
private String name; | ||
|
||
private String guid; | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...ient/src/main/java/com/webank/wedatasphere/dss/data/governance/entity/HiveSimpleInfo.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,23 @@ | ||
package com.webank.wedatasphere.dss.data.governance.entity; | ||
|
||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
|
||
@Data | ||
public class HiveSimpleInfo implements Serializable { | ||
private String guid; | ||
private String name; | ||
private String qualifiedName; | ||
private String createTime; | ||
private String owner; | ||
private String aliases; | ||
private String lastAccessTime; | ||
private String comment; | ||
private List<String> classifications; | ||
private String totalSize; | ||
private String external; | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...ent/src/main/java/com/webank/wedatasphere/dss/data/governance/entity/HiveTblStatsDTO.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,18 @@ | ||
package com.webank.wedatasphere.dss.data.governance.entity; | ||
|
||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class HiveTblStatsDTO { | ||
|
||
private Integer columnCount = 0; | ||
|
||
private Long totalSize = 0L; | ||
|
||
private Integer numFiles = 0; | ||
|
||
private Integer partitionCount = 0; | ||
|
||
private Integer accessCount = 0; | ||
} |
14 changes: 14 additions & 0 deletions
14
...ets-client/src/main/java/com/webank/wedatasphere/dss/data/governance/entity/PartInfo.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,14 @@ | ||
package com.webank.wedatasphere.dss.data.governance.entity; | ||
|
||
import lombok.Data; | ||
|
||
|
||
@Data | ||
public class PartInfo { | ||
private String partName; | ||
private int reordCnt; | ||
private int store; | ||
private String createTime; | ||
private String lastAccessTime; | ||
private int fileCount; | ||
} |
18 changes: 18 additions & 0 deletions
18
...ts-client/src/main/java/com/webank/wedatasphere/dss/data/governance/entity/QueryType.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,18 @@ | ||
package com.webank.wedatasphere.dss.data.governance.entity; | ||
|
||
|
||
public enum QueryType { | ||
PRECISE(1), | ||
FUZZY(0); | ||
private int code; | ||
|
||
QueryType(int code) { | ||
this.code = code; | ||
} | ||
|
||
public int getCode() { | ||
return code; | ||
} | ||
|
||
|
||
} |
9 changes: 9 additions & 0 deletions
9
...ent/src/main/java/com/webank/wedatasphere/dss/data/governance/entity/SearchLabelInfo.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,9 @@ | ||
package com.webank.wedatasphere.dss.data.governance.entity; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class SearchLabelInfo { | ||
private String name; | ||
private String guid; | ||
} |
10 changes: 10 additions & 0 deletions
10
...ent/src/main/java/com/webank/wedatasphere/dss/data/governance/entity/UpdateLabelInfo.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,10 @@ | ||
package com.webank.wedatasphere.dss.data.governance.entity; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class UpdateLabelInfo { | ||
private String name; | ||
|
||
private String guid; | ||
} |
11 changes: 11 additions & 0 deletions
11
...src/main/java/com/webank/wedatasphere/dss/data/governance/entity/UpdateModelTypeInfo.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,11 @@ | ||
package com.webank.wedatasphere.dss.data.governance.entity; | ||
|
||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class UpdateModelTypeInfo { | ||
private String name; | ||
|
||
private String guid; | ||
} |
15 changes: 15 additions & 0 deletions
15
...ent/src/main/scala/com/webank/wedatasphere/dss/data/governance/AbstractRemoteClient.scala
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,15 @@ | ||
package com.webank.wedatasphere.dss.data.governance | ||
|
||
import org.apache.linkis.httpclient.dws.DWSHttpClient | ||
import org.apache.linkis.httpclient.request.Action | ||
import org.apache.linkis.httpclient.response.Result | ||
|
||
abstract class AbstractRemoteClient extends RemoteClient { | ||
protected val dwsHttpClient:DWSHttpClient | ||
|
||
override def execute(action: Action): Result = action match { | ||
case action: Action => dwsHttpClient.execute(action) | ||
} | ||
|
||
override def close(): Unit = dwsHttpClient.close() | ||
} |
47 changes: 47 additions & 0 deletions
47
...t/src/main/scala/com/webank/wedatasphere/dss/data/governance/DataAssetsRemoteClient.scala
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,47 @@ | ||
package com.webank.wedatasphere.dss.data.governance | ||
|
||
|
||
import com.webank.wedatasphere.dss.data.governance.request._ | ||
import com.webank.wedatasphere.dss.data.governance.response._ | ||
|
||
|
||
trait DataAssetsRemoteClient extends RemoteClient { | ||
def searchHiveTbl(action: SearchHiveTblAction): SearchHiveTblResult | ||
|
||
def searchHiveDb(action: SearchHiveDbAction): SearchHiveDbResult | ||
|
||
def getHiveTblPartition(action: GetHiveTblPartitionAction): GetHiveTblPartitionResult | ||
|
||
def getHiveTblBasic(action: GetHiveTblBasicAction): GetHiveTblBasicResult | ||
|
||
def getHiveTblCreate(action: GetHiveTblCreateAction): GetHiveTblCreateResult | ||
|
||
def createModelType(action: CreateModelTypeAction): CreateModelTypeResult | ||
|
||
def bindModelType(action: BindModelTypeAction): BindModelTypeResult | ||
|
||
def updateModelType(action: UpdateModelTypeAction): UpdateModelTypeResult | ||
|
||
def unBindModelType(action: UnBindModelTypeAction): UnBindModelTypeResult | ||
|
||
def createLabel(action: CreateLabelAction): CreateLabelResult | ||
|
||
def updateLabel(action: UpdateLabelAction): UpdateLabelResult | ||
|
||
def deleteLabel(action: DeleteLabelAction): DeleteLabelResult | ||
|
||
def bindLabel(action: BindLabelAction): BindLabelResult | ||
|
||
def unBindLabel(action: UnBindLabelAction): UnBindLabelResult | ||
|
||
def searchLabel(action: SearchLabelAction): SearchLabelResult | ||
|
||
def deleteModelType(action: DeleteModelTypeAction): DeleteModelTypeResult | ||
|
||
def searchHiveTblSize(action: HiveTblSizeAction): HiveTblSizeResult | ||
|
||
def searchHiveTblStats(action: HiveTblStatsAction): HiveTblStatsResult | ||
|
||
def getHiveTblPartInfoByNameResult(action: GetTblPartInfoByNameAction): GetHiveTblPartInfoByNameResult | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
...sets-client/src/main/scala/com/webank/wedatasphere/dss/data/governance/RemoteClient.scala
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,11 @@ | ||
package com.webank.wedatasphere.dss.data.governance | ||
|
||
import org.apache.linkis.httpclient.request.Action | ||
import org.apache.linkis.httpclient.response.Result | ||
import java.io.Closeable | ||
|
||
trait RemoteClient extends Closeable{ | ||
protected def execute(action: Action): Result | ||
|
||
override def close(): Unit | ||
} |
5 changes: 5 additions & 0 deletions
5
.../webank/wedatasphere/dss/data/governance/exception/DataAssetsClientBuilderException.scala
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,5 @@ | ||
package com.webank.wedatasphere.dss.data.governance.exception | ||
|
||
import org.apache.linkis.common.exception.ErrorException | ||
|
||
class DataAssetsClientBuilderException (errorDesc: String) extends ErrorException(23000, errorDesc) |
Oops, something went wrong.