-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4,404 changed files
with
386,812 additions
and
40,841 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +0,0 @@ | ||
FROM polardbx/polardbxbasejava:20221129 | ||
|
||
WORKDIR /home/admin | ||
|
||
COPY polardbx-server/target/polardbx-server drds-server | ||
COPY docker/admin/bin/* /home/admin/bin/ | ||
COPY docker/etc/* /tmp/ | ||
COPY docker/entrypoint.sh entrypoint.sh | ||
|
||
RUN \ | ||
chmod a+x bin/* && \ | ||
chmod a+x entrypoint.sh && \ | ||
chown admin:admin -R /home/admin && \ | ||
cp /tmp/drds /etc/logrotate.d/drds && \ | ||
cp /tmp/log_cleaner /etc/cron.d/log_cleaner && \ | ||
true | ||
|
||
USER admin | ||
|
||
# Set command to entrypoint.sh | ||
ENTRYPOINT /home/admin/entrypoint.sh | ||
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 |
---|---|---|
@@ -1,2 +0,0 @@ | ||
*/1 * * * * root /home/admin/bin/log_cleaner.sh 90 >/dev/null 2>&1 | ||
|
||
File renamed without changes.
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
105 changes: 105 additions & 0 deletions
105
polardbx-calcite/src/main/java/org/apache/calcite/rel/core/RecursiveCTE.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,105 @@ | ||
/* | ||
* Copyright [2013-2021], Alibaba Group Holding Limited | ||
* | ||
* Licensed 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.calcite.rel.core; | ||
|
||
import org.apache.calcite.plan.RelOptCluster; | ||
import org.apache.calcite.plan.RelOptCost; | ||
import org.apache.calcite.plan.RelOptPlanner; | ||
import org.apache.calcite.plan.RelTraitSet; | ||
import org.apache.calcite.rel.BiRel; | ||
import org.apache.calcite.rel.RelNode; | ||
import org.apache.calcite.rel.RelWriter; | ||
import org.apache.calcite.rel.externalize.RelDrdsWriter; | ||
import org.apache.calcite.rel.metadata.RelMetadataQuery; | ||
import org.apache.calcite.rel.type.RelDataType; | ||
import org.apache.calcite.rex.RexNode; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* left rel is anchor part, right rel is body part | ||
* | ||
* @author fangwu | ||
*/ | ||
public class RecursiveCTE extends BiRel { | ||
private String cteName; | ||
|
||
// special limit grammar for recursive cte | ||
private RexNode offset; | ||
private RexNode fetch; | ||
|
||
public RecursiveCTE(RelOptCluster cluster, RelTraitSet traitSet, | ||
RelNode left, RelNode right, String cteName, RexNode offset, RexNode fetch) { | ||
// left -> anchor part; right -> recursive part | ||
super(cluster, traitSet, left, right); | ||
this.cteName = cteName; | ||
this.offset = offset; | ||
this.fetch = fetch; | ||
} | ||
|
||
/** | ||
* recursive rowtype must be same with anchor part | ||
*/ | ||
protected RelDataType deriveRowType() { | ||
return left.getRowType(); | ||
} | ||
|
||
@Override | ||
public RelWriter explainTermsForDisplay(RelWriter pw) { | ||
pw.item(RelDrdsWriter.REL_NAME, "RecursiveCTE"); | ||
pw.item("cte_name", cteName); | ||
pw.item("offset", offset); | ||
pw.item("fetch", fetch); | ||
return pw; | ||
} | ||
|
||
@Override | ||
public void explainForDisplay(RelWriter pw) { | ||
explainTermsForDisplay(pw).done(this); | ||
} | ||
|
||
@Override | ||
public RelNode copy(RelTraitSet traitSet, List<RelNode> inputs) { | ||
if (getInputs().equals(inputs) | ||
&& traitSet == getTraitSet()) { | ||
return this; | ||
} | ||
return new RecursiveCTE(getCluster(), traitSet, inputs.get(0), inputs.get(1), cteName, offset, fetch); | ||
} | ||
|
||
@Override | ||
public RelOptCost computeSelfCost(RelOptPlanner planner, | ||
RelMetadataQuery mq) { | ||
RelOptCost relOptCost = left.computeSelfCost(planner, mq); | ||
return planner.getCostFactory() | ||
.makeCost(relOptCost.getRows() * 1000, relOptCost.getCpu() * 1000, relOptCost.getMemory(), | ||
relOptCost.getIo(), | ||
relOptCost.getNet()); | ||
} | ||
|
||
public String getCteName() { | ||
return cteName; | ||
} | ||
|
||
public RexNode getOffset() { | ||
return offset; | ||
} | ||
|
||
public RexNode getFetch() { | ||
return fetch; | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
polardbx-calcite/src/main/java/org/apache/calcite/rel/core/RecursiveCTEAnchor.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,70 @@ | ||
/* | ||
* Copyright [2013-2021], Alibaba Group Holding Limited | ||
* | ||
* Licensed 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.calcite.rel.core; | ||
|
||
import org.apache.calcite.plan.RelOptCluster; | ||
import org.apache.calcite.plan.RelOptCost; | ||
import org.apache.calcite.plan.RelOptPlanner; | ||
import org.apache.calcite.plan.RelTraitSet; | ||
import org.apache.calcite.rel.AbstractRelNode; | ||
import org.apache.calcite.rel.RelNode; | ||
import org.apache.calcite.rel.RelWriter; | ||
import org.apache.calcite.rel.externalize.RelDrdsWriter; | ||
import org.apache.calcite.rel.metadata.RelMetadataQuery; | ||
import org.apache.calcite.rel.type.RelDataType; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author fangwu | ||
*/ | ||
public class RecursiveCTEAnchor extends AbstractRelNode { | ||
private final String cteName; | ||
|
||
public RecursiveCTEAnchor(RelOptCluster cluster, RelTraitSet traitSet, | ||
String cteName, RelDataType rowtype) { | ||
super(cluster, traitSet); | ||
this.cteName = cteName; | ||
this.rowType = rowtype; | ||
} | ||
|
||
public String getCteName() { | ||
return cteName; | ||
} | ||
|
||
@Override | ||
public RelNode copy(RelTraitSet traitSet, List<RelNode> inputs) { | ||
if (getInputs().equals(inputs) | ||
&& traitSet == getTraitSet()) { | ||
return this; | ||
} | ||
return new RecursiveCTEAnchor(getCluster(), traitSet, cteName, rowType); | ||
} | ||
|
||
@Override | ||
public RelWriter explainTermsForDisplay(RelWriter pw) { | ||
pw.item(RelDrdsWriter.REL_NAME, "RecursiveCTEAnchor"); | ||
pw.item("cte_target", cteName); | ||
return pw; | ||
} | ||
|
||
@Override | ||
public RelOptCost computeSelfCost(RelOptPlanner planner, | ||
RelMetadataQuery mq) { | ||
return planner.getCostFactory().makeCost(1.0, 1.0, 0.0, 0.0, 0.0); | ||
} | ||
} |
Oops, something went wrong.