accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1478126 - in /accumulo/trunk: ./ core/ core/src/main/java/org/apache/accumulo/core/client/impl/ start/src/main/java/org/apache/accumulo/start/classloader/vfs/
Date Wed, 01 May 2013 18:01:45 GMT
Author: vines
Date: Wed May  1 18:01:44 2013
New Revision: 1478126

URL: http://svn.apache.org/r1478126
Log:
ACCUMULO-1321 - Introducing VFS with a finally method to close the filesystem. Improvement
from the last hack, still not 100% content with it though



Added:
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/FinalCloseDefaultFileSystemManager.java
      - copied unchanged from r1478123, accumulo/branches/1.5/start/src/main/java/org/apache/accumulo/start/classloader/vfs/FinalCloseDefaultFileSystemManager.java
Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MetadataLocationObtainer.java
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1478123

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/core:r1478123

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MetadataLocationObtainer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MetadataLocationObtainer.java?rev=1478126&r1=1478125&r2=1478126&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MetadataLocationObtainer.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/MetadataLocationObtainer.java
Wed May  1 18:01:44 2013
@@ -71,12 +71,12 @@ public class MetadataLocationObtainer im
   }
   
   @Override
-  public TabletLocations lookupTablet(TabletLocation src, Text row, Text stopRow, TabletLocator
parent, TCredentials credentials) throws AccumuloSecurityException,
-      AccumuloException {
-
+  public TabletLocations lookupTablet(TabletLocation src, Text row, Text stopRow, TabletLocator
parent, TCredentials credentials)
+      throws AccumuloSecurityException, AccumuloException {
+    
     try {
       ArrayList<TabletLocation> list = new ArrayList<TabletLocation>();
-
+      
       OpTimer opTimer = null;
       if (log.isTraceEnabled())
         opTimer = new OpTimer(log, Level.TRACE).start("Looking up in " + src.tablet_extent.getTableId()
+ " row=" + TextUtil.truncate(row) + "  extent="
@@ -95,9 +95,9 @@ public class MetadataLocationObtainer im
       
       boolean more = ThriftScanner.getBatchFromServer(credentials, range, src.tablet_extent,
src.tablet_location, encodedResults, locCols,
           serverSideIteratorList, serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Constants.NO_AUTHS,
false, instance.getConfiguration());
-
+      
       decodeRows(encodedResults, results);
-
+      
       if (more && results.size() == 1) {
         range = new Range(results.lastKey().followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME),
true, new Key(stopRow).followingKey(PartialKey.ROW), false);
         encodedResults.clear();
@@ -119,7 +119,7 @@ public class MetadataLocationObtainer im
       }
       
       return new TabletLocations(list, metadata.getSecond());
-
+      
     } catch (AccumuloServerException ase) {
       if (log.isTraceEnabled())
         log.trace(src.tablet_extent.getTableId() + " lookup failed, " + src.tablet_location
+ " server side exception");
@@ -136,7 +136,7 @@ public class MetadataLocationObtainer im
     
     return null;
   }
-
+  
   private void decodeRows(TreeMap<Key,Value> encodedResults, TreeMap<Key,Value>
results) throws AccumuloException {
     for (Entry<Key,Value> entry : encodedResults.entrySet()) {
       try {
@@ -193,7 +193,7 @@ public class MetadataLocationObtainer im
       log.trace("lookupTablets failed server=" + tserver, e);
       throw e;
     }
-
+    
     SortedMap<KeyExtent,Text> metadata = MetadataTable.getMetadataLocationEntries(results).getFirst();
     
     for (Entry<KeyExtent,Text> entry : metadata.entrySet()) {

Modified: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java?rev=1478126&r1=1478125&r2=1478126&view=diff
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
(original)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
Wed May  1 18:01:44 2013
@@ -222,8 +222,8 @@ public class AccumuloVFSClassLoader {
     return localLoader.getClassLoader();
   }
   
-  public static DefaultFileSystemManager generateVfs(boolean reloading) throws FileSystemException
{
-    DefaultFileSystemManager vfs = new DefaultFileSystemManager();
+  public static FinalCloseDefaultFileSystemManager generateVfs(boolean reloading) throws
FileSystemException {
+    FinalCloseDefaultFileSystemManager vfs = new FinalCloseDefaultFileSystemManager();
     vfs.addProvider("res", new org.apache.commons.vfs2.provider.res.ResourceFileProvider());
     vfs.addProvider("zip", new org.apache.commons.vfs2.provider.zip.ZipFileProvider());
     vfs.addProvider("gz", new org.apache.commons.vfs2.provider.gzip.GzipFileProvider());



Mime
View raw message