You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2019/04/29 11:53:19 UTC
[GitHub] [ignite] ibessonov commented on a change in pull request #6497:
IGNITE-11782 WAL iterator for collect per-pageId info
ibessonov commented on a change in pull request #6497: IGNITE-11782 WAL iterator for collect per-pageId info
URL: https://github.com/apache/ignite/pull/6497#discussion_r279316521
##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/WalFilters.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.processors.cache.persistence.wal.reader;
+
+import java.util.Set;
+import java.util.function.Predicate;
+import org.apache.ignite.internal.pagemem.wal.WALPointer;
+import org.apache.ignite.internal.pagemem.wal.record.CheckpointRecord;
+import org.apache.ignite.internal.pagemem.wal.record.PageSnapshot;
+import org.apache.ignite.internal.pagemem.wal.record.WALRecord;
+import org.apache.ignite.internal.pagemem.wal.record.delta.PageDeltaRecord;
+import org.apache.ignite.lang.IgniteBiTuple;
+
+/**
+ * Class for holding only very basic WAL filters for using in {@link FilteredWalIterator}. *
+ */
+public class WalFilters {
+ /**
+ * Filtering all checkpoint records.
+ *
+ * @return Predicate for filtering checkpoint records.
+ */
+ public static Predicate<IgniteBiTuple<WALPointer, WALRecord>> checkpoint() {
+ return record -> record.get2() instanceof CheckpointRecord;
+ }
+
+ /**
+ * Filtering all records whose pageId is contained in pageOwnerIds.
+ *
+ * @param pageOwnerIds Page id for filtering.
+ * @return Predicate for filtering record from pageOwnerIds.
+ */
+ public static Predicate<IgniteBiTuple<WALPointer, WALRecord>> pageOwner(Set<Long> pageOwnerIds) {
Review comment:
Are there any expectations about how many page ids are going to be in this set? I don't really like that they all boxed and that "contains" method will also box all parameters.
Can it lead to some problems?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services