incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [3/4] Massive changes to the map reduce code, working on BLUR-83.
Date Tue, 14 May 2013 16:27:10 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e3699254/src/blur-store/src/main/java/org/apache/blur/store/hdfs/DirectoryDecorator.java
----------------------------------------------------------------------
diff --git a/src/blur-store/src/main/java/org/apache/blur/store/hdfs/DirectoryDecorator.java
b/src/blur-store/src/main/java/org/apache/blur/store/hdfs/DirectoryDecorator.java
new file mode 100644
index 0000000..e1ab445
--- /dev/null
+++ b/src/blur-store/src/main/java/org/apache/blur/store/hdfs/DirectoryDecorator.java
@@ -0,0 +1,9 @@
+package org.apache.blur.store.hdfs;
+
+import org.apache.lucene.store.Directory;
+
+public interface DirectoryDecorator {
+  
+  Directory getOriginalDirectory();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e3699254/src/blur-store/src/main/java/org/apache/blur/store/hdfs/HdfsDirectory.java
----------------------------------------------------------------------
diff --git a/src/blur-store/src/main/java/org/apache/blur/store/hdfs/HdfsDirectory.java b/src/blur-store/src/main/java/org/apache/blur/store/hdfs/HdfsDirectory.java
index f9cbefa..050ba6d 100644
--- a/src/blur-store/src/main/java/org/apache/blur/store/hdfs/HdfsDirectory.java
+++ b/src/blur-store/src/main/java/org/apache/blur/store/hdfs/HdfsDirectory.java
@@ -31,7 +31,6 @@ import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
-import org.apache.blur.store.blockcache.BlockDirectory;
 import org.apache.blur.store.buffer.ReusedBufferedIndexInput;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataInputStream;
@@ -296,6 +295,10 @@ public class HdfsDirectory extends Directory {
   public void close() throws IOException {
 
   }
+  
+  public Path getPath() {
+    return path;
+  }
 
   private Path getPath(String name) {
     return new Path(path, name);
@@ -312,18 +315,15 @@ public class HdfsDirectory extends Directory {
 
   @Override
   public void copy(Directory to, String src, String dest, IOContext context) throws IOException
{
-    if (to instanceof HdfsDirectory) {
+    if (to instanceof DirectoryDecorator) {
+      copy(((DirectoryDecorator) to).getOriginalDirectory(), src, dest, context);
+    } else if (to instanceof HdfsDirectory) {
       if (quickMove(to, src, dest, context)) {
         return;
       }
-    } else if (to instanceof BlockDirectory) {
-      BlockDirectory bd = (BlockDirectory) to;
-      Directory inner = bd.getDirectory();
-      if (quickMove(inner, src, dest, context)) {
-        return;
-      }
+    } else {
+      super.copy(to, src, dest, context);
     }
-    super.copy(to, src, dest, context);
   }
 
   private boolean quickMove(Directory to, String src, String dest, IOContext context) throws
IOException {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e3699254/src/pom.xml
----------------------------------------------------------------------
diff --git a/src/pom.xml b/src/pom.xml
index ac23f57..f4049a7 100644
--- a/src/pom.xml
+++ b/src/pom.xml
@@ -55,6 +55,7 @@ under the License.
 		<metrics-graphite.version>2.2.0</metrics-graphite.version>
 		<mockito.version>1.9.0</mockito.version>
 		<json.version>20090211</json.version>
+		<mrunit.version>0.8.0-incubating</mrunit.version>
 	</properties>
 
 	<modules>


Mime
View raw message