accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1186870 - /incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java
Date Thu, 20 Oct 2011 15:55:39 GMT
Author: kturner
Date: Thu Oct 20 15:55:39 2011
New Revision: 1186870

URL: http://svn.apache.org/viewvc?rev=1186870&view=rev
Log:
ACCUMULO-52 handle bulk import of empty files

Modified:
    incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java?rev=1186870&r1=1186869&r2=1186870&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java
(original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java
Thu Oct 20 15:55:39 2011
@@ -855,7 +855,14 @@ public class BulkImportHelper {
                             Key firstKey = reader.getFirstKey();
                             if (firstKey != null) {
                                 synchronizedMapFilesInfo.put(file.getPath(), new MapFileInfo(firstKey,
reader.getLastKey()));
-                            } else log.warn(file.getPath() + " is an empty map file");
+                            } else {
+                                log.warn(file.getPath() + " is an empty map file, assigning
it to first tablet");
+                                //this is a hack... the file is empty, it has already been
moved by a tserver, so it can not be deleted
+                                //by the client now... if the file is not deleted here, it
will never be removed because it is not referenced
+                                //so ask 1st tablet to import it, eventually it will be deleted...
 this is the best option w/o changing
+                                //the thrift API.. if all empty files go to one tablet, more
likely to be compacted away quickly
+                                synchronizedMapFilesInfo.put(file.getPath(), new MapFileInfo(new
Key(), new Key()));
+                            }
                             
                         } catch (IOException ioe) {
                             successful = false;



Mime
View raw message