You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by dl...@apache.org on 2022/12/19 15:59:38 UTC

[accumulo] branch 2.1 updated: Added TABLE_MINC_OUTPUT_DROP_CACHE to drop cache for minc (#3123)

This is an automated email from the ASF dual-hosted git repository.

dlmarion pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new 04aa38cc75 Added TABLE_MINC_OUTPUT_DROP_CACHE to drop cache for minc (#3123)
04aa38cc75 is described below

commit 04aa38cc75daf5cd00a8508ce2c80f91a0fa7262
Author: Dave Marion <dl...@apache.org>
AuthorDate: Mon Dec 19 10:59:32 2022 -0500

    Added TABLE_MINC_OUTPUT_DROP_CACHE to drop cache for minc (#3123)
    
    Added new property allowing user to drop cache behind minor compaction
    output file (defaults to false).
---
 .../main/java/org/apache/accumulo/core/conf/Property.java    |  5 +++++
 .../org/apache/accumulo/server/compaction/FileCompactor.java | 12 +++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
index 0b74ddb79e..b6e3597438 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
@@ -964,6 +964,11 @@ public enum Property {
       "1.3.5"),
   TABLE_ARBITRARY_PROP_PREFIX("table.custom.", null, PropertyType.PREFIX,
       "Prefix to be used for user defined arbitrary properties.", "1.7.0"),
+  TABLE_MINC_OUTPUT_DROP_CACHE("table.compaction.minor.output.drop.cache", "false",
+      PropertyType.BOOLEAN,
+      "Setting this property to true will call"
+          + "FSDataOutputStream.setDropBehind(true) on the minor compaction output stream.",
+      "2.1.1"),
   TABLE_MAJC_OUTPUT_DROP_CACHE("table.compaction.major.output.drop.cache", "false",
       PropertyType.BOOLEAN,
       "Setting this property to true will call"
diff --git a/server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java b/server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java
index a7e879dc8b..27eef8def0 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java
@@ -45,6 +45,7 @@ import org.apache.accumulo.core.file.FileOperations;
 import org.apache.accumulo.core.file.FileOperations.WriterBuilder;
 import org.apache.accumulo.core.file.FileSKVIterator;
 import org.apache.accumulo.core.file.FileSKVWriter;
+import org.apache.accumulo.core.iterators.IteratorUtil;
 import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.iteratorsImpl.IteratorConfigUtil;
@@ -217,14 +218,17 @@ public class FileCompactor implements Callable<CompactionStats> {
       FileOperations fileFactory = FileOperations.getInstance();
       FileSystem ns = this.fs.getFileSystemByPath(outputFile.getPath());
 
-      boolean dropCacheBehindMajcOutput = !RootTable.ID.equals(this.extent.tableId())
+      final boolean isMinC = env.getIteratorScope() == IteratorUtil.IteratorScope.minc;
+
+      final boolean dropCacheBehindOutput = !RootTable.ID.equals(this.extent.tableId())
           && !MetadataTable.ID.equals(this.extent.tableId())
-          && acuTableConf.getBoolean(Property.TABLE_MAJC_OUTPUT_DROP_CACHE);
+          && ((isMinC && acuTableConf.getBoolean(Property.TABLE_MINC_OUTPUT_DROP_CACHE))
+              || (!isMinC && acuTableConf.getBoolean(Property.TABLE_MAJC_OUTPUT_DROP_CACHE)));
 
       WriterBuilder outBuilder = fileFactory.newWriterBuilder()
           .forFile(outputFile.getMetaInsert(), ns, ns.getConf(), cryptoService)
           .withTableConfiguration(acuTableConf).withRateLimiter(env.getWriteLimiter());
-      if (dropCacheBehindMajcOutput) {
+      if (dropCacheBehindOutput) {
         outBuilder.dropCachesBehind();
       }
       mfw = outBuilder.build();
@@ -388,8 +392,6 @@ public class FileCompactor implements Callable<CompactionStats> {
           DeletingIterator.wrap(citr, propagateDeletes, DeletingIterator.getBehavior(acuTableConf));
       ColumnFamilySkippingIterator cfsi = new ColumnFamilySkippingIterator(delIter);
 
-      // if(env.getIteratorScope() )
-
       SystemIteratorEnvironment iterEnv =
           env.createIteratorEnv(context, acuTableConf, getExtent().tableId());