Skip to content

Commit

Permalink
Merge pull request #490 from Kabimon/dev-1.2.0
Browse files Browse the repository at this point in the history
Dev-1.2.0-assets+warehourse+model
  • Loading branch information
wushengyeyouya authored Mar 3, 2022
2 parents 4c62c74 + aa5322e commit 66a7d38
Show file tree
Hide file tree
Showing 810 changed files with 56,821 additions and 597 deletions.
58 changes: 58 additions & 0 deletions dss-apps/dss-dataasset-management/data-assets-client/pom.xml
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>
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;
}
}
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;
}
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;

}
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;

}
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;
}
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;
}
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;
}


}
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;
}
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;
}
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;
}
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()
}
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

}
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
}
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)
Loading

0 comments on commit 66a7d38

Please sign in to comment.