You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "tkalkirill (via GitHub)" <gi...@apache.org> on 2024/02/19 15:01:20 UTC
[PR] IGNITE-20117 Implement index backfill process [ignite-3]
tkalkirill opened a new pull request, #3233:
URL: https://github.com/apache/ignite-3/pull/3233
https://issues.apache.org/jira/browse/IGNITE-20117
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
### The Review Checklist
- [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:
\- There is a single JIRA ticket related to the pull request.
\- The web-link to the pull request is attached to the JIRA ticket.
\- The JIRA ticket has the Patch Available state.
\- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
\- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
- [ ] **Design:** new code conforms with the design principles of the components it is added to.
- [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
- [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
- [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
### Notes
- [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20117 Implement index backfill process [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3233:
URL: https://github.com/apache/ignite-3/pull/3233#discussion_r1497078313
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
+class BuildIndexRowVersionChooser {
+ private final PartitionDataStorage storage;
+
+ /** Timestamp of activation of the catalog version in which the index created. */
Review Comment:
fix it
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20117 Implement index backfill process [ignite-3]
Posted by "rpuch (via GitHub)" <gi...@apache.org>.
rpuch commented on code in PR #3233:
URL: https://github.com/apache/ignite-3/pull/3233#discussion_r1496975372
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/BinaryRowAndRowIdMatcher.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.ignite.internal.storage;
+
+import org.apache.ignite.internal.schema.BinaryRow;
+import org.apache.ignite.internal.schema.BinaryRowMatcher;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.Matchers;
+import org.hamcrest.TypeSafeMatcher;
+
+/** Matcher for comparing {@link BinaryRowAndRowId}s. */
+public class BinaryRowAndRowIdMatcher extends TypeSafeMatcher<BinaryRowAndRowId> {
+ private final RowId rowId;
+
+ private final Matcher<BinaryRow> binaryRowMatcher;
+
+ private BinaryRowAndRowIdMatcher(BinaryRowAndRowId exp) {
Review Comment:
```suggestion
private BinaryRowAndRowIdMatcher(BinaryRowAndRowId expected) {
```
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
+class BuildIndexRowVersionChooser {
+ private final PartitionDataStorage storage;
+
+ /** Timestamp of activation of the catalog version in which the index created. */
+ private final long createIndexActivationTs;
+
+ /** Timestamp of activation of the catalog version in which the index start building (get {@link CatalogIndexStatus#BUILDING}). */
+ private final long startBuildingIndexActivationTs;
+
+ /**
+ * Constructor.
+ *
+ * @param storage Multi-version partition storage.
+ * @param createIndexActivationTs Timestamp of activation of the catalog version in which the index created.
+ * @param startBuildingIndexActivationTs Timestamp of activation of the catalog version in which the index start building
+ * (get {@link CatalogIndexStatus#BUILDING}).
+ */
+ BuildIndexRowVersionChooser(PartitionDataStorage storage, long createIndexActivationTs, long startBuildingIndexActivationTs) {
+ this.storage = storage;
+ this.createIndexActivationTs = createIndexActivationTs;
+ this.startBuildingIndexActivationTs = startBuildingIndexActivationTs;
+ }
+
+ /**
+ * Collects binary versions of a row to build an index.
+ *
+ * <p>Index selection algorithm:</p>
+ * <ul>
+ * <li>For writeCommitted with commitTs > activationTs(BUILDING), we will ignore.</li>
+ * <li>For writeCommitted with commitTs <= activationTs(BUILDING), we will take the latest version.</li>
Review Comment:
```suggestion
* <li>For writeCommitted with commitTs <= activationTs(BUILDING), we will take the latest of them.</li>
```
##########
modules/table/src/test/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooserTest.java:
##########
@@ -0,0 +1,235 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.hlc.HybridTimestamp.hybridTimestamp;
+import static org.apache.ignite.internal.storage.BinaryRowAndRowIdMatcher.equalToBinaryRowAndRowId;
+import static org.apache.ignite.internal.storage.RowId.lowestRowId;
+import static org.apache.ignite.internal.tx.TransactionIds.transactionId;
+import static org.apache.ignite.internal.type.NativeTypes.INT32;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.empty;
+import static org.mockito.Mockito.spy;
+
+import java.util.UUID;
+import org.apache.ignite.distributed.TestPartitionDataStorage;
+import org.apache.ignite.internal.schema.BinaryRow;
+import org.apache.ignite.internal.schema.Column;
+import org.apache.ignite.internal.schema.SchemaDescriptor;
+import org.apache.ignite.internal.schema.row.RowAssembler;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.MvPartitionStorage;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.storage.impl.TestMvPartitionStorage;
+import org.apache.ignite.internal.testframework.IgniteAbstractTest;
+import org.hamcrest.Matcher;
+import org.jetbrains.annotations.Nullable;
+import org.junit.jupiter.api.Test;
+
+/** For {@link BuildIndexRowVersionChooser} testing. */
+public class BuildIndexRowVersionChooserTest extends IgniteAbstractTest {
+ private static final int TABLE_ID = 1;
+
+ private static final int PARTITION_ID = 0;
+
+ private static final long CREATE_INDEX_ACTIVATION_TS_MILLS = 100;
+
+ private static final long START_BUILDING_INDEX_ACTIVATION_TS_MILLS = 100;
Review Comment:
Is it ok they are the same? In reality they will always be different
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
Review Comment:
It looks like this javadoc can be improved, like 'obtains versions of a row to be indexed while building an index'
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
+class BuildIndexRowVersionChooser {
+ private final PartitionDataStorage storage;
+
+ /** Timestamp of activation of the catalog version in which the index created. */
Review Comment:
```suggestion
/** Timestamp of activation of the catalog version in which the index was created. */
```
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
+class BuildIndexRowVersionChooser {
+ private final PartitionDataStorage storage;
+
+ /** Timestamp of activation of the catalog version in which the index created. */
+ private final long createIndexActivationTs;
+
+ /** Timestamp of activation of the catalog version in which the index start building (get {@link CatalogIndexStatus#BUILDING}). */
+ private final long startBuildingIndexActivationTs;
+
+ /**
+ * Constructor.
+ *
+ * @param storage Multi-version partition storage.
+ * @param createIndexActivationTs Timestamp of activation of the catalog version in which the index created.
+ * @param startBuildingIndexActivationTs Timestamp of activation of the catalog version in which the index start building
+ * (get {@link CatalogIndexStatus#BUILDING}).
+ */
+ BuildIndexRowVersionChooser(PartitionDataStorage storage, long createIndexActivationTs, long startBuildingIndexActivationTs) {
+ this.storage = storage;
+ this.createIndexActivationTs = createIndexActivationTs;
+ this.startBuildingIndexActivationTs = startBuildingIndexActivationTs;
+ }
+
+ /**
+ * Collects binary versions of a row to build an index.
+ *
+ * <p>Index selection algorithm:</p>
+ * <ul>
+ * <li>For writeCommitted with commitTs > activationTs(BUILDING), we will ignore.</li>
+ * <li>For writeCommitted with commitTs <= activationTs(BUILDING), we will take the latest version.</li>
+ * <li>For writeIntent with beginTs >= activationTs(REGISTERED), we will ignore.</li>
+ * <li>For writeIntent with beginTs < activationTs(REGISTERED), we take.</li>
+ * </ul>
+ *
+ * @param rowId Row ID of interest.
+ */
+ List<BinaryRowAndRowId> chooseForBuildIndex(RowId rowId) {
+ try (Cursor<ReadResult> rowVersionCursor = storage.scanVersions(rowId)) {
+ List<BinaryRowAndRowId> result = new ArrayList<>();
+
+ boolean takenLatestVersionOfWriteCommitted = false;
+
+ for (ReadResult readResult : rowVersionCursor) {
+ if (readResult.isEmpty()) {
+ continue;
+ }
+
+ if (readResult.isWriteIntent()) {
+ if (beginTs(readResult) >= createIndexActivationTs) {
+ continue;
+ }
+ } else {
+ if (commitTs(readResult) > startBuildingIndexActivationTs) {
+ continue;
+ } else if (takenLatestVersionOfWriteCommitted) {
+ break;
+ } else {
+ takenLatestVersionOfWriteCommitted = true;
+ }
+ }
+
+ result.add(new BinaryRowAndRowId(readResult.binaryRow(), rowId));
Review Comment:
Here, the tuple is just added to the list, and information about whether it's a write intent or not is lost. We'll need to do Write Intent Resolution for write intents (which needs full `ReadResult`), so this will have to be added back later. How about returning `ReadResult` instead of `BinaryRow`?
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
+class BuildIndexRowVersionChooser {
+ private final PartitionDataStorage storage;
+
+ /** Timestamp of activation of the catalog version in which the index created. */
+ private final long createIndexActivationTs;
+
+ /** Timestamp of activation of the catalog version in which the index start building (get {@link CatalogIndexStatus#BUILDING}). */
+ private final long startBuildingIndexActivationTs;
+
+ /**
+ * Constructor.
+ *
+ * @param storage Multi-version partition storage.
+ * @param createIndexActivationTs Timestamp of activation of the catalog version in which the index created.
+ * @param startBuildingIndexActivationTs Timestamp of activation of the catalog version in which the index start building
+ * (get {@link CatalogIndexStatus#BUILDING}).
+ */
+ BuildIndexRowVersionChooser(PartitionDataStorage storage, long createIndexActivationTs, long startBuildingIndexActivationTs) {
+ this.storage = storage;
+ this.createIndexActivationTs = createIndexActivationTs;
+ this.startBuildingIndexActivationTs = startBuildingIndexActivationTs;
+ }
+
+ /**
+ * Collects binary versions of a row to build an index.
+ *
+ * <p>Index selection algorithm:</p>
+ * <ul>
+ * <li>For writeCommitted with commitTs > activationTs(BUILDING), we will ignore.</li>
+ * <li>For writeCommitted with commitTs <= activationTs(BUILDING), we will take the latest version.</li>
+ * <li>For writeIntent with beginTs >= activationTs(REGISTERED), we will ignore.</li>
+ * <li>For writeIntent with beginTs < activationTs(REGISTERED), we take.</li>
+ * </ul>
+ *
+ * @param rowId Row ID of interest.
+ */
+ List<BinaryRowAndRowId> chooseForBuildIndex(RowId rowId) {
+ try (Cursor<ReadResult> rowVersionCursor = storage.scanVersions(rowId)) {
+ List<BinaryRowAndRowId> result = new ArrayList<>();
+
+ boolean takenLatestVersionOfWriteCommitted = false;
+
+ for (ReadResult readResult : rowVersionCursor) {
+ if (readResult.isEmpty()) {
+ continue;
+ }
+
+ if (readResult.isWriteIntent()) {
+ if (beginTs(readResult) >= createIndexActivationTs) {
+ continue;
+ }
+ } else {
+ if (commitTs(readResult) > startBuildingIndexActivationTs) {
+ continue;
+ } else if (takenLatestVersionOfWriteCommitted) {
+ break;
Review Comment:
This check (and the break) can be moved after the `add()`, so prevent reading one extra `ReadResult` from the cursor
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
+class BuildIndexRowVersionChooser {
+ private final PartitionDataStorage storage;
+
+ /** Timestamp of activation of the catalog version in which the index created. */
+ private final long createIndexActivationTs;
+
+ /** Timestamp of activation of the catalog version in which the index start building (get {@link CatalogIndexStatus#BUILDING}). */
+ private final long startBuildingIndexActivationTs;
+
+ /**
+ * Constructor.
+ *
+ * @param storage Multi-version partition storage.
+ * @param createIndexActivationTs Timestamp of activation of the catalog version in which the index created.
+ * @param startBuildingIndexActivationTs Timestamp of activation of the catalog version in which the index start building
+ * (get {@link CatalogIndexStatus#BUILDING}).
+ */
+ BuildIndexRowVersionChooser(PartitionDataStorage storage, long createIndexActivationTs, long startBuildingIndexActivationTs) {
+ this.storage = storage;
+ this.createIndexActivationTs = createIndexActivationTs;
+ this.startBuildingIndexActivationTs = startBuildingIndexActivationTs;
+ }
+
+ /**
+ * Collects binary versions of a row to build an index.
+ *
+ * <p>Index selection algorithm:</p>
+ * <ul>
+ * <li>For writeCommitted with commitTs > activationTs(BUILDING), we will ignore.</li>
+ * <li>For writeCommitted with commitTs <= activationTs(BUILDING), we will take the latest version.</li>
+ * <li>For writeIntent with beginTs >= activationTs(REGISTERED), we will ignore.</li>
+ * <li>For writeIntent with beginTs < activationTs(REGISTERED), we take.</li>
+ * </ul>
+ *
+ * @param rowId Row ID of interest.
+ */
+ List<BinaryRowAndRowId> chooseForBuildIndex(RowId rowId) {
+ try (Cursor<ReadResult> rowVersionCursor = storage.scanVersions(rowId)) {
Review Comment:
How about adding a comment saying that the versions are iterated in the newest-to-oldest order, to make the code a bit more obvious?
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20117 Implement index backfill process [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3233:
URL: https://github.com/apache/ignite-3/pull/3233#discussion_r1497091010
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
+class BuildIndexRowVersionChooser {
+ private final PartitionDataStorage storage;
+
+ /** Timestamp of activation of the catalog version in which the index created. */
+ private final long createIndexActivationTs;
+
+ /** Timestamp of activation of the catalog version in which the index start building (get {@link CatalogIndexStatus#BUILDING}). */
+ private final long startBuildingIndexActivationTs;
+
+ /**
+ * Constructor.
+ *
+ * @param storage Multi-version partition storage.
+ * @param createIndexActivationTs Timestamp of activation of the catalog version in which the index created.
+ * @param startBuildingIndexActivationTs Timestamp of activation of the catalog version in which the index start building
+ * (get {@link CatalogIndexStatus#BUILDING}).
+ */
+ BuildIndexRowVersionChooser(PartitionDataStorage storage, long createIndexActivationTs, long startBuildingIndexActivationTs) {
+ this.storage = storage;
+ this.createIndexActivationTs = createIndexActivationTs;
+ this.startBuildingIndexActivationTs = startBuildingIndexActivationTs;
+ }
+
+ /**
+ * Collects binary versions of a row to build an index.
+ *
+ * <p>Index selection algorithm:</p>
+ * <ul>
+ * <li>For writeCommitted with commitTs > activationTs(BUILDING), we will ignore.</li>
+ * <li>For writeCommitted with commitTs <= activationTs(BUILDING), we will take the latest version.</li>
+ * <li>For writeIntent with beginTs >= activationTs(REGISTERED), we will ignore.</li>
+ * <li>For writeIntent with beginTs < activationTs(REGISTERED), we take.</li>
+ * </ul>
+ *
+ * @param rowId Row ID of interest.
+ */
+ List<BinaryRowAndRowId> chooseForBuildIndex(RowId rowId) {
+ try (Cursor<ReadResult> rowVersionCursor = storage.scanVersions(rowId)) {
Review Comment:
Add comment.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20117 Implement index backfill process [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3233:
URL: https://github.com/apache/ignite-3/pull/3233#discussion_r1497083449
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
+class BuildIndexRowVersionChooser {
+ private final PartitionDataStorage storage;
+
+ /** Timestamp of activation of the catalog version in which the index created. */
+ private final long createIndexActivationTs;
+
+ /** Timestamp of activation of the catalog version in which the index start building (get {@link CatalogIndexStatus#BUILDING}). */
+ private final long startBuildingIndexActivationTs;
+
+ /**
+ * Constructor.
+ *
+ * @param storage Multi-version partition storage.
+ * @param createIndexActivationTs Timestamp of activation of the catalog version in which the index created.
+ * @param startBuildingIndexActivationTs Timestamp of activation of the catalog version in which the index start building
+ * (get {@link CatalogIndexStatus#BUILDING}).
+ */
+ BuildIndexRowVersionChooser(PartitionDataStorage storage, long createIndexActivationTs, long startBuildingIndexActivationTs) {
+ this.storage = storage;
+ this.createIndexActivationTs = createIndexActivationTs;
+ this.startBuildingIndexActivationTs = startBuildingIndexActivationTs;
+ }
+
+ /**
+ * Collects binary versions of a row to build an index.
+ *
+ * <p>Index selection algorithm:</p>
+ * <ul>
+ * <li>For writeCommitted with commitTs > activationTs(BUILDING), we will ignore.</li>
+ * <li>For writeCommitted with commitTs <= activationTs(BUILDING), we will take the latest version.</li>
+ * <li>For writeIntent with beginTs >= activationTs(REGISTERED), we will ignore.</li>
+ * <li>For writeIntent with beginTs < activationTs(REGISTERED), we take.</li>
+ * </ul>
+ *
+ * @param rowId Row ID of interest.
+ */
+ List<BinaryRowAndRowId> chooseForBuildIndex(RowId rowId) {
+ try (Cursor<ReadResult> rowVersionCursor = storage.scanVersions(rowId)) {
+ List<BinaryRowAndRowId> result = new ArrayList<>();
+
+ boolean takenLatestVersionOfWriteCommitted = false;
+
+ for (ReadResult readResult : rowVersionCursor) {
+ if (readResult.isEmpty()) {
+ continue;
+ }
+
+ if (readResult.isWriteIntent()) {
+ if (beginTs(readResult) >= createIndexActivationTs) {
+ continue;
+ }
+ } else {
+ if (commitTs(readResult) > startBuildingIndexActivationTs) {
+ continue;
+ } else if (takenLatestVersionOfWriteCommitted) {
+ break;
+ } else {
+ takenLatestVersionOfWriteCommitted = true;
+ }
+ }
+
+ result.add(new BinaryRowAndRowId(readResult.binaryRow(), rowId));
Review Comment:
I think it's worth doing this later.
Adds TODOs.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20117 Implement index backfill process [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3233:
URL: https://github.com/apache/ignite-3/pull/3233#discussion_r1497077877
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/BinaryRowAndRowIdMatcher.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.ignite.internal.storage;
+
+import org.apache.ignite.internal.schema.BinaryRow;
+import org.apache.ignite.internal.schema.BinaryRowMatcher;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.Matchers;
+import org.hamcrest.TypeSafeMatcher;
+
+/** Matcher for comparing {@link BinaryRowAndRowId}s. */
+public class BinaryRowAndRowIdMatcher extends TypeSafeMatcher<BinaryRowAndRowId> {
+ private final RowId rowId;
+
+ private final Matcher<BinaryRow> binaryRowMatcher;
+
+ private BinaryRowAndRowIdMatcher(BinaryRowAndRowId exp) {
Review Comment:
apply it
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20117 Implement index backfill process [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3233:
URL: https://github.com/apache/ignite-3/pull/3233#discussion_r1497078956
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
+class BuildIndexRowVersionChooser {
+ private final PartitionDataStorage storage;
+
+ /** Timestamp of activation of the catalog version in which the index created. */
+ private final long createIndexActivationTs;
+
+ /** Timestamp of activation of the catalog version in which the index start building (get {@link CatalogIndexStatus#BUILDING}). */
+ private final long startBuildingIndexActivationTs;
+
+ /**
+ * Constructor.
+ *
+ * @param storage Multi-version partition storage.
+ * @param createIndexActivationTs Timestamp of activation of the catalog version in which the index created.
+ * @param startBuildingIndexActivationTs Timestamp of activation of the catalog version in which the index start building
+ * (get {@link CatalogIndexStatus#BUILDING}).
+ */
+ BuildIndexRowVersionChooser(PartitionDataStorage storage, long createIndexActivationTs, long startBuildingIndexActivationTs) {
+ this.storage = storage;
+ this.createIndexActivationTs = createIndexActivationTs;
+ this.startBuildingIndexActivationTs = startBuildingIndexActivationTs;
+ }
+
+ /**
+ * Collects binary versions of a row to build an index.
+ *
+ * <p>Index selection algorithm:</p>
+ * <ul>
+ * <li>For writeCommitted with commitTs > activationTs(BUILDING), we will ignore.</li>
+ * <li>For writeCommitted with commitTs <= activationTs(BUILDING), we will take the latest version.</li>
Review Comment:
fix it
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20117 Implement index backfill process [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3233:
URL: https://github.com/apache/ignite-3/pull/3233#discussion_r1497089113
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
+class BuildIndexRowVersionChooser {
+ private final PartitionDataStorage storage;
+
+ /** Timestamp of activation of the catalog version in which the index created. */
+ private final long createIndexActivationTs;
+
+ /** Timestamp of activation of the catalog version in which the index start building (get {@link CatalogIndexStatus#BUILDING}). */
+ private final long startBuildingIndexActivationTs;
+
+ /**
+ * Constructor.
+ *
+ * @param storage Multi-version partition storage.
+ * @param createIndexActivationTs Timestamp of activation of the catalog version in which the index created.
+ * @param startBuildingIndexActivationTs Timestamp of activation of the catalog version in which the index start building
+ * (get {@link CatalogIndexStatus#BUILDING}).
+ */
+ BuildIndexRowVersionChooser(PartitionDataStorage storage, long createIndexActivationTs, long startBuildingIndexActivationTs) {
+ this.storage = storage;
+ this.createIndexActivationTs = createIndexActivationTs;
+ this.startBuildingIndexActivationTs = startBuildingIndexActivationTs;
+ }
+
+ /**
+ * Collects binary versions of a row to build an index.
+ *
+ * <p>Index selection algorithm:</p>
+ * <ul>
+ * <li>For writeCommitted with commitTs > activationTs(BUILDING), we will ignore.</li>
+ * <li>For writeCommitted with commitTs <= activationTs(BUILDING), we will take the latest version.</li>
+ * <li>For writeIntent with beginTs >= activationTs(REGISTERED), we will ignore.</li>
+ * <li>For writeIntent with beginTs < activationTs(REGISTERED), we take.</li>
+ * </ul>
+ *
+ * @param rowId Row ID of interest.
+ */
+ List<BinaryRowAndRowId> chooseForBuildIndex(RowId rowId) {
+ try (Cursor<ReadResult> rowVersionCursor = storage.scanVersions(rowId)) {
+ List<BinaryRowAndRowId> result = new ArrayList<>();
+
+ boolean takenLatestVersionOfWriteCommitted = false;
+
+ for (ReadResult readResult : rowVersionCursor) {
+ if (readResult.isEmpty()) {
+ continue;
+ }
+
+ if (readResult.isWriteIntent()) {
+ if (beginTs(readResult) >= createIndexActivationTs) {
+ continue;
+ }
+ } else {
+ if (commitTs(readResult) > startBuildingIndexActivationTs) {
+ continue;
+ } else if (takenLatestVersionOfWriteCommitted) {
+ break;
Review Comment:
Why not
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20117 Implement index backfill process [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3233:
URL: https://github.com/apache/ignite-3/pull/3233#discussion_r1497079477
##########
modules/table/src/test/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooserTest.java:
##########
@@ -0,0 +1,235 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.hlc.HybridTimestamp.hybridTimestamp;
+import static org.apache.ignite.internal.storage.BinaryRowAndRowIdMatcher.equalToBinaryRowAndRowId;
+import static org.apache.ignite.internal.storage.RowId.lowestRowId;
+import static org.apache.ignite.internal.tx.TransactionIds.transactionId;
+import static org.apache.ignite.internal.type.NativeTypes.INT32;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.empty;
+import static org.mockito.Mockito.spy;
+
+import java.util.UUID;
+import org.apache.ignite.distributed.TestPartitionDataStorage;
+import org.apache.ignite.internal.schema.BinaryRow;
+import org.apache.ignite.internal.schema.Column;
+import org.apache.ignite.internal.schema.SchemaDescriptor;
+import org.apache.ignite.internal.schema.row.RowAssembler;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.MvPartitionStorage;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.storage.impl.TestMvPartitionStorage;
+import org.apache.ignite.internal.testframework.IgniteAbstractTest;
+import org.hamcrest.Matcher;
+import org.jetbrains.annotations.Nullable;
+import org.junit.jupiter.api.Test;
+
+/** For {@link BuildIndexRowVersionChooser} testing. */
+public class BuildIndexRowVersionChooserTest extends IgniteAbstractTest {
+ private static final int TABLE_ID = 1;
+
+ private static final int PARTITION_ID = 0;
+
+ private static final long CREATE_INDEX_ACTIVATION_TS_MILLS = 100;
+
+ private static final long START_BUILDING_INDEX_ACTIVATION_TS_MILLS = 100;
Review Comment:
Fix it
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20117 Implement index backfill process [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3233:
URL: https://github.com/apache/ignite-3/pull/3233#discussion_r1497081583
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/BuildIndexRowVersionChooser.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.ignite.internal.table.distributed.raft;
+
+import static org.apache.ignite.internal.tx.TransactionIds.beginTimestamp;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.internal.catalog.descriptors.CatalogIndexStatus;
+import org.apache.ignite.internal.storage.BinaryRowAndRowId;
+import org.apache.ignite.internal.storage.ReadResult;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
+
+/** {@link BinaryRowAndRowId} chooser for index building. */
Review Comment:
Apply it
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20117 Implement index backfill process [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill merged PR #3233:
URL: https://github.com/apache/ignite-3/pull/3233
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org