accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1328092 - in /accumulo/trunk: ./ core/ server/ server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
Date Thu, 19 Apr 2012 19:47:20 GMT
Author: ecn
Date: Thu Apr 19 19:47:19 2012
New Revision: 1328092

URL: http://svn.apache.org/viewvc?rev=1328092&view=rev
Log:
ACCUMULO-542: merge to trunk

Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src:r1328080
  Merged /accumulo/branches/1.3:r1328076
  Merged /accumulo/branches/1.4:r1328080

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.3/src/core:r1328076
  Merged /accumulo/branches/1.4/core:r1328080
  Merged /accumulo/branches/1.4/src/core:r1328080

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/server:r1328080
  Merged /accumulo/branches/1.3/src/server:r1328076
  Merged /accumulo/branches/1.4/src/server:r1328080

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=1328092&r1=1328091&r2=1328092&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
Thu Apr 19 19:47:19 2012
@@ -38,7 +38,6 @@ import java.util.Map.Entry;
 import java.util.PriorityQueue;
 import java.util.Set;
 import java.util.SortedMap;
-import java.util.SortedSet;
 import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -1138,10 +1137,6 @@ public class Tablet {
     
     if (extent.isRootTablet()) {
       return null;
-    } else if (extent.isMeta()) {
-      SortedSet<Column> columns = new TreeSet<Column>();
-      columns.add(Constants.METADATA_TIME_COLUMN.toColumn());
-      entries = MetadataTable.getRootMetadataDataEntries(conf, extent, columns, SecurityConstants.getSystemCredentials());
     } else {
       entries = new TreeMap<Key,Value>();
       Text rowName = extent.getMetadataEntry();
@@ -1184,45 +1179,30 @@ public class Tablet {
       
       SortedMap<Key,Value> datafilesMetadata;
       
-      if (extent.isMeta()) {
-        datafilesMetadata = MetadataTable.getRootMetadataDataFileEntries(conf, extent, SecurityConstants.getSystemCredentials());
-      } else {
+      Text rowName = extent.getMetadataEntry();
         
-        Text rowName = extent.getMetadataEntry();
+      ScannerImpl mdScanner = new ScannerImpl(HdfsZooInstance.getInstance(), SecurityConstants.getSystemCredentials(),
Constants.METADATA_TABLE_ID,
+          Constants.NO_AUTHS);
+      
+      // Commented out because when no data file is present, each tablet will scan through
metadata table and return nothing
+      // reduced batch size to improve performance
+      // changed here after endKeys were implemented from 10 to 1000
+      mdScanner.setBatchSize(1000);
+      
+      // leave these in, again, now using endKey for safety
+      mdScanner.fetchColumnFamily(Constants.METADATA_DATAFILE_COLUMN_FAMILY);
+      
+      mdScanner.setRange(new Range(rowName));
+      
+      datafilesMetadata = new TreeMap<Key,Value>();
+      
+      for (Entry<Key,Value> entry : mdScanner) {
         
-        if (tabletsKeyValues != null && tabletsKeyValues.size() > 0) {
-          datafilesMetadata = new TreeMap<Key,Value>();
-          for (Entry<Key,Value> entry : tabletsKeyValues.entrySet()) {
-            if (entry.getKey().compareRow(rowName) == 0 && entry.getKey().compareColumnFamily(Constants.METADATA_DATAFILE_COLUMN_FAMILY)
== 0) {
-              datafilesMetadata.put(new Key(entry.getKey()), new Value(entry.getValue()));
-            }
-          }
-        } else {
-          
-          ScannerImpl mdScanner = new ScannerImpl(HdfsZooInstance.getInstance(), SecurityConstants.getSystemCredentials(),
Constants.METADATA_TABLE_ID,
-              Constants.NO_AUTHS);
-          
-          // Commented out because when no data file is present, each tablet will scan through
metadata table and return nothing
-          // reduced batch size to improve performance
-          // changed here after endKeys were implemented from 10 to 1000
-          mdScanner.setBatchSize(1000);
-          
-          // leave these in, again, now using endKey for safety
-          mdScanner.fetchColumnFamily(Constants.METADATA_DATAFILE_COLUMN_FAMILY);
-          
-          mdScanner.setRange(new Range(rowName));
-          
-          datafilesMetadata = new TreeMap<Key,Value>();
-          
-          for (Entry<Key,Value> entry : mdScanner) {
-            
-            if (entry.getKey().compareRow(rowName) != 0) {
-              break;
-            }
-            
-            datafilesMetadata.put(new Key(entry.getKey()), new Value(entry.getValue()));
-          }
+        if (entry.getKey().compareRow(rowName) != 0) {
+          break;
         }
+        
+        datafilesMetadata.put(new Key(entry.getKey()), new Value(entry.getValue()));
       }
       
       Iterator<Entry<Key,Value>> dfmdIter = datafilesMetadata.entrySet().iterator();
@@ -1233,7 +1213,6 @@ public class Tablet {
         datafiles.put(entry.getKey().getColumnQualifier().toString(), new DataFileValue(entry.getValue().get()));
       }
     }
-    
     return datafiles;
   }
   

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java?rev=1328092&r1=1328091&r2=1328092&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
Thu Apr 19 19:47:19 2012
@@ -339,47 +339,6 @@ public class MetadataTable extends org.a
     
   }
   
-  /**
-   * convenience method for reading a metadata tablet's data file entries from the root tablet
-   * 
-   */
-  public static SortedMap<Key,Value> getRootMetadataDataFileEntries(AccumuloConfiguration
conf, KeyExtent extent, AuthInfo credentials) {
-    SortedSet<Column> columns = new TreeSet<Column>();
-    columns.add(new Column(TextUtil.getBytes(Constants.METADATA_DATAFILE_COLUMN_FAMILY),
null, null));
-    return getRootMetadataDataEntries(conf, extent, columns, credentials);
-  }
-  
-  public static SortedMap<Key,Value> getRootMetadataDataEntries(AccumuloConfiguration
conf, KeyExtent extent, SortedSet<Column> columns, AuthInfo credentials) {
-    
-    try {
-      SortedMap<Key,Value> entries = new TreeMap<Key,Value>();
-      
-      Text metadataEntry = extent.getMetadataEntry();
-      Text startRow;
-      boolean more = getBatchFromRootTablet(conf, credentials, metadataEntry, entries, columns,
false, Constants.SCAN_BATCH_SIZE);
-      
-      while (more) {
-        startRow = entries.lastKey().getRow(); // set end row
-        more = getBatchFromRootTablet(conf, credentials, startRow, entries, columns, false,
Constants.SCAN_BATCH_SIZE);
-      }
-      
-      Iterator<Key> iter = entries.keySet().iterator();
-      while (iter.hasNext()) {
-        Key key = iter.next();
-        if (key.compareRow(metadataEntry) != 0) {
-          iter.remove();
-        }
-      }
-      
-      return entries;
-      
-    } catch (AccumuloSecurityException e) {
-      log.warn("Unauthorized access...");
-      return new TreeMap<Key,Value>();
-    }
-    
-  }
-  
   public static boolean recordRootTabletLocation(String address) {
     IZooReaderWriter zoo = ZooReaderWriter.getInstance();
     for (int i = 0; i < SAVE_ROOT_TABLET_RETRIES; i++) {



Mime
View raw message