Author: kturner
Date: Mon Apr 15 14:41:24 2013
New Revision: 1468100
URL: http://svn.apache.org/r1468100
Log:
ACCUMULO-1257 stopped updating time for bulk import when there are no files
Modified:
accumulo/trunk/ (props changed)
accumulo/trunk/assemble/ (props changed)
accumulo/trunk/core/ (props changed)
accumulo/trunk/examples/ (props changed)
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
(props changed)
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
(props changed)
accumulo/trunk/pom.xml (props changed)
accumulo/trunk/server/ (props changed)
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
accumulo/trunk/src/ (props changed)
Propchange: accumulo/trunk/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5:r1468098
Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/assemble:r1468098
Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/core:r1468098
Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/examples:r1468098
Propchange:
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
Merged
/accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1468098
Propchange:
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
Merged
/accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1468098
Propchange: accumulo/trunk/pom.xml
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/pom.xml:r1468098
Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/server:r1468098
Modified:
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
URL:
http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java?rev=1468100&r1=1468099&r2=1468100&view=diff
==============================================================================
---
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
(original)
+++
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
Mon Apr 15 14:41:24 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) {
Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/src:r1468098