Skip to content

Commit e140092

Browse files
committed
refactor: readme
1 parent 6ed861a commit e140092

1 file changed

Lines changed: 82 additions & 3 deletions

File tree

README.md

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
![License](https://img.shields.io/badge/license-Apache--2.0-green.svg)
55
[![Maven Central](https://img.shields.io/maven-central/v/io.greptime/greptimedb-ingester.svg?label=maven%20central)](https://central.sonatype.com/search?q=io.greptime&name=ingester-all)
66

7-
The GreptimeDB Ingester for Java is a lightweight, high-performance client designed for efficient time-series data ingestion. It leverages the gRPC protocol to provide a non-blocking, purely asynchronous API that delivers exceptional throughput while remaining easy to integrate into your applications.
7+
The GreptimeDB Ingester for Java is a lightweight, high-performance client designed for efficient time-series data ingestion. It leverages the gRPC protocol to provide a non-blocking, purely asynchronous API that delivers exceptional throughput while maintaining seamless integration with your applications.
88

9-
This client offers multiple ingestion methods optimized for different performance requirements and use cases, allowing you to choose the approach that best fits your specific needs - from simple unary writes to high-throughput bulk streaming operations.
9+
This client offers multiple ingestion methods optimized for various performance requirements and use cases. You can select the approach that best suits your specific needs—whether you require simple unary writes for low-latency operations or high-throughput bulk streaming for maximum efficiency when handling large volumes of time-series data.
1010

1111
## Documentation
1212
- [API Reference](https://javadoc.io/doc/io.greptime/ingester-protocol/latest/index.html)
@@ -83,6 +83,26 @@ This client offers multiple ingestion methods optimized for different performanc
8383
- **Network Layer**: Manages low-level protocol communications using Arrow Flight and gRPC
8484

8585
## How To Use
86+
87+
- [Installation](#installation)
88+
- [Client Initialization](#client-initialization)
89+
- [Writing Data](#writing-data)
90+
- [Creating and Writing Tables](#creating-and-writing-tables)
91+
- [TableSchema](#tableschema)
92+
- [Column Types](#column-types)
93+
- [Table](#table)
94+
- [Write Operations](#write-operations)
95+
- [Streaming Write](#streaming-write)
96+
- [Bulk Write](#bulk-write)
97+
- [Configuration](#configuration)
98+
- [Resource Management](#resource-management)
99+
- [Performance Tuning](#performance-tuning)
100+
- [Compression Options](#compression-options)
101+
- [Write Operation Comparison](#write-operation-comparison)
102+
- [Buffer Size Optimization](#buffer-size-optimization)
103+
104+
### Installation
105+
86106
GreptimeDB Java Ingester is hosted in the Maven Central Repository.
87107

88108
To use it with Maven, simply add the following dependency to your project:
@@ -97,7 +117,6 @@ To use it with Maven, simply add the following dependency to your project:
97117

98118
The latest version can be viewed [here](https://central.sonatype.com/search?q=io.greptime&name=ingester-all).
99119

100-
101120
### Client Initialization
102121

103122
The entry point to the GreptimeDB Ingester Java client is the `GreptimeDB` class. You create a client instance by calling the static create method with appropriate configuration options.
@@ -307,3 +326,63 @@ client.shutdownGracefully();
307326
```
308327

309328
### Performance Tuning
329+
330+
#### Compression Options
331+
332+
The GreptimeDB Ingester Java client supports various compression algorithms to reduce network bandwidth and improve throughput.
333+
334+
```java
335+
// Set the compression algorithm to Zstd
336+
Context ctx = Context.newDefault().withCompression(Compression.Zstd);
337+
```
338+
339+
#### Write Operation Comparison
340+
341+
Understanding the performance characteristics of different write methods is crucial for optimizing data ingestion.
342+
343+
| Write Method | API | Throughput | Latency | Memory Efficiency | CPU Utilization |
344+
|--------------|-----|------------|---------|-------------------|-----------------|
345+
| Regular Write | `write(tables)` | Better | Good | High | Higher |
346+
| Stream Write | `streamWriter()` | Moderate | Good | Moderate | Moderate |
347+
| Bulk Write | `bulkStreamWriter()` | Best | Higher | Best | Moderate |
348+
349+
350+
| Write Method | API | Best For | Limitations |
351+
|-------------|-----|----------|-------------|
352+
| Regular Write | `write(tables)` | Simple applications, low latency requirements | Lower throughput for large volumes |
353+
| Stream Write | `streamWriter()` | Continuous data streams, moderate throughput | More complex to use than regular writes |
354+
| Bulk Write | `bulkStreamWriter()` | Maximum throughput, large batch operations | Higher latency, more resource-intensive |
355+
356+
#### Buffer Size Optimization
357+
358+
When using `BulkStreamWriter`, you can configure the column buffer size:
359+
360+
```java
361+
// Get the table buffer with a specific column buffer size
362+
Table.TableBufferRoot table = bulkStreamWriter.tableBufferRoot(columnBufferSize);
363+
```
364+
365+
This option can significantly improve the speed of data conversion to the underlying format. For optimal performance, we recommend setting the column buffer size to 1024 or larger, depending on your specific workload characteristics and available memory.
366+
367+
### Build Requirements
368+
369+
- Java 8+
370+
- Maven 3.6+
371+
372+
### Contributing
373+
374+
We welcome contributions to the GreptimeDB Ingester Java client! Here's how you can contribute:
375+
376+
1. Fork the repository on GitHub
377+
2. Create a feature branch for your changes
378+
3. Make your changes, ensuring they follow the project's code style
379+
4. Add appropriate tests for your changes
380+
5. Submit a pull request to the main repository
381+
382+
When submitting a pull request, please ensure that:
383+
384+
- All tests pass successfully
385+
- Code formatting is correct (run `mvn spotless:check`, this requires Java 17+)
386+
- Documentation is updated to reflect your changes if necessary
387+
388+
Thank you for helping improve the GreptimeDB Ingester Java client! Your contributions are greatly appreciated.

0 commit comments

Comments
 (0)