Skip to content

Commit cc49b74

Browse files
committed
Remove doc updates
1 parent 12a894e commit cc49b74

File tree

1 file changed

+3
-85
lines changed

1 file changed

+3
-85
lines changed

website/docs/apis/java-client.md

Lines changed: 3 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,6 @@ title: "Java Client"
33
sidebar_position: 1
44
---
55

6-
<!--
7-
Licensed to the Apache Software Foundation (ASF) under one
8-
or more contributor license agreements. See the NOTICE file
9-
distributed with this work for additional information
10-
regarding copyright ownership. The ASF licenses this file
11-
to you under the Apache License, Version 2.0 (the
12-
"License"); you may not use this file except in compliance
13-
with the License. You may obtain a copy of the License at
14-
15-
http://www.apache.org/licenses/LICENSE-2.0
16-
17-
Unless required by applicable law or agreed to in writing, software
18-
distributed under the License is distributed on an "AS IS" BASIS,
19-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20-
See the License for the specific language governing permissions and
21-
limitations under the License.
22-
-->
23-
246
# Fluss Java Client
257
## Overview
268
Fluss `Admin` API that supports asynchronous operations for managing and inspecting Fluss resources. It communicates with the Fluss cluster and provides methods for:
@@ -188,8 +170,8 @@ List<User> users = List.of(
188170
);
189171
```
190172

191-
**Note:** Currently data in Fluss is written in the form of `rows`, so we need to convert our POJO to `GenericRow`. You can use the `ConverterUtils` helper class (see below) or manually convert your objects as shown here:
192-
173+
**Note:** Currently data in Fluss is written in the form of `rows`, so we need to convert our POJO to `GenericRow`, while the Fluss community is working to provide
174+
a more user-friendly API for writing data.
193175
```java
194176
Table table = connection.getTable(tablePath);
195177

@@ -262,68 +244,4 @@ LookupResult prefixLookup = table.newLookup()
262244
.createLookuper()
263245
.lookup(rowKey)
264246
.get();
265-
```
266-
267-
## Converter Utilities
268-
The `ConverterUtils` class is a helper utility for converting Java POJOs to Fluss's `InternalRow` format and vice versa. This utility simplifies the process of working with Fluss tables by handling the conversion between your domain objects and Fluss's internal row representation.
269-
270-
#### Usage Example
271-
Here's an example of how to use `ConverterUtils` to convert between POJOs and Fluss rows:
272-
273-
```java
274-
// Define your POJO class with a Default Constructor
275-
public class Order {
276-
public Order() {}
277-
278-
......
279-
}
280-
281-
// Create a schema that matches your POJO
282-
Schema schema = Schema.newBuilder()
283-
.column("orderId", DataTypes.BIGINT())
284-
.column("customerId", DataTypes.BIGINT())
285-
.column("quantity", DataTypes.INT())
286-
.column("address", DataTypes.STRING())
287-
.column("orderTime", DataTypes.TIMESTAMP())
288-
.build();
289-
290-
// Create a RowType from the schema
291-
RowType rowType = RowType.of(
292-
new DataType[] {
293-
DataTypes.BIGINT(),
294-
DataTypes.BIGINT(),
295-
DataTypes.INT(),
296-
DataTypes.STRING(),
297-
DataTypes.TIMESTAMP()
298-
},
299-
new String[] {"orderId", "customerId", "quantity", "address", "orderTime"});
300-
301-
// Create a converter for your POJO class using the static factory method
302-
ConverterUtils<Order> converter = ConverterUtils.getConverter(Order.class, rowType);
303-
304-
// Convert a POJO to a GenericRow
305-
Order order = new Order(1001L, 5001L, 10, "123 Athens", LocalDateTime.now());
306-
GenericRow row = converter.toRow(order);
307-
308-
// Write the row to a table
309-
Table table = connection.getTable(tablePath);
310-
UpsertWriter writer = table.newUpsert().createWriter();
311-
writer.upsert(row);
312-
writer.flush();
313-
314-
// Read a row from a table and convert it back to a POJO
315-
LogScanner logScanner = table.newScan().createLogScanner();
316-
logScanner.subscribeFromBeginning(0);
317-
ScanRecords scanRecords = logScanner.poll(Duration.ofSeconds(1));
318-
for (ScanRecord scanRecord : scanRecords) {
319-
InternalRow readRow = scanRecord.getRow();
320-
// Convert row back to POJO
321-
Order readOrder = converter.fromRow(readRow);
322-
System.out.println("Read order: " + readOrder.orderId);
323-
}
324-
```
325-
326-
#### Limitations
327-
- Nested POJO fields are not currently supported
328-
- All POJO classes must have a default (no-argument) constructor
329-
- Field names in the POJO must match column names in the schema (case-sensitive)
247+
```

0 commit comments

Comments
 (0)