morningman commented on code in PR #13430:
URL: https://github.com/apache/doris/pull/13430#discussion_r1011927486
##########
gensrc/proto/olap_file.proto:
##########
@@ -201,6 +201,20 @@ message ColumnPB {
repeated string children_column_names = 18;
}
+enum IndexType {
+ BITMAP = 0;
+ INVERTED = 1;
+ BLOOMFILTER = 2;
+}
+
+message TabletIndexPB {
+ required int32 index_id = 1;
Review Comment:
do not use `required`, use `optional`
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Index.java:
##########
@@ -30,36 +31,55 @@
import java.io.DataOutput;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* Internal representation of index, including index type, name, columns and
comments.
* This class will used in olaptable
*/
public class Index implements Writable {
+ public static final int INDEX_ID_INIT_VALUE = -1;
+
+ @SerializedName(value = "indexId")
+ private int indexId;
Review Comment:
How to do the forward compatibility? that the old index does not has an ID.
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/TableIndexes.java:
##########
@@ -40,6 +40,8 @@ public class TableIndexes implements Writable {
private List<Index> indexes;
@SerializedName(value = "properties")
private Map<String, String> properties;
+ @SerializedName(value = "maxIndexId")
+ private int maxIndexId = Index.INDEX_ID_INIT_VALUE;
Review Comment:
Why not using `Env.getNextId()`?
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/TableIndexes.java:
##########
@@ -56,6 +58,26 @@ public TableIndexes(List<Index> indexes, Map<String, String>
properties) {
this.properties = properties;
}
+ public int incAndGetMaxIndexUniqueId() {
+ this.maxIndexId++;
+ return this.maxIndexId;
+ }
+
+ public int getMaxIndexUniqueId() {
Review Comment:
```suggestion
private int getMaxIndexUniqueId() {
```
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/TableIndexes.java:
##########
@@ -56,6 +58,26 @@ public TableIndexes(List<Index> indexes, Map<String, String>
properties) {
this.properties = properties;
}
+ public int incAndGetMaxIndexUniqueId() {
Review Comment:
```suggestion
private int incAndGetMaxIndexUniqueId() {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]