forked from apache/gravitino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[apache#1736] feat(postgresql): Support PostgreSQL index.
- Loading branch information
Showing
10 changed files
with
489 additions
and
48 deletions.
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
...g-jdbc-common/src/main/java/com/datastrato/gravitino/catalog/jdbc/bean/JdbcIndexBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright 2024 Datastrato Pvt Ltd. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
package com.datastrato.gravitino.catalog.jdbc.bean; | ||
|
||
import com.datastrato.gravitino.rel.indexes.Index; | ||
import java.util.Objects; | ||
|
||
/** Store JDBC index information. */ | ||
public class JdbcIndexBean { | ||
|
||
private final Index.IndexType indexType; | ||
|
||
private final String colName; | ||
|
||
private final String name; | ||
|
||
/** Used for sorting */ | ||
private final int order; | ||
|
||
public JdbcIndexBean(Index.IndexType indexType, String colName, String name, int order) { | ||
this.indexType = indexType; | ||
this.colName = colName; | ||
this.name = name; | ||
this.order = order; | ||
} | ||
|
||
public Index.IndexType getIndexType() { | ||
return indexType; | ||
} | ||
|
||
public String getColName() { | ||
return colName; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public int getOrder() { | ||
return order; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
JdbcIndexBean that = (JdbcIndexBean) o; | ||
return order == that.order | ||
&& indexType == that.indexType | ||
&& Objects.equals(colName, that.colName) | ||
&& Objects.equals(name, that.name); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(indexType, colName, name, order); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "JdbcIndexBean{" | ||
+ "indexType=" | ||
+ indexType | ||
+ ", colName='" | ||
+ colName | ||
+ '\'' | ||
+ ", name='" | ||
+ name | ||
+ '\'' | ||
+ ", order=" | ||
+ order | ||
+ '}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.