You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2021/03/10 09:56:01 UTC

[lucene] 05/42: use Long instead of UUID

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

dweiss pushed a commit to branch jira/solr14155-1
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 9bc2221d59e328068586486d70ef6604ee994864
Author: noblepaul <no...@gmail.com>
AuthorDate: Sun Jul 12 22:21:54 2020 +1000

    use Long instead of UUID
---
 solr/core/src/java/org/apache/solr/core/CoreContainer.java | 4 ++--
 solr/core/src/java/org/apache/solr/core/SolrCore.java      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
index 82cb11f..19127ce 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
@@ -1592,14 +1592,14 @@ public class CoreContainer {
    * @param name the name of the SolrCore to reload
    * @param coreId The unique identifier of the core
    */
-  public void reload(String name, UUID coreId) {
+  public void reload(String name, Long coreId) {
     if (isShutDown) {
       throw new AlreadyClosedException();
     }
     SolrCore newCore = null;
     SolrCore core = solrCores.getCoreFromAnyList(name, false);
     if (core != null) {
-      if(coreId != null && core.uniqueId != coreId) {
+      if(coreId != null && core.uniqueId.longValue() != coreId) {
         //trying to reload an already unloaded core
         return;
       }
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java
index 3c6fd2a..085da91 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java
@@ -180,7 +180,7 @@ public final class SolrCore implements SolrInfoBean, Closeable {
    * A unique id to differentiate multiple instances of the same core
    * If we reload a core, the name remains same , but the id will be new
    */
-  public final UUID uniqueId = UUID.randomUUID();
+  public final Long uniqueId = System.nanoTime();
 
   private boolean isReloaded = false;