lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [lucene-solr] 20/36: Rename ResourceContext to ManagedContext.
Date Wed, 18 Dec 2019 16:38:58 GMT
This is an automated email from the ASF dual-hosted git repository.

ab pushed a commit to branch jira/solr-13579
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit f06fae4d1819787277b3cb7fdb5f156d9170e515
Author: Andrzej Bialecki <ab@apache.org>
AuthorDate: Thu Jul 25 18:09:13 2019 +0200

    Rename ResourceContext to ManagedContext.
---
 .../java/org/apache/solr/managed/DefaultResourceManagerPool.java   | 4 ++--
 solr/core/src/java/org/apache/solr/managed/ManagedComponent.java   | 2 +-
 .../solr/managed/{ResourceContext.java => ManagedContext.java}     | 2 +-
 .../core/src/java/org/apache/solr/managed/NoOpResourceManager.java | 2 +-
 .../core/src/java/org/apache/solr/managed/ResourceManagerPool.java | 2 +-
 solr/core/src/java/org/apache/solr/search/FastLRUCache.java        | 7 +++++++
 solr/core/src/java/org/apache/solr/search/LFUCache.java            | 7 +++++++
 solr/core/src/java/org/apache/solr/search/LRUCache.java            | 7 +++++++
 8 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/managed/DefaultResourceManagerPool.java b/solr/core/src/java/org/apache/solr/managed/DefaultResourceManagerPool.java
index b966336..efe892d 100644
--- a/solr/core/src/java/org/apache/solr/managed/DefaultResourceManagerPool.java
+++ b/solr/core/src/java/org/apache/solr/managed/DefaultResourceManagerPool.java
@@ -43,7 +43,7 @@ public class DefaultResourceManagerPool implements ResourceManagerPool {
   private final String name;
   private final ResourceManagerPlugin resourceManagerPlugin;
   private final Map<String, Object> args;
-  private final ResourceContext poolContext = new ResourceContext();
+  private final ManagedContext poolContext = new ManagedContext();
   private Map<String, Float> totalValues = null;
   private final ReentrantLock updateLock = new ReentrantLock();
   int scheduleDelaySeconds;
@@ -164,7 +164,7 @@ public class DefaultResourceManagerPool implements ResourceManagerPool
{
   }
 
   @Override
-  public ResourceContext getPoolContext() {
+  public ManagedContext getPoolContext() {
     return poolContext;
   }
 
diff --git a/solr/core/src/java/org/apache/solr/managed/ManagedComponent.java b/solr/core/src/java/org/apache/solr/managed/ManagedComponent.java
index c8d3dba..2b9e6b8 100644
--- a/solr/core/src/java/org/apache/solr/managed/ManagedComponent.java
+++ b/solr/core/src/java/org/apache/solr/managed/ManagedComponent.java
@@ -83,5 +83,5 @@ public interface ManagedComponent {
    * Component context used for managing additional component state.
    * @return component's context
    */
-  ResourceContext getManagedContext();
+  ManagedContext getManagedContext();
 }
diff --git a/solr/core/src/java/org/apache/solr/managed/ResourceContext.java b/solr/core/src/java/org/apache/solr/managed/ManagedContext.java
similarity index 92%
rename from solr/core/src/java/org/apache/solr/managed/ResourceContext.java
rename to solr/core/src/java/org/apache/solr/managed/ManagedContext.java
index 0c8e5a3..74919ee 100644
--- a/solr/core/src/java/org/apache/solr/managed/ResourceContext.java
+++ b/solr/core/src/java/org/apache/solr/managed/ManagedContext.java
@@ -21,6 +21,6 @@ import java.util.concurrent.ConcurrentHashMap;
 /**
  *
  */
-public class ResourceContext extends ConcurrentHashMap<String, Object> {
+public class ManagedContext extends ConcurrentHashMap<String, Object> {
 
 }
diff --git a/solr/core/src/java/org/apache/solr/managed/NoOpResourceManager.java b/solr/core/src/java/org/apache/solr/managed/NoOpResourceManager.java
index cd94afe..e2e12eb 100644
--- a/solr/core/src/java/org/apache/solr/managed/NoOpResourceManager.java
+++ b/solr/core/src/java/org/apache/solr/managed/NoOpResourceManager.java
@@ -84,7 +84,7 @@ public class NoOpResourceManager extends ResourceManager {
     }
 
     @Override
-    public ResourceContext getPoolContext() {
+    public ManagedContext getPoolContext() {
       return null;
     }
 
diff --git a/solr/core/src/java/org/apache/solr/managed/ResourceManagerPool.java b/solr/core/src/java/org/apache/solr/managed/ResourceManagerPool.java
index 3a3bd78..783dc99 100644
--- a/solr/core/src/java/org/apache/solr/managed/ResourceManagerPool.java
+++ b/solr/core/src/java/org/apache/solr/managed/ResourceManagerPool.java
@@ -49,5 +49,5 @@ public interface ResourceManagerPool extends Runnable, Closeable {
   /**
    * Pool context used for managing additional pool state.
    */
-  ResourceContext getPoolContext();
+  ManagedContext getPoolContext();
 }
diff --git a/solr/core/src/java/org/apache/solr/search/FastLRUCache.java b/solr/core/src/java/org/apache/solr/search/FastLRUCache.java
index 3f40135..2fb9ada 100644
--- a/solr/core/src/java/org/apache/solr/search/FastLRUCache.java
+++ b/solr/core/src/java/org/apache/solr/search/FastLRUCache.java
@@ -21,6 +21,7 @@ import org.apache.lucene.util.Accountable;
 import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.managed.ManagedComponentId;
+import org.apache.solr.managed.ManagedContext;
 import org.apache.solr.managed.plugins.CacheManagerPlugin;
 import org.apache.solr.metrics.MetricsMap;
 import org.apache.solr.metrics.SolrMetricManager;
@@ -83,6 +84,7 @@ public class FastLRUCache<K, V> extends SolrCacheBase implements SolrCache<K,V>,
   private Set<String> metricNames = ConcurrentHashMap.newKeySet();
   private MetricRegistry registry;
   private ManagedComponentId managedComponentId;
+  private final ManagedContext managedContext = new ManagedContext();
 
   @Override
   public Object init(Map args, Object persistence, CacheRegenerator regenerator) {
@@ -354,6 +356,11 @@ public class FastLRUCache<K, V> extends SolrCacheBase implements
SolrCache<K,V>,
   }
 
   @Override
+  public ManagedContext getManagedContext() {
+    return managedContext;
+  }
+
+  @Override
   public ManagedComponentId getManagedComponentId() {
     return managedComponentId;
   }
diff --git a/solr/core/src/java/org/apache/solr/search/LFUCache.java b/solr/core/src/java/org/apache/solr/search/LFUCache.java
index a4dd8ff..28decac 100644
--- a/solr/core/src/java/org/apache/solr/search/LFUCache.java
+++ b/solr/core/src/java/org/apache/solr/search/LFUCache.java
@@ -32,6 +32,7 @@ import org.apache.lucene.util.Accountable;
 import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.managed.ManagedComponentId;
+import org.apache.solr.managed.ManagedContext;
 import org.apache.solr.managed.plugins.CacheManagerPlugin;
 import org.apache.solr.metrics.MetricsMap;
 import org.apache.solr.metrics.SolrMetricManager;
@@ -84,6 +85,7 @@ public class LFUCache<K, V> implements SolrCache<K, V>, Accountable
{
   private Set<String> metricNames = ConcurrentHashMap.newKeySet();
   private MetricRegistry registry;
   private ManagedComponentId managedComponentId;
+  private final ManagedContext managedContext = new ManagedContext();
 
   private int maxSize;
   private int minSize;
@@ -353,6 +355,11 @@ public class LFUCache<K, V> implements SolrCache<K, V>, Accountable
{
   }
 
   @Override
+  public ManagedContext getManagedContext() {
+    return managedContext;
+  }
+
+  @Override
   public ManagedComponentId getManagedComponentId() {
     return managedComponentId;
   }
diff --git a/solr/core/src/java/org/apache/solr/search/LRUCache.java b/solr/core/src/java/org/apache/solr/search/LRUCache.java
index c62d4fd..b4669bc 100644
--- a/solr/core/src/java/org/apache/solr/search/LRUCache.java
+++ b/solr/core/src/java/org/apache/solr/search/LRUCache.java
@@ -34,6 +34,7 @@ import org.apache.lucene.util.Accountables;
 import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.managed.ManagedComponentId;
+import org.apache.solr.managed.ManagedContext;
 import org.apache.solr.managed.plugins.CacheManagerPlugin;
 import org.apache.solr.metrics.MetricsMap;
 import org.apache.solr.metrics.SolrMetricManager;
@@ -82,6 +83,7 @@ public class LRUCache<K,V> extends SolrCacheBase implements SolrCache<K,V>,
Acco
   private int maxSize;
   private int initialSize;
   private ManagedComponentId managedComponentId;
+  private final ManagedContext managedContext = new ManagedContext();
 
   private long maxRamBytes = Long.MAX_VALUE;
   // The synchronization used for the map will be used to update this,
@@ -386,6 +388,11 @@ public class LRUCache<K,V> extends SolrCacheBase implements SolrCache<K,V>,
Acco
   }
 
   @Override
+  public ManagedContext getManagedContext() {
+    return managedContext;
+  }
+
+  @Override
   public ManagedComponentId getManagedComponentId() {
     return managedComponentId;
   }


Mime
View raw message