You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2015/08/10 16:23:37 UTC

svn commit: r1695084 - in /lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common: cloud/ZkStateReader.java util/Pair.java

Author: markrmiller
Date: Mon Aug 10 14:23:37 2015
New Revision: 1695084

URL: http://svn.apache.org/r1695084
Log:
SOLR-7757: Take random public static Pair class out of ZkStateReader and move it to a Util location.

Added:
    lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/util/Pair.java   (with props)
Modified:
    lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java

Modified: lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java?rev=1695084&r1=1695083&r2=1695084&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java (original)
+++ lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java Mon Aug 10 14:23:37 2015
@@ -37,6 +37,7 @@ import java.util.concurrent.TimeUnit;
 import org.apache.solr.common.Callable;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrException.ErrorCode;
+import org.apache.solr.common.util.Pair;
 import org.apache.solr.common.util.Utils;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
@@ -375,27 +376,6 @@ public class ZkStateReader implements Cl
     }
   }
 
-  //todo remove when we move to java 8
-  static public class Pair<K, V> implements Serializable {
-    private K key;
-
-    public K getKey() {
-      return key;
-    }
-
-    private V value;
-
-    public V getValue() {
-      return value;
-    }
-
-    public Pair(K key, V value) {
-      this.key = key;
-      this.value = value;
-    }
-  }
-
-
   private void addSecuritynodeWatcher(final String path, final Callable<Pair<byte[], Stat>> callback)
       throws KeeperException, InterruptedException {
     zkClient.exists(SOLR_SECURITY_CONF_PATH,

Added: lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/util/Pair.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/util/Pair.java?rev=1695084&view=auto
==============================================================================
--- lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/util/Pair.java (added)
+++ lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/util/Pair.java Mon Aug 10 14:23:37 2015
@@ -0,0 +1,39 @@
+package org.apache.solr.common.util;
+
+/*
+ * 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.
+ */
+
+import java.io.Serializable;
+
+public class Pair<K, V> implements Serializable {
+  private K key;
+
+  public K getKey() {
+    return key;
+  }
+
+  private V value;
+
+  public V getValue() {
+    return value;
+  }
+
+  public Pair(K key, V value) {
+    this.key = key;
+    this.value = value;
+  }
+}
\ No newline at end of file