Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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
*
* https://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.accumulo.server.metadata;

import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.Filter;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.DeletesSection.SkewedKeyValue;

public class GcCandidateFilter extends Filter {

@Override
public boolean accept(Key k, Value v) {
return v.equals(SkewedKeyValue.NAME);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
Expand All @@ -60,7 +61,6 @@
import org.apache.accumulo.core.metadata.schema.ExternalCompactionId;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.BlipSection;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.DeletesSection;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.DeletesSection.SkewedKeyValue;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.ExternalCompactionSection;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.ScanServerFileReferenceSection;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.BulkFileColumnFamily;
Expand Down Expand Up @@ -270,7 +270,8 @@ public Iterator<GcCandidate> getGcCandidates(DataLevel level) {
throw new RuntimeException(e);
}
scanner.setRange(range);
return scanner.stream().filter(entry -> entry.getValue().equals(SkewedKeyValue.NAME))
scanner.addScanIterator(new IteratorSetting(25, "gcCandidate", GcCandidateFilter.class));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we keeping track of the system iterator priorities being used?

I see the default value of the versioning iterator being set at 20, but that's just a hardcoded value.

props.put(Property.TABLE_ITERATOR_PREFIX + iterScope.name() + ".vers",
"20," + VersioningIterator.class.getName());

Wondering if that initial value of 20 should be refactored into a system constant of DEFAULT_ITERATOR_PRIORITY.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we keeping track of the system iterator priorities being used?

I don't think there is a constant in 2.1, there might be a constant in 4.0. I can look for that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing a constant. I see a literal 20 being used in main in IteratorConfigUtil.getInitialTableIteratorSettings

return scanner.stream()
.map(
entry -> new GcCandidate(DeletesSection.decodeRow(entry.getKey().getRow().toString()),
entry.getKey().getTimestamp()))
Expand Down
2 changes: 1 addition & 1 deletion server/gc/src/main/java/org/apache/accumulo/gc/GCRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public List<GcCandidate> readCandidatesThatFitInMemory(Iterator<GcCandidate> can
// Converting the bytes to approximate number of characters for batch size.
long candidateBatchSize = getCandidateBatchSize() / 2;

List<GcCandidate> candidatesBatch = new ArrayList<>();
List<GcCandidate> candidatesBatch = new ArrayList<>(256);
Comment thread
ddanielr marked this conversation as resolved.
batchCount.incrementAndGet();

while (candidates.hasNext()) {
Expand Down