forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature](mtmv)(2)Implementing mtmv using antlr (apache#26102)
Implementing mtmv using antlr, No specific business logic was implemented, therefore an exception was thrown during execution ``` throw new AnalysisException("current not support."); ```
- Loading branch information
Showing
23 changed files
with
1,481 additions
and
2 deletions.
There are no files selected for viewing
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
43 changes: 43 additions & 0 deletions
43
fe/fe-core/src/main/java/org/apache/doris/mtmv/EnvInfo.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,43 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package org.apache.doris.mtmv; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* EnvInfo | ||
*/ | ||
public class EnvInfo { | ||
@SerializedName("cn") | ||
private String ctlName; | ||
@SerializedName("dn") | ||
private String dbName; | ||
|
||
public EnvInfo(String ctlName, String dbName) { | ||
this.ctlName = ctlName; | ||
this.dbName = dbName; | ||
} | ||
|
||
public String getCtlName() { | ||
return ctlName; | ||
} | ||
|
||
public String getDbName() { | ||
return dbName; | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRefreshEnum.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,66 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package org.apache.doris.mtmv; | ||
|
||
/** | ||
* refresh enum | ||
*/ | ||
public class MTMVRefreshEnum { | ||
|
||
/** | ||
* RefreshMethod | ||
*/ | ||
public enum RefreshMethod { | ||
COMPLETE //complete | ||
} | ||
|
||
/** | ||
* BuildMode | ||
*/ | ||
public enum BuildMode { | ||
IMMEDIATE, //right now | ||
DEFERRED // deferred | ||
} | ||
|
||
/** | ||
* RefreshTrigger | ||
*/ | ||
public enum RefreshTrigger { | ||
MANUAL, //manual | ||
SCHEDULE // schedule | ||
} | ||
|
||
/** | ||
* MTMVState | ||
*/ | ||
public enum MTMVState { | ||
INIT, | ||
NORMAL, | ||
SCHEMA_CHANGE | ||
} | ||
|
||
/** | ||
* MTMVRefreshState | ||
*/ | ||
public enum MTMVRefreshState { | ||
INIT, | ||
REFRESHING, | ||
FAIL, | ||
SUCCESS | ||
} | ||
} |
109 changes: 109 additions & 0 deletions
109
fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRefreshInfo.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,109 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package org.apache.doris.mtmv; | ||
|
||
import org.apache.doris.mtmv.MTMVRefreshEnum.BuildMode; | ||
import org.apache.doris.mtmv.MTMVRefreshEnum.RefreshMethod; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* refresh info | ||
*/ | ||
public class MTMVRefreshInfo { | ||
@SerializedName("bm") | ||
private BuildMode buildMode; | ||
@SerializedName("rm") | ||
private RefreshMethod refreshMethod; | ||
@SerializedName("rti") | ||
private MTMVRefreshTriggerInfo refreshTriggerInfo; | ||
|
||
public MTMVRefreshInfo() { | ||
} | ||
|
||
public MTMVRefreshInfo(BuildMode buildMode, | ||
RefreshMethod refreshMethod, | ||
MTMVRefreshTriggerInfo refreshTriggerInfo) { | ||
this.buildMode = Objects.requireNonNull(buildMode, "require buildMode object"); | ||
this.refreshMethod = Objects.requireNonNull(refreshMethod, "require refreshMethod object"); | ||
this.refreshTriggerInfo = Objects.requireNonNull(refreshTriggerInfo, "require refreshTriggerInfo object"); | ||
} | ||
|
||
public void validate() { | ||
if (refreshTriggerInfo != null) { | ||
refreshTriggerInfo.validate(); | ||
} | ||
} | ||
|
||
public BuildMode getBuildMode() { | ||
return buildMode; | ||
} | ||
|
||
public RefreshMethod getRefreshMethod() { | ||
return refreshMethod; | ||
} | ||
|
||
public MTMVRefreshTriggerInfo getRefreshTriggerInfo() { | ||
return refreshTriggerInfo; | ||
} | ||
|
||
public void setBuildMode(BuildMode buildMode) { | ||
this.buildMode = buildMode; | ||
} | ||
|
||
public void setRefreshMethod(RefreshMethod refreshMethod) { | ||
this.refreshMethod = refreshMethod; | ||
} | ||
|
||
public void setRefreshTriggerInfo( | ||
MTMVRefreshTriggerInfo refreshTriggerInfo) { | ||
this.refreshTriggerInfo = refreshTriggerInfo; | ||
} | ||
|
||
/** | ||
* update refreshInfo | ||
*/ | ||
public MTMVRefreshInfo updateNotNull(MTMVRefreshInfo newRefreshInfo) { | ||
Objects.requireNonNull(newRefreshInfo); | ||
if (newRefreshInfo.buildMode != null) { | ||
this.buildMode = newRefreshInfo.buildMode; | ||
} | ||
if (newRefreshInfo.refreshMethod != null) { | ||
this.refreshMethod = newRefreshInfo.refreshMethod; | ||
} | ||
if (newRefreshInfo.refreshTriggerInfo != null) { | ||
this.refreshTriggerInfo = newRefreshInfo.refreshTriggerInfo; | ||
} | ||
return this; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder builder = new StringBuilder(); | ||
builder.append("BUILD "); | ||
builder.append(buildMode); | ||
builder.append(" REFRESH "); | ||
builder.append(refreshMethod); | ||
builder.append(" "); | ||
builder.append(refreshTriggerInfo); | ||
return builder.toString(); | ||
} | ||
|
||
} |
Oops, something went wrong.