This is an automated email from the ASF dual-hosted git repository.
gvvinblade pushed a commit to branch ignite-12248
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/ignite-12248 by this push:
new 7895303 pending
7895303 is described below
commit 7895303c5ac06ed35867ea42153c8c39556bf943
Author: Igor Seliverstov <[email protected]>
AuthorDate: Fri Nov 22 17:38:31 2019 +0300
pending
---
.../query/calcite/metadata/FragmentInfo.java | 25 ++----------
.../query/calcite/schema/IgniteTable.java | 2 +-
.../calcite/serialize/GraphToRelConverter.java | 29 --------------
.../query/calcite/serialize/RelGraphNode.java | 4 +-
.../calcite/serialize/SerializedCorrelationId.java | 46 ----------------------
...rializedTraitSet.java => SerializedTraits.java} | 4 +-
.../query/calcite/splitter/Fragment.java | 7 ----
.../processors/query/calcite/util/Commons.java | 2 -
8 files changed, 9 insertions(+), 110 deletions(-)
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/FragmentInfo.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/FragmentInfo.java
index 6d6aa1b..9badd91 100644
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/FragmentInfo.java
+++
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/FragmentInfo.java
@@ -17,7 +17,6 @@
package org.apache.ignite.internal.processors.query.calcite.metadata;
import com.google.common.collect.ImmutableList;
-import org.apache.calcite.util.ImmutableIntList;
import org.apache.ignite.internal.processors.query.calcite.splitter.Fragment;
/**
@@ -26,18 +25,16 @@ import
org.apache.ignite.internal.processors.query.calcite.splitter.Fragment;
public class FragmentInfo {
private final NodesMapping mapping;
private final ImmutableList<Fragment> remoteInputs;
- private final ImmutableIntList localInputs;
public FragmentInfo(Fragment remoteInput) {
- this(null, ImmutableList.of(remoteInput), null);
+ this(ImmutableList.of(remoteInput), null);
}
- public FragmentInfo(int localInput, NodesMapping mapping) {
- this(ImmutableIntList.of(localInput), null, mapping);
+ public FragmentInfo(NodesMapping mapping) {
+ this(null, mapping);
}
- public FragmentInfo(ImmutableIntList localInputs, ImmutableList<Fragment>
remoteInputs, NodesMapping mapping) {
- this.localInputs = localInputs;
+ public FragmentInfo(ImmutableList<Fragment> remoteInputs, NodesMapping
mapping) {
this.remoteInputs = remoteInputs;
this.mapping = mapping;
}
@@ -50,13 +47,8 @@ public class FragmentInfo {
return remoteInputs;
}
- public ImmutableIntList localInputs() {
- return localInputs;
- }
-
public FragmentInfo merge(FragmentInfo other) throws
LocationMappingException {
return new FragmentInfo(
- merge(localInputs(), other.localInputs()),
merge(remoteInputs(), other.remoteInputs()),
merge(mapping(), other.mapping()));
}
@@ -78,13 +70,4 @@ public class FragmentInfo {
return ImmutableList.<T>builder().addAll(left).addAll(right).build();
}
-
- private static ImmutableIntList merge(ImmutableIntList left,
ImmutableIntList right) {
- if (left == null)
- return right;
- if (right == null)
- return left;
-
- return left.appendAll(right);
- }
}
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/IgniteTable.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/IgniteTable.java
index 25d1931..b14ea3b 100644
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/IgniteTable.java
+++
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/IgniteTable.java
@@ -83,7 +83,7 @@ public class IgniteTable extends AbstractTable implements
TranslatableTable {
public FragmentInfo fragmentInfo(Context ctx) {
int cacheId = CU.cacheId(cacheName);
- return new FragmentInfo(cacheId,
locationRegistry(ctx).distributed(cacheId, topologyVersion(ctx)));
+ return new FragmentInfo(locationRegistry(ctx).distributed(cacheId,
topologyVersion(ctx)));
}
private LocationRegistry locationRegistry(Context ctx) {
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/GraphToRelConverter.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/GraphToRelConverter.java
deleted file mode 100644
index abf4cdf..0000000
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/GraphToRelConverter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2019 GridGain Systems, Inc. and Contributors.
- *
- * Licensed under the GridGain Community Edition License (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *
https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license
- *
- * 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.ignite.internal.processors.query.calcite.serialize;
-
-import org.apache.calcite.rel.RelNode;
-import
org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner;
-
-/**
- *
- */
-public class GraphToRelConverter {
- public RelNode convert(IgnitePlanner planner, Graph graph) {
- return null;
- }
-}
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/RelGraphNode.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/RelGraphNode.java
index 164274f..055f814 100644
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/RelGraphNode.java
+++
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/RelGraphNode.java
@@ -24,13 +24,13 @@ import org.apache.calcite.rel.RelNode;
*
*/
public abstract class RelGraphNode implements GraphNode {
- protected SerializedTraitSet traitSet;
+ protected SerializedTraits traitSet;
protected RelGraphNode() {
}
protected RelGraphNode(RelTraitSet traits) {
- traitSet = new SerializedTraitSet(traits);
+ traitSet = new SerializedTraits(traits);
}
public abstract RelNode toRel(ConversionContext ctx, List<RelNode>
children);
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/SerializedCorrelationId.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/SerializedCorrelationId.java
deleted file mode 100644
index cc2c378..0000000
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/SerializedCorrelationId.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2019 GridGain Systems, Inc. and Contributors.
- *
- * Licensed under the GridGain Community Edition License (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *
https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license
- *
- * 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.ignite.internal.processors.query.calcite.serialize;
-
-import java.io.Serializable;
-import org.apache.calcite.rel.core.CorrelationId;
-
-/**
- *
- */
-public class SerializedCorrelationId implements Serializable {
- private final int id;
- private final String name;
-
- public SerializedCorrelationId(int id, String name) {
- this.id = id;
- this.name = name;
- }
-
- public SerializedCorrelationId(CorrelationId corrId) {
- id = corrId.getId();
- name = corrId.getName();
- }
-
- public int id() {
- return id;
- }
-
- public String name() {
- return name;
- }
-}
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/SerializedTraitSet.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/SerializedTraits.java
similarity index 95%
rename from
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/SerializedTraitSet.java
rename to
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/SerializedTraits.java
index f35d933..66583ed 100644
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/SerializedTraitSet.java
+++
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/serialize/SerializedTraits.java
@@ -27,12 +27,12 @@ import
org.apache.ignite.internal.processors.query.calcite.rel.IgniteRel;
/**
*
*/
-public class SerializedTraitSet implements Serializable {
+public class SerializedTraits implements Serializable {
private static final Byte IGNITE_CONVENTION = 0;
private final List<Serializable> traits;
- public SerializedTraitSet(RelTraitSet traits) {
+ public SerializedTraits(RelTraitSet traits) {
this.traits = translate(traits);
}
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/splitter/Fragment.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/splitter/Fragment.java
index 55264d6..9fcbf93 100644
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/splitter/Fragment.java
+++
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/splitter/Fragment.java
@@ -20,7 +20,6 @@ import com.google.common.collect.ImmutableList;
import org.apache.calcite.plan.Context;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rel.metadata.RelMetadataQuery;
-import org.apache.calcite.util.ImmutableIntList;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.query.IgniteSQLException;
import
org.apache.ignite.internal.processors.query.calcite.metadata.FragmentInfo;
@@ -38,7 +37,6 @@ public class Fragment {
private final RelNode rel;
private NodesMapping mapping;
- private ImmutableIntList localInputs;
private ImmutableList<Fragment> remoteInputs;
public Fragment(RelNode rel) {
@@ -57,10 +55,6 @@ public class Fragment {
return mapping;
}
- public ImmutableIntList localInputs() {
- return localInputs;
- }
-
public ImmutableList<Fragment> remoteInputs() {
return remoteInputs;
}
@@ -73,7 +67,6 @@ public class Fragment {
FragmentInfo info = IgniteMdFragmentInfo.fragmentInfo(rel, mq);
remoteInputs = info.remoteInputs();
- localInputs = info.localInputs();
if (info.mapping() == null)
mapping = isRemote() ? registry(ctx).random(topologyVersion(ctx))
: registry(ctx).local();
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/Commons.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/Commons.java
index 22486e8..c6d6a6c 100644
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/Commons.java
+++
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/Commons.java
@@ -52,8 +52,6 @@ import org.jetbrains.annotations.Nullable;
*
*/
public final class Commons {
- private static final int[] EMPTY = new int[0];
-
private Commons(){}
public static Context convert(QueryContext ctx) {