Skip to content

Commit a0af525

Browse files
committed
fix checkstyle violation
1 parent a48ce60 commit a0af525

20 files changed

+72
-56
lines changed

fluss-client/src/main/java/org/apache/fluss/client/lookup/Lookup.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ default Lookup lookupBy(String... lookupColumnNames) {
9999
* lookup columns. By default, the lookup columns are the primary key columns, but can be
100100
* changed with ({@link #lookupBy(List)}) method.
101101
*
102-
* <p>The returned lookuper accepts generic keys of type {@code K}. If a key is a POJO,
103-
* the client implementation will convert it to an {@code InternalRow} based on the table
104-
* schema and the active lookup columns.
102+
* <p>The returned lookuper accepts generic keys of type {@code K}. If a key is a POJO, the
103+
* client implementation will convert it to an {@code InternalRow} based on the table schema and
104+
* the active lookup columns.
105105
*
106106
* @return the lookuper
107107
*/
108108
<K> Lookuper<K> createLookuper();
109-
}
109+
}

fluss-client/src/main/java/org/apache/fluss/client/lookup/Lookuper.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
* A lookuper performs key-based lookups against a primary key table, using either the full primary
2626
* key or a prefix of the primary key (when configured via {@code Lookup#lookupBy}).
2727
*
28-
* <p>This interface is generic on the key type {@code K}:
29-
* - When used in row mode, implementations are typically declared as {@code Lookuper<InternalRow>}
30-
* and accept an {@link org.apache.fluss.row.InternalRow} containing the key fields in the
31-
* configured order.
32-
* - When used with POJO keys, client-provided lookuper instances can also accept a POJO key type
33-
* (for example {@code Lookuper<MyKeyPojo>}) and will transparently convert the POJO to an
34-
* {@code InternalRow} using the table schema and active lookup columns.
28+
* <p>This interface is generic on the key type {@code K}: - When used in row mode, implementations
29+
* are typically declared as {@code Lookuper<InternalRow>} and accept an {@link
30+
* org.apache.fluss.row.InternalRow} containing the key fields in the configured order. - When used
31+
* with POJO keys, client-provided lookuper instances can also accept a POJO key type (for example
32+
* {@code Lookuper<MyKeyPojo>}) and will transparently convert the POJO to an {@code InternalRow}
33+
* using the table schema and active lookup columns.
3534
*
3635
* <p>Usage examples:
3736
*
@@ -65,4 +64,4 @@ public interface Lookuper<K> {
6564
* @return the result of lookup.
6665
*/
6766
CompletableFuture<LookupResult> lookup(K lookupKey);
68-
}
67+
}

fluss-client/src/main/java/org/apache/fluss/client/lookup/TableLookup.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ public <K> Lookuper<K> createLookuper() {
6161
if (lookupColumnNames == null) {
6262
lookuper = new PrimaryKeyLookuper(tableInfo, metadataUpdater, lookupClient);
6363
} else {
64-
lookuper = new PrefixKeyLookuper(
65-
tableInfo, metadataUpdater, lookupClient, lookupColumnNames);
64+
lookuper =
65+
new PrefixKeyLookuper(
66+
tableInfo, metadataUpdater, lookupClient, lookupColumnNames);
6667
}
6768
return new TypedLookuper<K>(lookuper, tableInfo, lookupColumnNames);
6869
}
69-
}
70+
}

fluss-client/src/main/java/org/apache/fluss/client/lookup/TypedLookuper.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,26 @@
2323
import org.apache.fluss.types.RowType;
2424

2525
import javax.annotation.Nullable;
26+
2627
import java.util.List;
2728
import java.util.concurrent.CompletableFuture;
2829

2930
/**
30-
* Decorator for {@link Lookuper} that enables generic key lookup via {@link Lookuper#lookup(Object)}.
31-
* Converts POJO keys to {@link InternalRow} using existing converters based on table schema and
32-
* active lookup columns, and directly delegates when the key is already an {@link InternalRow}.
31+
* Decorator for {@link Lookuper} that enables generic key lookup via {@link
32+
* Lookuper#lookup(Object)}. Converts POJO keys to {@link InternalRow} using existing converters
33+
* based on table schema and active lookup columns, and directly delegates when the key is already
34+
* an {@link InternalRow}.
3335
*/
3436
final class TypedLookuper<K> implements Lookuper<K> {
3537

3638
private final Lookuper<InternalRow> delegate;
3739
private final TableInfo tableInfo;
3840
@Nullable private final List<String> lookupColumnNames;
3941

40-
TypedLookuper(Lookuper<InternalRow> delegate,
41-
TableInfo tableInfo,
42-
@Nullable List<String> lookupColumnNames) {
42+
TypedLookuper(
43+
Lookuper<InternalRow> delegate,
44+
TableInfo tableInfo,
45+
@Nullable List<String> lookupColumnNames) {
4346
this.delegate = delegate;
4447
this.tableInfo = tableInfo;
4548
this.lookupColumnNames = lookupColumnNames;

fluss-client/src/main/java/org/apache/fluss/client/table/scanner/Scan.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ public interface Scan {
8888
* #limit(int)} and only support for Primary Key Tables.
8989
*/
9090
BatchScanner createBatchScanner(TableBucket tableBucket, long snapshotId);
91-
}
91+
}

fluss-client/src/main/java/org/apache/fluss/client/table/scanner/ScanRecord.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ public int hashCode() {
8989
public String toString() {
9090
return changeType.shortString() + value + "@" + offset;
9191
}
92-
}
92+
}

fluss-client/src/main/java/org/apache/fluss/client/table/scanner/TableScan.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,4 @@ public BatchScanner createBatchScanner(TableBucket tableBucket, long snapshotId)
158158
tableInfo.getTableConfig().getKvFormat(),
159159
conn.getOrCreateRemoteFileDownloader());
160160
}
161-
}
161+
}

fluss-client/src/main/java/org/apache/fluss/client/table/scanner/log/CompletedFetch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,4 @@ private void maybeCloseRecordStream() {
255255
records = null;
256256
}
257257
}
258-
}
258+
}

fluss-client/src/main/java/org/apache/fluss/client/table/scanner/log/LogFetchCollector.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.apache.fluss.annotation.Internal;
2121
import org.apache.fluss.client.metadata.MetadataUpdater;
2222
import org.apache.fluss.client.table.scanner.ScanRecord;
23-
import org.apache.fluss.row.InternalRow;
2423
import org.apache.fluss.config.ConfigOptions;
2524
import org.apache.fluss.config.Configuration;
2625
import org.apache.fluss.exception.AuthorizationException;
@@ -30,6 +29,7 @@
3029
import org.apache.fluss.metadata.TablePath;
3130
import org.apache.fluss.record.LogRecord;
3231
import org.apache.fluss.record.LogRecordBatch;
32+
import org.apache.fluss.row.InternalRow;
3333
import org.apache.fluss.rpc.protocol.ApiError;
3434
import org.apache.fluss.rpc.protocol.Errors;
3535

@@ -84,7 +84,8 @@ public LogFetchCollector(
8484
* @throws LogOffsetOutOfRangeException If there is OffsetOutOfRange error in fetchResponse and
8585
* the defaultResetPolicy is NONE
8686
*/
87-
public Map<TableBucket, List<ScanRecord<InternalRow>>> collectFetch(final LogFetchBuffer logFetchBuffer) {
87+
public Map<TableBucket, List<ScanRecord<InternalRow>>> collectFetch(
88+
final LogFetchBuffer logFetchBuffer) {
8889
Map<TableBucket, List<ScanRecord<InternalRow>>> fetched = new HashMap<>();
8990
int recordsRemaining = maxPollRecords;
9091

@@ -116,7 +117,8 @@ public Map<TableBucket, List<ScanRecord<InternalRow>>> collectFetch(final LogFet
116117

117118
logFetchBuffer.poll();
118119
} else {
119-
List<ScanRecord<InternalRow>> records = fetchRecords(nextInLineFetch, recordsRemaining);
120+
List<ScanRecord<InternalRow>> records =
121+
fetchRecords(nextInLineFetch, recordsRemaining);
120122
if (!records.isEmpty()) {
121123
TableBucket tableBucket = nextInLineFetch.tableBucket;
122124
List<ScanRecord<InternalRow>> currentRecords = fetched.get(tableBucket);
@@ -147,7 +149,8 @@ public Map<TableBucket, List<ScanRecord<InternalRow>>> collectFetch(final LogFet
147149
return fetched;
148150
}
149151

150-
private List<ScanRecord<InternalRow>> fetchRecords(CompletedFetch nextInLineFetch, int maxRecords) {
152+
private List<ScanRecord<InternalRow>> fetchRecords(
153+
CompletedFetch nextInLineFetch, int maxRecords) {
151154
TableBucket tb = nextInLineFetch.tableBucket;
152155
Long offset = logScannerStatus.getBucketOffset(tb);
153156
if (offset == null) {
@@ -290,4 +293,4 @@ private void handleInitializeErrors(
290293
error, fetchOffset, tb, error.exception(errorMessage)));
291294
}
292295
}
293-
}
296+
}

fluss-client/src/main/java/org/apache/fluss/client/table/scanner/log/LogScannerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,4 @@ public void close() {
303303
release();
304304
}
305305
}
306-
}
306+
}

0 commit comments

Comments
 (0)