-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug: add check file isUploaded, add table for file transport stat…
…us (#631)
- Loading branch information
Showing
37 changed files
with
501 additions
and
209 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
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
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
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
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
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
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
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
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
60 changes: 60 additions & 0 deletions
60
...ernance/src/main/java/com/webank/weevent/governance/entity/FileTransportStatusEntity.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,60 @@ | ||
package com.webank.weevent.governance.entity; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Table; | ||
import javax.persistence.Transient; | ||
import javax.persistence.UniqueConstraint; | ||
|
||
import com.webank.weevent.governance.entity.base.TopicBase; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* FileTransportStatusEntity class. | ||
* | ||
* @author v_wbhwliu | ||
* @version 1.3 | ||
* @since 2020/5/20 | ||
*/ | ||
@Setter | ||
@Getter | ||
@EqualsAndHashCode(callSuper = false) | ||
@Entity | ||
@Table(name = "t_file_transport_status", | ||
uniqueConstraints = {@UniqueConstraint(name = "topicBrokerGroupFileName", | ||
columnNames = {"broker_id", "group_id", "topic_name", "file_name"})}) | ||
public class FileTransportStatusEntity extends TopicBase { | ||
|
||
@Column(name = "file_name", columnDefinition = "varchar(256)") | ||
private String fileName; | ||
|
||
@Column(name = "transport_status", columnDefinition = "varchar(1)") | ||
private String status; | ||
|
||
@Column(name = "file_md5", columnDefinition = "varchar(32)") | ||
private String fileMD5; | ||
|
||
@Column(name = "file_size") | ||
private Long fileSize; | ||
|
||
// cost time in second | ||
@Transient | ||
private String time; | ||
// sender ready chunk | ||
@Transient | ||
private int readyChunk; | ||
// processing | ||
@Transient | ||
private String process; | ||
// speed in Byte/s | ||
@Transient | ||
private String speed; | ||
|
||
// @Transient | ||
// private FileChunksMetaStatus fileChunksMetaStatus; | ||
|
||
|
||
} |
14 changes: 14 additions & 0 deletions
14
...ce/src/main/java/com/webank/weevent/governance/repository/TransportChannelRepository.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.weevent.governance.repository; | ||
|
||
import java.util.List; | ||
|
||
import com.webank.weevent.governance.entity.FileTransportChannelEntity; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface TransportChannelRepository extends JpaRepository<FileTransportChannelEntity, Long> { | ||
|
||
List<FileTransportChannelEntity> queryByBrokerIdAndGroupId(Integer brokerId, String groupId); | ||
} |
14 changes: 0 additions & 14 deletions
14
...overnance/src/main/java/com/webank/weevent/governance/repository/TransportRepository.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
...nce/src/main/java/com/webank/weevent/governance/repository/TransportStatusRepository.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,25 @@ | ||
package com.webank.weevent.governance.repository; | ||
|
||
import java.util.List; | ||
|
||
import com.webank.weevent.governance.entity.FileTransportStatusEntity; | ||
|
||
import org.apache.ibatis.annotations.Param; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Modifying; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.stereotype.Repository; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Repository | ||
public interface TransportStatusRepository extends JpaRepository<FileTransportStatusEntity, Long> { | ||
|
||
List<FileTransportStatusEntity> queryByBrokerIdAndGroupIdAndTopicName(Integer brokerId, String groupId, String topicName); | ||
|
||
FileTransportStatusEntity queryByBrokerIdAndGroupIdAndTopicNameAndFileName(Integer brokerId, String groupId, String topicName, String fileName); | ||
|
||
@Transactional | ||
@Modifying | ||
@Query(value = "update t_file_transport_status set transport_status=:status where id =:id", nativeQuery = true) | ||
void updateTransportStatus(@Param("transport_status") String status, @Param("id") Long id); | ||
} |
Oops, something went wrong.