incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [01/17] git commit: Extracted an interface from the layout system.
Date Fri, 16 Aug 2013 20:09:00 GMT
Updated Branches:
  refs/heads/master 6f7f71a4d -> 72a0be2d1


Extracted an interface from the layout system.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/14e45320
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/14e45320
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/14e45320

Branch: refs/heads/master
Commit: 14e453209363eae5240dab888b0ff8f858e76e98
Parents: 6f7f71a
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Fri Aug 16 09:12:10 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Fri Aug 16 09:12:10 2013 -0400

----------------------------------------------------------------------
 .../indexserver/DistributedIndexServer.java     |  4 ++--
 .../manager/indexserver/DistributedLayout.java  | 25 ++++++++++++++++++++
 .../indexserver/DistributedLayoutManager.java   |  3 ++-
 3 files changed, 29 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/14e45320/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java
b/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java
index f85fb76..4c836c6 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java
@@ -97,7 +97,7 @@ public class DistributedIndexServer extends AbstractIndexServer {
 
   private Map<String, TableDescriptor> _tableDescriptors = new ConcurrentHashMap<String,
TableDescriptor>();
   private Map<String, Similarity> _tableSimilarity = new ConcurrentHashMap<String,
Similarity>();
-  private Map<String, DistributedLayoutManager> _layoutManagers = new ConcurrentHashMap<String,
DistributedLayoutManager>();
+  private Map<String, DistributedLayout> _layoutManagers = new ConcurrentHashMap<String,
DistributedLayout>();
   private Map<String, Set<String>> _layoutCache = new ConcurrentHashMap<String,
Set<String>>();
   private ConcurrentHashMap<String, Map<String, BlurIndex>> _indexes = new ConcurrentHashMap<String,
Map<String, BlurIndex>>();
   private final ShardStateManager _shardStateManager = new ShardStateManager();
@@ -544,7 +544,7 @@ public class DistributedIndexServer extends AbstractIndexServer {
     if (tableStatus == TABLE_STATUS.DISABLED) {
       return new HashSet<String>();
     }
-    DistributedLayoutManager layoutManager = _layoutManagers.get(table);
+    DistributedLayout layoutManager = _layoutManagers.get(table);
     if (layoutManager == null) {
       return setupLayoutManager(table);
     } else {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/14e45320/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedLayout.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedLayout.java
b/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedLayout.java
new file mode 100644
index 0000000..e21f21a
--- /dev/null
+++ b/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedLayout.java
@@ -0,0 +1,25 @@
+package org.apache.blur.manager.indexserver;
+
+/**
+ * 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.util.Map;
+
+public interface DistributedLayout {
+
+  Map<String, String> getLayout();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/14e45320/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedLayoutManager.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedLayoutManager.java
b/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedLayoutManager.java
index 293f957..f5b928d 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedLayoutManager.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedLayoutManager.java
@@ -27,7 +27,7 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.Map.Entry;
 
-public class DistributedLayoutManager {
+public class DistributedLayoutManager implements DistributedLayout {
 
   private static final SortedSet<String> EMPTY_SORTED_SET = new TreeSet<String>();
 
@@ -85,6 +85,7 @@ public class DistributedLayoutManager {
     return Math.abs(hash % size);
   }
 
+  @Override
   public Map<String, String> getLayout() {
     return cache;
   }


Mime
View raw message