accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1468098 - /accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
Date Mon, 15 Apr 2013 14:36:52 GMT
Author: kturner
Date: Mon Apr 15 14:36:52 2013
New Revision: 1468098

URL: http://svn.apache.org/r1468098
Log:
ACCUMULO-1257 stopped updating time for bulk import when there are no files

Modified:
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java?rev=1468098&r1=1468097&r2=1468098&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
Mon Apr 15 14:36:52 2013
@@ -682,15 +682,7 @@ public class Tablet {
       if (extent.isRootTablet()) {
         throw new IllegalArgumentException("Can not import files to root tablet");
       }
-      
-      long bulkTime = 0;
-      if (setTime) {
-        for (DataFileValue dfv : paths.values()) {
-          bulkTime = tabletTime.getAndUpdateTime();
-          dfv.setTime(bulkTime);
-        }
-      }
-      
+
       synchronized (bulkFileImportLock) {
         TCredentials auths = SecurityConstants.getSystemCredentials();
         Connector conn;
@@ -705,13 +697,25 @@ public class Tablet {
           if (paths.keySet().remove(new Path(ServerConstants.getTablesDir() + "/" + extent.getTableId()
+ file)))
             log.debug("Ignoring request to re-import a file already imported: " + extent
+ ": " + file);
         
-        synchronized (timeLock) {
-          if (bulkTime > persistedTime)
-            persistedTime = bulkTime;
+        if (paths.size() > 0) {
+          long bulkTime = Long.MIN_VALUE;
+          if (setTime) {
+            for (DataFileValue dfv : paths.values()) {
+              long nextTime = tabletTime.getAndUpdateTime();
+              if (nextTime < bulkTime)
+                throw new IllegalStateException("Time went backwards unexpectedly " + nextTime
+ " " + bulkTime);
+              bulkTime = nextTime;
+              dfv.setTime(bulkTime);
+            }
+          }
+
+          synchronized (timeLock) {
+            if (bulkTime > persistedTime)
+              persistedTime = bulkTime;
           
-          MetadataTable.updateTabletDataFile(tid, extent, abs2rel(paths), tabletTime.getMetadataValue(persistedTime),
auths, tabletServer.getLock());
+            MetadataTable.updateTabletDataFile(tid, extent, abs2rel(paths), tabletTime.getMetadataValue(persistedTime),
auths, tabletServer.getLock());
+          }
         }
-        
       }
       
       synchronized (Tablet.this) {



Mime
View raw message