Skip to content

Commit 604e6f6

Browse files
committed
make the api consistent
1 parent 084cc4c commit 604e6f6

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

fluss-client/src/main/java/org/apache/fluss/client/table/writer/Append.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ public interface Append {
3636
AppendWriter createWriter();
3737

3838
/** Create a new typed {@link AppendWriter} to write POJOs directly. */
39-
<T> TypedAppendWriter<T> createWriter(Class<T> pojoClass);
39+
<T> TypedAppendWriter<T> createTypedWriter(Class<T> pojoClass);
4040
}

fluss-client/src/main/java/org/apache/fluss/client/table/writer/TableAppend.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public AppendWriter createWriter() {
4040
}
4141

4242
@Override
43-
public <T> TypedAppendWriter<T> createWriter(Class<T> pojoClass) {
43+
public <T> TypedAppendWriter<T> createTypedWriter(Class<T> pojoClass) {
4444
AppendWriterImpl delegate = new AppendWriterImpl(tablePath, tableInfo, writerClient);
4545
return new TypedAppendWriterImpl<>(delegate, pojoClass, tableInfo);
4646
}

fluss-client/src/main/java/org/apache/fluss/client/table/writer/TableUpsert.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public UpsertWriter createWriter() {
9797
}
9898

9999
@Override
100-
public <T> TypedUpsertWriter<T> createWriter(Class<T> pojoClass) {
100+
public <T> TypedUpsertWriter<T> createTypedWriter(Class<T> pojoClass) {
101101
UpsertWriterImpl delegate =
102102
new UpsertWriterImpl(tablePath, tableInfo, targetColumns, writerClient);
103103
return new TypedUpsertWriterImpl<>(delegate, pojoClass, tableInfo, targetColumns);

fluss-client/src/main/java/org/apache/fluss/client/table/writer/Upsert.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ public interface Upsert {
6363
UpsertWriter createWriter();
6464

6565
/** Create a new typed {@link UpsertWriter} to write POJOs directly. */
66-
<T> TypedUpsertWriter<T> createWriter(Class<T> pojoClass);
66+
<T> TypedUpsertWriter<T> createTypedWriter(Class<T> pojoClass);
6767
}

fluss-client/src/test/java/org/apache/fluss/client/table/FlussTypedClientITCase.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ void testTypedAppendWriteAndScan() throws Exception {
227227
try (Table table = conn.getTable(path)) {
228228
// write
229229
TypedAppendWriter<AllTypesPojo> writer =
230-
table.newAppend().createWriter(AllTypesPojo.class);
230+
table.newAppend().createTypedWriter(AllTypesPojo.class);
231231
List<AllTypesPojo> expected = new ArrayList<>();
232232
for (int i = 0; i < 5; i++) {
233233
AllTypesPojo u = newAllTypesPojo(i);
@@ -265,7 +265,7 @@ void testTypedUpsertWriteAndScan() throws Exception {
265265

266266
try (Table table = conn.getTable(path)) {
267267
Upsert upsert = table.newUpsert();
268-
TypedUpsertWriter<AllTypesPojo> writer = upsert.createWriter(AllTypesPojo.class);
268+
TypedUpsertWriter<AllTypesPojo> writer = upsert.createTypedWriter(AllTypesPojo.class);
269269

270270
AllTypesPojo p1 = newAllTypesPojo(1);
271271
AllTypesPojo p2 = newAllTypesPojo(2);
@@ -310,7 +310,7 @@ void testTypedLookups() throws Exception {
310310

311311
try (Table table = conn.getTable(path)) {
312312
TypedUpsertWriter<AllTypesPojo> writer =
313-
table.newUpsert().createWriter(AllTypesPojo.class);
313+
table.newUpsert().createTypedWriter(AllTypesPojo.class);
314314
writer.upsert(newAllTypesPojo(1)).get();
315315
writer.upsert(newAllTypesPojo(2)).get();
316316
writer.close();
@@ -338,7 +338,7 @@ void testInternalRowLookup() throws Exception {
338338
try (Table table = conn.getTable(path)) {
339339
// write a couple of rows via POJO writer
340340
TypedUpsertWriter<AllTypesPojo> writer =
341-
table.newUpsert().createWriter(AllTypesPojo.class);
341+
table.newUpsert().createTypedWriter(AllTypesPojo.class);
342342
writer.upsert(newAllTypesPojo(101)).get();
343343
writer.upsert(newAllTypesPojo(202)).get();
344344
writer.close();
@@ -371,7 +371,7 @@ void testTypedProjections() throws Exception {
371371

372372
try (Table table = conn.getTable(path)) {
373373
TypedAppendWriter<AllTypesPojo> writer =
374-
table.newAppend().createWriter(AllTypesPojo.class);
374+
table.newAppend().createTypedWriter(AllTypesPojo.class);
375375
writer.append(newAllTypesPojo(10)).get();
376376
writer.append(newAllTypesPojo(11)).get();
377377
writer.flush();
@@ -410,7 +410,7 @@ void testTypedPartialUpdates() throws Exception {
410410

411411
try (Table table = conn.getTable(path)) {
412412
Upsert upsert = table.newUpsert().partialUpdate("a", "str", "dec");
413-
TypedUpsertWriter<AllTypesPojo> writer = upsert.createWriter(AllTypesPojo.class);
413+
TypedUpsertWriter<AllTypesPojo> writer = upsert.createTypedWriter(AllTypesPojo.class);
414414

415415
// initial full row
416416
writer.upsert(newAllTypesPojo(1)).get();

0 commit comments

Comments
 (0)