Skip to content

Commit eec8035

Browse files
author
julien
committed
Fixed code formatting
1 parent f76f450 commit eec8035

File tree

4 files changed

+74
-97
lines changed

4 files changed

+74
-97
lines changed

subprojects/trino-redisearch/src/main/java/com/redis/trino/RediSearchConnector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public ConnectorMetadata getMetadata(ConnectorTransactionHandle transaction) {
5151
checkTransaction(metadata, transaction);
5252
return metadata;
5353
}
54-
54+
5555
private void checkTransaction(Object object, ConnectorTransactionHandle transaction) {
5656
checkArgument(object != null, "no such transaction: %s", transaction);
5757
}

subprojects/trino-redisearch/src/main/java/com/redis/trino/RediSearchPageSourceProvider.java

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,24 @@
1616

1717
import static java.util.Objects.requireNonNull;
1818

19-
public class RediSearchPageSourceProvider
20-
implements ConnectorPageSourceProvider
21-
{
22-
private final RediSearchSession rediSearchSession;
23-
24-
@Inject
25-
public RediSearchPageSourceProvider(RediSearchSession rediSearchSession)
26-
{
27-
this.rediSearchSession = requireNonNull(rediSearchSession, "rediSearchSession is null");
28-
}
29-
30-
@Override
31-
public ConnectorPageSource createPageSource(
32-
ConnectorTransactionHandle transaction,
33-
ConnectorSession session,
34-
ConnectorSplit split,
35-
ConnectorTableHandle table,
36-
List<ColumnHandle> columns,
37-
DynamicFilter dynamicFilter)
38-
{
39-
RediSearchTableHandle tableHandle = (RediSearchTableHandle) table;
40-
41-
ImmutableList.Builder<RediSearchColumnHandle> handles = ImmutableList.builder();
42-
for (ColumnHandle handle : requireNonNull(columns, "columns is null")) {
43-
handles.add((RediSearchColumnHandle) handle);
44-
}
45-
46-
return new RediSearchPageSource(rediSearchSession, tableHandle, handles.build());
47-
}
19+
public class RediSearchPageSourceProvider implements ConnectorPageSourceProvider {
20+
private final RediSearchSession rediSearchSession;
21+
22+
@Inject
23+
public RediSearchPageSourceProvider(RediSearchSession rediSearchSession) {
24+
this.rediSearchSession = requireNonNull(rediSearchSession, "rediSearchSession is null");
25+
}
26+
27+
@Override
28+
public ConnectorPageSource createPageSource(ConnectorTransactionHandle transaction, ConnectorSession session,
29+
ConnectorSplit split, ConnectorTableHandle table, List<ColumnHandle> columns, DynamicFilter dynamicFilter) {
30+
RediSearchTableHandle tableHandle = (RediSearchTableHandle) table;
31+
32+
ImmutableList.Builder<RediSearchColumnHandle> handles = ImmutableList.builder();
33+
for (ColumnHandle handle : requireNonNull(columns, "columns is null")) {
34+
handles.add((RediSearchColumnHandle) handle);
35+
}
36+
37+
return new RediSearchPageSource(rediSearchSession, tableHandle, handles.build());
38+
}
4839
}

subprojects/trino-redisearch/src/main/java/com/redis/trino/RediSearchTransactionHandle.java

Lines changed: 38 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,52 +10,42 @@
1010
import static com.google.common.base.MoreObjects.toStringHelper;
1111
import static java.util.Objects.requireNonNull;
1212

13-
public class RediSearchTransactionHandle
14-
implements ConnectorTransactionHandle
15-
{
16-
private final UUID uuid;
17-
18-
public RediSearchTransactionHandle()
19-
{
20-
this(UUID.randomUUID());
21-
}
22-
23-
@JsonCreator
24-
public RediSearchTransactionHandle(@JsonProperty("uuid") UUID uuid)
25-
{
26-
this.uuid = requireNonNull(uuid, "uuid is null");
27-
}
28-
29-
@JsonProperty
30-
public UUID getUuid()
31-
{
32-
return uuid;
33-
}
34-
35-
@Override
36-
public boolean equals(Object obj)
37-
{
38-
if (this == obj) {
39-
return true;
40-
}
41-
if ((obj == null) || (getClass() != obj.getClass())) {
42-
return false;
43-
}
44-
RediSearchTransactionHandle other = (RediSearchTransactionHandle) obj;
45-
return Objects.equals(uuid, other.uuid);
46-
}
47-
48-
@Override
49-
public int hashCode()
50-
{
51-
return Objects.hash(uuid);
52-
}
53-
54-
@Override
55-
public String toString()
56-
{
57-
return toStringHelper(this)
58-
.add("uuid", uuid)
59-
.toString();
60-
}
13+
public class RediSearchTransactionHandle implements ConnectorTransactionHandle {
14+
private final UUID uuid;
15+
16+
public RediSearchTransactionHandle() {
17+
this(UUID.randomUUID());
18+
}
19+
20+
@JsonCreator
21+
public RediSearchTransactionHandle(@JsonProperty("uuid") UUID uuid) {
22+
this.uuid = requireNonNull(uuid, "uuid is null");
23+
}
24+
25+
@JsonProperty
26+
public UUID getUuid() {
27+
return uuid;
28+
}
29+
30+
@Override
31+
public boolean equals(Object obj) {
32+
if (this == obj) {
33+
return true;
34+
}
35+
if ((obj == null) || (getClass() != obj.getClass())) {
36+
return false;
37+
}
38+
RediSearchTransactionHandle other = (RediSearchTransactionHandle) obj;
39+
return Objects.equals(uuid, other.uuid);
40+
}
41+
42+
@Override
43+
public int hashCode() {
44+
return Objects.hash(uuid);
45+
}
46+
47+
@Override
48+
public String toString() {
49+
return toStringHelper(this).add("uuid", uuid).toString();
50+
}
6151
}

subprojects/trino-redisearch/src/main/java/com/redis/trino/TypeUtils.java

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,23 @@
77

88
import static io.trino.spi.type.StandardTypes.JSON;
99

10-
public final class TypeUtils
11-
{
12-
private TypeUtils() {}
10+
public final class TypeUtils {
11+
private TypeUtils() {
12+
}
1313

14-
public static boolean isJsonType(Type type)
15-
{
16-
return type.getBaseName().equals(JSON);
17-
}
14+
public static boolean isJsonType(Type type) {
15+
return type.getBaseName().equals(JSON);
16+
}
1817

19-
public static boolean isArrayType(Type type)
20-
{
21-
return type instanceof ArrayType;
22-
}
18+
public static boolean isArrayType(Type type) {
19+
return type instanceof ArrayType;
20+
}
2321

24-
public static boolean isMapType(Type type)
25-
{
26-
return type instanceof MapType;
27-
}
22+
public static boolean isMapType(Type type) {
23+
return type instanceof MapType;
24+
}
2825

29-
public static boolean isRowType(Type type)
30-
{
31-
return type instanceof RowType;
32-
}
26+
public static boolean isRowType(Type type) {
27+
return type instanceof RowType;
28+
}
3329
}

0 commit comments

Comments
 (0)