fix: graceful error handling for incompatible TsFile data decoding (#15) When reading TsFile data created by incompatible SDK versions (e.g., Python SDK), the DeltaBinaryDecoder throws BufferUnderflowException. Previously this caused a 500 error with no user-facing explanation. Changes: - Catch BufferUnderflowException and other runtime exceptions in all TsFileDataReader query methods, allowing partial data to be returned - Add warnings field to DataReadResult and DataPreviewResponse to propagate decode error details to the frontend - Display warnings as an Alert in the data preview view when data cannot be fully decoded - Add i18n translations for warning message (en-US and zh-CN)
A web-based application for viewing and analyzing Apache TsFile format data. Built with Vue 3 and Spring Boot 4.
Start Backend:
cd backend mvn spring-boot:run
Backend will run at http://localhost:8080
Start Frontend:
cd frontend
pnpm install
pnpm dev
Frontend will run at http://localhost:5173
Access Application: Open http://localhost:5173/view/ in your browser
# Linux/Mac ./build-embedded.sh # Windows build-embedded.bat # Run java -jar backend/target/tsfile-viewer-*.jar
Access at http://localhost:8080/view/
# Linux/Mac ./build-separate.sh # Windows build-separate.bat
See docs/DEPLOYMENT.md for detailed deployment instructions.
Edit backend/src/main/resources/application.yml:
tsfile: # Whitelist of allowed directories allowed-directories: - /data/tsfiles - /uploads/tsfiles # Upload directory upload-directory: /uploads/tsfiles # Cache settings cache: metadata: max-size: 1000 ttl-minutes: 60 reader: max-size: 100 ttl-minutes: 30
Create frontend/.env.production:
# API base URL (default/recommended for reverse proxy) VITE_API_BASE_URL=/api
tsfile-viewer/ ├── backend/ # Spring Boot Maven project │ ├── src/main/java/ │ │ └── com/timecho/tsfile/viewer/ │ │ ├── controller/ # REST API endpoints │ │ ├── service/ # Business logic │ │ ├── tsfile/ # TSFile parsing utilities │ │ ├── config/ # Spring configuration │ │ └── dto/ # Data transfer objects │ └── pom.xml ├── frontend/ # Vue 3 + Vite SPA │ ├── src/ │ │ ├── views/ # Page components │ │ ├── components/ # Reusable components │ │ ├── stores/ # Pinia state management │ │ ├── api/ # API client │ │ └── composables/ # Vue composables │ └── package.json ├── 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 │ ├── DEPLOYMENT.md # Deployment guide │ ├── API.md # API documentation │ └── ... └── README.md
GET /api/files/tree - Browse file treePOST /api/files/upload - Upload TSFileGET /api/meta/{fileId} - Get metadataPOST /api/data/preview - Preview data with filtersPOST /api/data/query - Query chart data with aggregationSee API documentation at /swagger-ui.html (if enabled)
cd backend # Run tests mvn test # Format code mvn spotless:apply # Check formatting mvn spotless:check # Build mvn clean package
cd frontend # Install dependencies pnpm install # Run dev server pnpm dev # Build for production pnpm build # Run tests pnpm test:unit # Lint pnpm lint # Format pnpm format # Type check pnpm type-check
131 tests covering:
Run: mvn test
Component and integration tests using Vitest + Vue Test Utils
Run: pnpm test:unit
.. and absolute paths outside whitelistSee LICENSE file for details.
For issues and questions: