Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tsfile-model-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.
#

name: TSFile Model Compatibility Tests
name: TsFile Model Compatibility Tests

on:
push:
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# TSFile Viewer
# TsFile Viewer

A web-based application for viewing and analyzing Apache TsFile format data. Built with Vue 3 and Spring Boot 4.

[中文文档](README.zh-CN.md) | [English](README.md)

## Features

- **File Management**: Browse server directories and upload TSFile files
- **Metadata Viewing**: Display comprehensive TSFile metadata including schema, devices, measurements, and statistics
- **File Management**: Browse server directories and upload TsFile files
- **Metadata Viewing**: Display comprehensive TsFile metadata including schema, devices, measurements, and statistics
- **Data Preview**: Paginated data tables with advanced filtering (time range, devices, measurements, value range)
- **Data Visualization**: Interactive charts using ECharts 6 with multi-series overlay, aggregation, and drill-down
- **Tree & Table Models**: Support for both Tree Model (path-based) and Table Model (relational) TSFile formats
- **Tree & Table Models**: Support for both Tree Model (path-based) and Table Model (relational) TsFile formats
- **Export**: Export filtered data as CSV or JSON, export charts as PNG or SVG
- **Performance**: Chunk-level reading, metadata caching, automatic downsampling for large datasets
- **Deployment Flexibility**: Support for both embedded (single JAR) and separate (frontend + backend) deployment
Expand All @@ -20,7 +20,7 @@ A web-based application for viewing and analyzing Apache TsFile format data. Bui
### Backend

- Spring Boot 4.0.1 with JDK 21
- Apache TSFile 2.2.0
- Apache TsFile 2.2.0
- Caffeine cache for metadata and reader caching
- Maven 3.9+

Expand Down Expand Up @@ -139,7 +139,7 @@ tsfile-viewer/
│ │ └── com/timecho/tsfile/viewer/
│ │ ├── controller/ # REST API endpoints
│ │ ├── service/ # Business logic
│ │ ├── tsfile/ # TSFile parsing utilities
│ │ ├── tsfile/ # TsFile parsing utilities
│ │ ├── config/ # Spring configuration
│ │ └── dto/ # Data transfer objects
│ └── pom.xml
Expand All @@ -151,7 +151,7 @@ tsfile-viewer/
│ │ ├── api/ # API client
│ │ └── composables/ # Vue composables
│ └── package.json
├── tsfile-source/ # TSFile v2.2.0 source (reference)
├── tsfile-source/ # TsFile v2.2.0 source (reference)
├── build-embedded.sh # Embedded deployment build script
├── build-separate.sh # Separate deployment build script
├── docs/ # Project documentation
Expand All @@ -166,7 +166,7 @@ tsfile-viewer/
### 1. File Selection

- Browse server directories using the file tree
- Upload local TSFile files (drag-drop or click to browse)
- Upload local TsFile files (drag-drop or click to browse)
- Access recently viewed files from the recent files list

### 2. Metadata Viewing
Expand All @@ -193,7 +193,7 @@ tsfile-viewer/
## API Endpoints

- `GET /api/files/tree` - Browse file tree
- `POST /api/files/upload` - Upload TSFile
- `POST /api/files/upload` - Upload TsFile
- `GET /api/meta/{fileId}` - Get metadata
- `POST /api/data/preview` - Preview data with filters
- `POST /api/data/query` - Query chart data with aggregation
Expand Down Expand Up @@ -253,7 +253,7 @@ pnpm type-check

131 tests covering:

- TSFile parsing utilities
- TsFile parsing utilities
- Data reading and filtering
- Cache behavior
- REST API endpoints
Expand Down
20 changes: 10 additions & 10 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# TSFile 查看器
# TsFile 查看器

一个基于 Web 的应用程序,用于查看和分析 Apache TsFile 格式数据。使用 Vue 3 和 Spring Boot 4 构建。

## 功能特性

- **文件管理**:浏览服务器目录和上传 TSFile 文件
- **元数据查看**:显示完整的 TSFile 元数据,包括模式、设备、测点和统计信息
- **文件管理**:浏览服务器目录和上传 TsFile 文件
- **元数据查看**:显示完整的 TsFile 元数据,包括模式、设备、测点和统计信息
- **数据预览**:支持高级筛选的分页数据表(时间范围、设备、测点、数值范围)
- **数据可视化**:使用 ECharts 6 的交互式图表,支持多序列叠加、聚合和钻取
- **树模型和表模型**:支持基于路径的树模型和关系型表模型两种 TSFile 格式
- **树模型和表模型**:支持基于路径的树模型和关系型表模型两种 TsFile 格式
- **导出功能**:将筛选后的数据导出为 CSV 或 JSON,将图表导出为 PNG 或 SVG
- **性能优化**:块级读取、元数据缓存、大数据集自动降采样
- **部署灵活性**:支持嵌入式(单个 JAR)和分离式(前端 + 后端)两种部署方式
Expand All @@ -18,7 +18,7 @@
### 后端

- Spring Boot 4.0.1 with JDK 21
- Apache TSFile 2.2.0
- Apache TsFile 2.2.0
- Caffeine 缓存用于元数据和读取器缓存
- Maven 3.9+

Expand Down Expand Up @@ -138,7 +138,7 @@ tsfile-viewer/
│ │ └── com/timecho/tsfile/viewer/
│ │ ├── controller/ # REST API 端点
│ │ ├── service/ # 业务逻辑
│ │ ├── tsfile/ # TSFile 解析工具
│ │ ├── tsfile/ # TsFile 解析工具
│ │ ├── config/ # Spring 配置
│ │ └── dto/ # 数据传输对象
│ └── pom.xml
Expand All @@ -151,7 +151,7 @@ tsfile-viewer/
│ │ ├── i18n/ # 国际化配置
│ │ └── composables/ # Vue 组合式函数
│ └── package.json
├── tsfile-source/ # TSFile v2.2.0 源码(参考)
├── tsfile-source/ # TsFile v2.2.0 源码(参考)
├── build-embedded.sh # 嵌入式部署构建脚本
├── build-separate.sh # 分离式部署构建脚本
├── docs/ # 项目文档
Expand All @@ -166,7 +166,7 @@ tsfile-viewer/
### 1. 文件选择

- 使用文件树浏览服务器目录
- 上传本地 TSFile 文件(拖放或点击浏览)
- 上传本地 TsFile 文件(拖放或点击浏览)
- 从最近访问列表快速访问文件

### 2. 元数据查看
Expand All @@ -193,7 +193,7 @@ tsfile-viewer/
## API 端点

- `GET /api/files/tree` - 浏览文件树
- `POST /api/files/upload` - 上传 TSFile
- `POST /api/files/upload` - 上传 TsFile
- `GET /api/meta/{fileId}` - 获取元数据
- `POST /api/data/preview` - 使用筛选条件预览数据
- `POST /api/data/query` - 使用聚合查询图表数据
Expand Down Expand Up @@ -253,7 +253,7 @@ pnpm type-check

131 个测试覆盖:

- TSFile 解析工具
- TsFile 解析工具
- 数据读取和筛选
- 缓存行为
- REST API 端点
Expand Down
4 changes: 2 additions & 2 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<groupId>org.apache.tsfile</groupId>
<artifactId>tsfile-viewer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>TSFile Viewer</name>
<name>TsFile Viewer</name>
<description>Web-based application for viewing and analyzing Apache TsFile format data</description>

<properties>
Expand Down Expand Up @@ -69,7 +69,7 @@
<optional>true</optional>
</dependency>

<!-- TSFile Parser -->
<!-- TsFile Parser -->
<dependency>
<groupId>org.apache.tsfile</groupId>
<artifactId>tsfile</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;

/**
* Main application class for TSFile Viewer.
* Main application class for TsFile Viewer.
*
* <p>TSFile Viewer is a web-based application for viewing and analyzing Apache TsFile format data
* <p>TsFile Viewer is a web-based application for viewing and analyzing Apache TsFile format data
* through an interactive web interface.
*/
@SpringBootApplication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
* Configuration properties for TSFile Viewer.
* Configuration properties for TsFile Viewer.
*
* <p>Binds to the {@code tsfile} prefix in application.yml and provides configuration for:
*
Expand All @@ -44,7 +44,7 @@ public class TsFileProperties {
/** List of allowed directories for file access. Paths outside this whitelist are rejected. */
private List<String> allowedDirectories = new ArrayList<>();

/** Directory where uploaded TSFile files are stored. */
/** Directory where uploaded TsFile files are stored. */
private String uploadDirectory;

/** Cache configuration settings. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

/**
* Spring configuration classes for TSFile Viewer.
* Spring configuration classes for TsFile Viewer.
*
* <p>This package contains configuration classes for upload settings, directory whitelist, cache
* configuration, and other Spring Boot settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public DataController(DataService dataService) {
}

/**
* Previews data from a TSFile with filtering and pagination.
* Previews data from a TsFile with filtering and pagination.
*
* @param request the data preview request
* @return DataPreviewResponse with paginated data
Expand All @@ -81,7 +81,7 @@ public ResponseEntity<DataPreviewResponse> previewData(
}

/**
* Queries chart data from a TSFile with optional aggregation.
* Queries chart data from a TsFile with optional aggregation.
*
* @param request the chart data request
* @return ChartDataResponse with series data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
*
* <ul>
* <li>GET /api/files/tree - Browse directory tree with lazy loading
* <li>POST /api/files/upload - Upload TSFile files
* <li>POST /api/files/upload - Upload TsFile files
* </ul>
*
* <p>Validates: Requirement 8.1, 8.2 (File API endpoints)
Expand Down Expand Up @@ -97,12 +97,12 @@ public ResponseEntity<TreeNode> getFileTree(
}

/**
* Uploads a TSFile.
* Uploads a TsFile.
*
* <p>Validates the file extension (.tsfile) and stores the file in the configured upload
* directory. Returns a unique fileId that can be used to access the file.
*
* @param file the TSFile to upload
* @param file the TsFile to upload
* @return UploadResponse with fileId and metadata
*/
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
import jakarta.servlet.http.HttpServletRequest;

/**
* Global exception handler for the TSFile Viewer application.
* Global exception handler for the TsFile Viewer application.
*
* <p>Provides consistent error responses across all REST endpoints using {@link ErrorResponse} DTO.
* Handles both application-specific exceptions and common Spring exceptions.
Expand Down Expand Up @@ -149,7 +149,7 @@ public ResponseEntity<ErrorResponse> handleInvalidFileException(
/**
* Handles EmptyFileException - returns 400 Bad Request.
*
* <p>This exception is thrown when a TSFile is valid but contains no data. Returns a friendly
* <p>This exception is thrown when a TsFile is valid but contains no data. Returns a friendly
* error message to help users understand the issue.
*/
@ExceptionHandler(EmptyFileException.class)
Expand All @@ -171,16 +171,16 @@ public ResponseEntity<ErrorResponse> handleEmptyFileException(
/**
* Handles NotCompatibleTsFileException - returns 400 Bad Request.
*
* <p>This exception is thrown when a TSFile format is incompatible or corrupted. Returns a
* <p>This exception is thrown when a TsFile format is incompatible or corrupted. Returns a
* friendly error message to help users understand the issue.
*/
@ExceptionHandler(NotCompatibleTsFileException.class)
public ResponseEntity<ErrorResponse> handleNotCompatibleTsFileException(
NotCompatibleTsFileException ex, HttpServletRequest request) {
logger.warn("Incompatible TSFile format: {}", ex.getMessage());
logger.warn("Incompatible TsFile format: {}", ex.getMessage());

String friendlyMessage =
"The file format is incompatible or corrupted. Please ensure it is a valid TSFile created with a compatible version.";
"The file format is incompatible or corrupted. Please ensure it is a valid TsFile created with a compatible version.";

ErrorResponse response =
ErrorResponse.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import org.apache.tsfile.viewer.dto.TSFileMetadataDTO;
import org.apache.tsfile.viewer.dto.TsFileMetadataDTO;
import org.apache.tsfile.viewer.exception.AccessDeniedException;
import org.apache.tsfile.viewer.exception.TsFileNotFoundException;
import org.apache.tsfile.viewer.service.MetadataService;

/**
* REST controller for TSFile metadata operations.
* REST controller for TsFile metadata operations.
*
* <p>Provides endpoints for:
*
* <ul>
* <li>GET /api/meta/{fileId} - Get complete TSFile metadata
* <li>GET /api/meta/{fileId} - Get complete TsFile metadata
* </ul>
*
* <p>Validates: Requirement 8.3 (Metadata endpoint)
Expand All @@ -58,20 +58,20 @@ public MetadataController(MetadataService metadataService) {
}

/**
* Gets complete metadata for a TSFile.
* Gets complete metadata for a TsFile.
*
* <p>Returns metadata including version, time range, device/measurement counts, and detailed
* lists of measurements, RowGroups, and Chunks.
*
* @param fileId the file identifier
* @return TSFileMetadataDTO with complete metadata
* @return TsFileMetadataDTO with complete metadata
*/
@GetMapping("/{fileId}")
public ResponseEntity<TSFileMetadataDTO> getMetadata(@PathVariable String fileId)
public ResponseEntity<TsFileMetadataDTO> getMetadata(@PathVariable String fileId)
throws TsFileNotFoundException, AccessDeniedException, IOException {
logger.debug("Getting metadata for fileId={}", fileId);

TSFileMetadataDTO metadata = metadataService.getMetadata(fileId);
TsFileMetadataDTO metadata = metadataService.getMetadata(fileId);
return ResponseEntity.ok(metadata);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import jakarta.validation.Valid;

/**
* REST controller for TSFile scan operations.
* REST controller for TsFile scan operations.
*
* <p>Provides endpoints for:
*
Expand Down Expand Up @@ -105,7 +105,7 @@ public ResponseEntity<Map<String, Object>> startDirectoryScan(
}

/**
* Performs a synchronous health check on a single TSFile.
* Performs a synchronous health check on a single TsFile.
*
* <p>Validates the file path and runs a full health check, returning the result immediately.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
* <p>Provides endpoints for:
*
* <ul>
* <li>GET /api/tables/{fileId} - Get list of tables in a TSFile
* <li>GET /api/tables/{fileId}/devices - Get list of devices in a TSFile
* <li>GET /api/tables/{fileId} - Get list of tables in a TsFile
* <li>GET /api/tables/{fileId}/devices - Get list of devices in a TsFile
* <li>POST /api/tables/query - Query data from a specific table
* </ul>
*
* <p>These endpoints support multi-table TSFile scenarios where a single file may contain multiple
* <p>These endpoints support multi-table TsFile scenarios where a single file may contain multiple
* tables with different schemas and devices.
*/
@RestController
Expand All @@ -69,7 +69,7 @@ public TableController(TableService tableService) {
}

/**
* Gets a list of all tables in the specified TSFile.
* Gets a list of all tables in the specified TsFile.
*
* <p>Returns table names, column information (including TAG and FIELD columns), and row counts
* for each table.
Expand All @@ -87,7 +87,7 @@ public ResponseEntity<TableListResponse> getTableList(@PathVariable String fileI
}

/**
* Gets a list of all unique devices in the specified TSFile.
* Gets a list of all unique devices in the specified TsFile.
*
* <p>Returns device identifiers, associated table names, TAG values, and data point counts.
* Optionally filter by table name.
Expand Down
Loading