accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1326682 - /accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java
Date Mon, 16 Apr 2012 16:56:02 GMT
Author: ecn
Date: Mon Apr 16 16:56:01 2012
New Revision: 1326682

URL: http://svn.apache.org/viewvc?rev=1326682&view=rev
Log:
ACCUMULO-536 use all keys if we have to reduce files

Modified:
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java?rev=1326682&r1=1326681&r2=1326682&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java Mon Apr
16 16:56:01 2012
@@ -105,7 +105,6 @@ public class FileUtil {
       return paths;
     
     String newDir = String.format("%s/pass_%04d", tmpDir, pass);
-    fs.mkdirs(new Path(newDir));
     
     int start = 0;
     
@@ -119,13 +118,12 @@ public class FileUtil {
       
       start = end;
       
-      String newMapFile = String.format("%s/" + RFile.EXTENSION + "_%04d", newDir, count++);
-      fs.mkdirs(new Path(newMapFile));
+      String newMapFile = String.format("%s/%04d." + RFile.EXTENSION, newDir, count++);
       
-      String outFile = String.format("%s/index", newMapFile);
       outFiles.add(newMapFile);
       
-      FileSKVWriter writer = new RFileOperations().openWriter(outFile, fs, conf, acuConf);
+      FileSKVWriter writer = new RFileOperations().openWriter(newMapFile, fs, conf, acuConf);
+      writer.startDefaultLocalityGroup();
       List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<SortedKeyValueIterator<Key,Value>>(inFiles.size());
       
       FileSKVIterator reader = null;
@@ -291,7 +289,7 @@ public class FileUtil {
       
       long numKeys = 0;
       
-      numKeys = countIndexEntries(acuConf, prevEndRow, endRow, mapFiles, useIndex, conf,
fs, readers);
+      numKeys = countIndexEntries(acuConf, prevEndRow, endRow, mapFiles, tmpDir == null ?
useIndex : false, conf, fs, readers);
       
       if (numKeys == 0) {
         if (useIndex) {



Mime
View raw message