incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1189806 [40/46] - in /incubator/accumulo: branches/1.3/contrib/ branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/ branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/admin/ branches/1.3/src/core/src/main/...
Date Thu, 27 Oct 2011 15:25:17 GMT
Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java Thu Oct 27 15:24:51 2011
@@ -78,7 +78,8 @@ class CompactionDriver extends MasterRep
     
     Range range = new KeyExtent(new Text(tableId), null, startRow == null ? null : new Text(startRow)).toMetadataRange();
     
-    if (tableId.equals(Constants.METADATA_TABLE_ID)) range = range.clip(new Range(Constants.ROOT_TABLET_EXTENT.getMetadataEntry(), false, null, true));
+    if (tableId.equals(Constants.METADATA_TABLE_ID))
+      range = range.clip(new Range(Constants.ROOT_TABLET_EXTENT.getMetadataEntry(), false, null, true));
     
     scanner.setRange(range);
     ColumnFQ.fetch(scanner, Constants.METADATA_COMPACT_COLUMN);
@@ -103,39 +104,43 @@ class CompactionDriver extends MasterRep
         entry = row.next();
         Key key = entry.getKey();
         
-        if (Constants.METADATA_COMPACT_COLUMN.equals(key.getColumnFamily(), key.getColumnQualifier())) tabletCompactID = Long.parseLong(entry.getValue()
-            .toString());
+        if (Constants.METADATA_COMPACT_COLUMN.equals(key.getColumnFamily(), key.getColumnQualifier()))
+          tabletCompactID = Long.parseLong(entry.getValue().toString());
         
-        if (Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY.equals(key.getColumnFamily())) server = new TServerInstance(entry.getValue(),
-            key.getColumnQualifier());
+        if (Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY.equals(key.getColumnFamily()))
+          server = new TServerInstance(entry.getValue(), key.getColumnQualifier());
       }
       
       if (tabletCompactID < compactId) {
         tabletsToWaitFor++;
-        if (server != null) serversToFlush.increment(server, 1);
+        if (server != null)
+          serversToFlush.increment(server, 1);
       }
       
       tabletCount++;
       
       Text tabletEndRow = new KeyExtent(entry.getKey().getRow(), (Text) null).getEndRow();
-      if (tabletEndRow == null || (endRow != null && tabletEndRow.compareTo(new Text(endRow)) >= 0)) break;
+      if (tabletEndRow == null || (endRow != null && tabletEndRow.compareTo(new Text(endRow)) >= 0))
+        break;
     }
     
     long scanTime = System.currentTimeMillis() - t1;
     
     Tables.clearCache(instance);
-    if (tabletCount == 0 && !Tables.exists(instance, tableId)) throw new ThriftTableOperationException(tableId, null, TableOperation.COMPACT,
-        TableOperationExceptionType.NOTFOUND, null);
+    if (tabletCount == 0 && !Tables.exists(instance, tableId))
+      throw new ThriftTableOperationException(tableId, null, TableOperation.COMPACT, TableOperationExceptionType.NOTFOUND, null);
     
-    if (serversToFlush.size() == 0 && Tables.getTableState(instance, tableId) == TableState.OFFLINE) throw new ThriftTableOperationException(tableId, null,
-        TableOperation.COMPACT, TableOperationExceptionType.OFFLINE, null);
+    if (serversToFlush.size() == 0 && Tables.getTableState(instance, tableId) == TableState.OFFLINE)
+      throw new ThriftTableOperationException(tableId, null, TableOperation.COMPACT, TableOperationExceptionType.OFFLINE, null);
     
-    if (tabletsToWaitFor == 0) return 0;
+    if (tabletsToWaitFor == 0)
+      return 0;
     
     for (TServerInstance tsi : serversToFlush.keySet()) {
       try {
         final TServerConnection server = master.getConnection(tsi);
-        if (server != null) server.compact(master.getMasterLock(), tableId, startRow, endRow);
+        if (server != null)
+          server.compact(master.getMasterLock(), tableId, startRow, endRow);
       } catch (TException ex) {
         Logger.getLogger(CompactionDriver.class).error(ex.toString());
       }
@@ -143,9 +148,10 @@ class CompactionDriver extends MasterRep
     
     long sleepTime = 500;
     
-    if (serversToFlush.size() > 0) sleepTime = Collections.max(serversToFlush.values()) * sleepTime; // make wait time depend on the server with the most to
-                                                                                                     // compact
-    
+    if (serversToFlush.size() > 0)
+      sleepTime = Collections.max(serversToFlush.values()) * sleepTime; // make wait time depend on the server with the most to
+                                                                        // compact
+      
     sleepTime = Math.max(2 * scanTime, sleepTime);
     
     sleepTime = Math.min(sleepTime, 30000);
@@ -178,8 +184,9 @@ public class CompactRange extends Master
     this.startRow = startRow.length == 0 ? null : startRow;
     this.endRow = endRow.length == 0 ? null : endRow;
     
-    if (this.startRow != null && this.endRow != null && new Text(startRow).compareTo(new Text(endRow)) >= 0) throw new ThriftTableOperationException(tableId,
-        null, TableOperation.COMPACT, TableOperationExceptionType.BAD_RANGE, "start row must be less than end row");
+    if (this.startRow != null && this.endRow != null && new Text(startRow).compareTo(new Text(endRow)) >= 0)
+      throw new ThriftTableOperationException(tableId, null, TableOperation.COMPACT, TableOperationExceptionType.BAD_RANGE,
+          "start row must be less than end row");
   }
   
   @Override

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/DeleteTable.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/DeleteTable.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/DeleteTable.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/DeleteTable.java Thu Oct 27 15:24:51 2011
@@ -104,7 +104,8 @@ class CleanUp extends MasterRepo {
       metaDataTableScanner.close();
     }
     
-    if (!done) return 50;
+    if (!done)
+      return 50;
     
     return 0;
   }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java Thu Oct 27 15:24:51 2011
@@ -64,7 +64,8 @@ public class RenameTable extends MasterR
       zoo.mutate(tap, null, null, new Mutator() {
         public byte[] mutate(byte[] current) throws Exception {
           final String currentName = new String(current);
-          if (currentName.equals(newTableName)) return null; // assume in this case the operation is running again, so we are done
+          if (currentName.equals(newTableName))
+            return null; // assume in this case the operation is running again, so we are done
           if (!currentName.equals(oldTableName)) {
             throw new ThriftTableOperationException(null, oldTableName, TableOperation.RENAME, TableOperationExceptionType.NOTFOUND,
                 "Name changed while processing");

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/TableRangeOp.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/TableRangeOp.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/TableRangeOp.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/TableRangeOp.java Thu Oct 27 15:24:51 2011
@@ -101,8 +101,10 @@ public class TableRangeOp extends Master
     Text end = endRow.length == 0 ? null : new Text(endRow);
     Text tableIdText = new Text(tableId);
     
-    if (start != null && end != null) if (start.compareTo(end) >= 0) throw new ThriftTableOperationException(tableId, null, TableOperation.MERGE,
-        TableOperationExceptionType.BAD_RANGE, "start row must be less than end row");
+    if (start != null && end != null)
+      if (start.compareTo(end) >= 0)
+        throw new ThriftTableOperationException(tableId, null, TableOperation.MERGE, TableOperationExceptionType.BAD_RANGE,
+            "start row must be less than end row");
     
     env.mustBeOnline(tableId);
     
@@ -121,7 +123,8 @@ public class TableRangeOp extends Master
     // Not sure this is a good thing to do. The Master state engine should be the one to remove it.
     Text tableIdText = new Text(tableId);
     MergeInfo mergeInfo = env.getMergeInfo(tableIdText);
-    if (mergeInfo.getState() != MergeState.NONE) log.warn("removing merge information " + mergeInfo);
+    if (mergeInfo.getState() != MergeState.NONE)
+      log.warn("removing merge information " + mergeInfo);
     env.clearMergeState(tableIdText);
     Utils.unreserveTable(tableId, tid, true);
   }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java Thu Oct 27 15:24:51 2011
@@ -44,7 +44,8 @@ public class Utils {
     
     String id = Tables.getNameToIdMap(instance).get(tableName);
     
-    if (id != null && !id.equals(tableId)) throw new ThriftTableOperationException(null, tableName, operation, TableOperationExceptionType.EXISTS, null);
+    if (id != null && !id.equals(tableId))
+      throw new ThriftTableOperationException(null, tableName, operation, TableOperationExceptionType.EXISTS, null);
   }
   
   static String getNextTableId(String tableName, Instance instance) throws ThriftTableOperationException {
@@ -77,12 +78,13 @@ public class Utils {
       if (tableMustExist) {
         Instance instance = HdfsZooInstance.getInstance();
         IZooReaderWriter zk = ZooReaderWriter.getRetryingInstance();
-        if (!zk.exists(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId)) throw new ThriftTableOperationException(tableId, "", op,
-            TableOperationExceptionType.NOTFOUND, "Table does not exists");
+        if (!zk.exists(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId))
+          throw new ThriftTableOperationException(tableId, "", op, TableOperationExceptionType.NOTFOUND, "Table does not exists");
       }
       log.info("table " + tableId + " (" + Long.toHexString(tid) + ") locked for " + (writeLock ? "write" : "read") + " operation: " + op);
       return 0;
-    } else return 100;
+    } else
+      return 100;
   }
   
   public static void unreserveTable(String tableId, long tid, boolean writeLock) throws Exception {
@@ -99,7 +101,8 @@ public class Utils {
     
     if (ZooReservation.attempt(zk, resvPath, String.format("%016x", tid), "")) {
       return 0;
-    } else return 50;
+    } else
+      return 50;
   }
   
   public static void unreserveHdfsDirectory(String directory, long tid) throws KeeperException, InterruptedException {
@@ -114,8 +117,10 @@ public class Utils {
     Lock lock = DistributedReadWriteLock.recoverLock(qlock, lockData);
     if (lock == null) {
       DistributedReadWriteLock locker = new DistributedReadWriteLock(qlock, lockData);
-      if (writeLock) lock = locker.writeLock();
-      else lock = locker.readLock();
+      if (writeLock)
+        lock = locker.writeLock();
+      else
+        lock = locker.readLock();
     }
     return lock;
   }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tserverOps/FlushTablets.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tserverOps/FlushTablets.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tserverOps/FlushTablets.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/tserverOps/FlushTablets.java Thu Oct 27 15:24:51 2011
@@ -77,7 +77,8 @@ public class FlushTablets extends Master
           }
         }
       }
-      if (zooTabletStateStore != null && !flushed) break;
+      if (zooTabletStateStore != null && !flushed)
+        break;
       listener.waitForEvents(1000);
     }
     return new StopLogger(logger);

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java Thu Oct 27 15:24:51 2011
@@ -61,17 +61,20 @@ public abstract class AbstractMetricsImp
     }
     
     public void addAvg(long a) {
-      if (a < 0) return;
+      if (a < 0)
+        return;
       avg = (long) ((avg * .8) + (a * .2));
     }
     
     public void addMin(long a) {
-      if (a < 0) return;
+      if (a < 0)
+        return;
       min = Math.min(min, a);
     }
     
     public void addMax(long a) {
-      if (a < 0) return;
+      if (a < 0)
+        return;
       max = Math.max(max, a);
     }
     
@@ -117,7 +120,8 @@ public abstract class AbstractMetricsImp
   public void register(StandardMBean mbean) throws Exception {
     // Register this object with the MBeanServer
     MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
-    if (null == getObjectName()) throw new IllegalArgumentException("MBean object name must be set.");
+    if (null == getObjectName())
+      throw new IllegalArgumentException("MBean object name must be set.");
     mbs.registerMBean(mbean, getObjectName());
     
     setupLogging();
@@ -131,7 +135,8 @@ public abstract class AbstractMetricsImp
   public void register() throws Exception {
     // Register this object with the MBeanServer
     MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
-    if (null == getObjectName()) throw new IllegalArgumentException("MBean object name must be set.");
+    if (null == getObjectName())
+      throw new IllegalArgumentException("MBean object name must be set.");
     mbs.registerMBean(this, getObjectName());
     
     setupLogging();
@@ -162,14 +167,16 @@ public abstract class AbstractMetricsImp
   }
   
   private void setupLogging() throws IOException {
-    if (null == config.getMetricsConfiguration()) return;
+    if (null == config.getMetricsConfiguration())
+      return;
     // If we are already logging, then return
     if (!currentlyLogging && config.getMetricsConfiguration().getBoolean(metricsPrefix + ".logging", false)) {
       // Check to see if directory exists, else make it
       String mDir = config.getMetricsConfiguration().getString("logging.dir");
       if (null != mDir) {
         File dir = new File(mDir);
-        if (!dir.isDirectory()) dir.mkdir();
+        if (!dir.isDirectory())
+          dir.mkdir();
         logDir = dir;
         // Create new log file
         startNewLog();
@@ -195,7 +202,8 @@ public abstract class AbstractMetricsImp
   }
   
   private void writeToLog(String name) throws IOException {
-    if (null == logWriter) return;
+    if (null == logWriter)
+      return;
     // Increment the date if we have to
     Date now = new Date();
     if (!DateUtils.isSameDay(today, now)) {

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java Thu Oct 27 15:24:51 2011
@@ -93,7 +93,8 @@ public class MetricsConfiguration {
    */
   private class MetricsConfigListener implements ConfigurationListener {
     public void configurationChanged(ConfigurationEvent event) {
-      if (event.getType() == AbstractFileConfiguration.EVENT_RELOAD) needsReloading = true;
+      if (event.getType() == AbstractFileConfiguration.EVENT_RELOAD)
+        needsReloading = true;
     }
   }
   
@@ -106,12 +107,14 @@ public class MetricsConfiguration {
   }
   
   public Configuration getEnvironmentConfiguration() {
-    if (null == envConfig) envConfig = new EnvironmentConfiguration();
+    if (null == envConfig)
+      envConfig = new EnvironmentConfiguration();
     return envConfig;
   }
   
   public Configuration getSystemConfiguration() {
-    if (null == sysConfig) sysConfig = new SystemConfiguration();
+    if (null == sysConfig)
+      sysConfig = new SystemConfiguration();
     return sysConfig;
   }
   
@@ -127,14 +130,15 @@ public class MetricsConfiguration {
         notFoundCount++;
       }
     }
-    if (null == config || needsReloading) synchronized (lock) {
-      if (needsReloading) {
-        loadConfiguration();
-      } else if (null == config) {
-        loadConfiguration();
+    if (null == config || needsReloading)
+      synchronized (lock) {
+        if (needsReloading) {
+          loadConfiguration();
+        } else if (null == config) {
+          loadConfiguration();
+        }
+        needsReloading = false;
       }
-      needsReloading = false;
-    }
     return config;
   }
   
@@ -145,7 +149,8 @@ public class MetricsConfiguration {
       // Try to load the metrics properties file
       File mFile = new File(ACUHOME, metricsFileName);
       if (mFile.exists()) {
-        if (log.isDebugEnabled()) log.debug("Loading config file: " + mFile.getAbsolutePath());
+        if (log.isDebugEnabled())
+          log.debug("Loading config file: " + mFile.getAbsolutePath());
         try {
           xConfig = new XMLConfiguration(mFile);
           xConfig.append(getEnvironmentConfiguration());
@@ -166,13 +171,15 @@ public class MetricsConfiguration {
           return;
         }
       } else {
-        if (!alreadyWarned) log.warn("Unable to find metrics file: " + mFile.getAbsolutePath());
+        if (!alreadyWarned)
+          log.warn("Unable to find metrics file: " + mFile.getAbsolutePath());
         alreadyWarned = true;
         notFound = true;
         return;
       }
     } else {
-      if (!alreadyWarned) log.warn("ACCUMULO_HOME variable not found in environment. Metrics collection will be disabled.");
+      if (!alreadyWarned)
+        log.warn("ACCUMULO_HOME variable not found in environment. Metrics collection will be disabled.");
       alreadyWarned = true;
       notFound = true;
       return;
@@ -181,7 +188,8 @@ public class MetricsConfiguration {
       config = xConfig.interpolatedConfiguration();
       // set the enabled boolean from the configuration
       enabled = config.getBoolean(enabledName);
-      if (log.isDebugEnabled()) log.debug("Metrics collection enabled=" + enabled);
+      if (log.isDebugEnabled())
+        log.debug("Metrics collection enabled=" + enabled);
     } else {
       enabled = false;
     }
@@ -190,7 +198,8 @@ public class MetricsConfiguration {
   
   public boolean isEnabled() {
     // Force reload if necessary
-    if (null == getMetricsConfiguration()) return false;
+    if (null == getMetricsConfiguration())
+      return false;
     return enabled;
   }
   
@@ -201,7 +210,8 @@ public class MetricsConfiguration {
       tsb.append("\n");
       String k = (String) keys.next();
       Object v = config.getString(k);
-      if (null == v) v = config.getList(k);
+      if (null == v)
+        v = config.getList(k);
       tsb.append(k, v.toString());
     }
     return tsb.toString();

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/DedupedLogEvent.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/DedupedLogEvent.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/DedupedLogEvent.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/DedupedLogEvent.java Thu Oct 27 15:24:51 2011
@@ -56,7 +56,8 @@ public class DedupedLogEvent {
   
   @Override
   public boolean equals(Object obj) {
-    if (obj instanceof DedupedLogEvent) return this.event.equals(event);
+    if (obj instanceof DedupedLogEvent)
+      return this.event.equals(event);
     return false;
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/LogService.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/LogService.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/LogService.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/LogService.java Thu Oct 27 15:24:51 2011
@@ -81,7 +81,8 @@ public class LogService extends org.apac
   static private LogService instance = null;
   
   synchronized public static LogService getInstance() {
-    if (instance == null) return new LogService();
+    if (instance == null)
+      return new LogService();
     return instance;
   }
   
@@ -107,7 +108,8 @@ public class LogService extends org.apac
   @Override
   synchronized protected void append(LoggingEvent ev) {
     Object application = ev.getMDC("application");
-    if (application == null || application.toString().isEmpty()) return;
+    if (application == null || application.toString().isEmpty())
+      return;
     
     DedupedLogEvent dev = new DedupedLogEvent(ev);
     

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java Thu Oct 27 15:24:51 2011
@@ -104,7 +104,8 @@ public class Monitor {
     public boolean add(Pair<Long,T> obj) {
       boolean result = super.add(obj);
       
-      if (obj.getFirst() - get(0).getFirst() > maxDelta) remove(0);
+      if (obj.getFirst() - get(0).getFirst() > maxDelta)
+        remove(0);
       
       return result;
     }
@@ -151,9 +152,12 @@ public class Monitor {
   }
   
   public static void add(TableInfo total, TableInfo more) {
-    if (total.minor == null) total.minor = new Compacting();
-    if (total.major == null) total.major = new Compacting();
-    if (total.scans == null) total.scans = new Compacting();
+    if (total.minor == null)
+      total.minor = new Compacting();
+    if (total.major == null)
+      total.major = new Compacting();
+    if (total.scans == null)
+      total.scans = new Compacting();
     if (more.minor != null) {
       total.minor.running += more.minor.running;
       total.minor.queued += more.minor.queued;
@@ -257,10 +261,12 @@ public class Monitor {
     
     // only recalc every so often
     long currentTime = System.currentTimeMillis();
-    if (currentTime - lastRecalc < REFRESH_TIME * 1000) return;
+    if (currentTime - lastRecalc < REFRESH_TIME * 1000)
+      return;
     
     synchronized (Monitor.class) {
-      if (fetching) return;
+      if (fetching)
+        return;
       fetching = true;
     }
     
@@ -277,7 +283,8 @@ public class Monitor {
           log.info("Error fetching stats: " + e);
           UtilWaitThread.sleep(1000);
         } finally {
-          if (client != null) MasterClient.close(client);
+          if (client != null)
+            MasterClient.close(client);
         }
       }
       
@@ -339,7 +346,8 @@ public class Monitor {
       
       double totalLoad = 0.;
       for (TabletServerStatus status : mmi.tServerInfo) {
-        if (status != null) totalLoad += status.osLoad;
+        if (status != null)
+          totalLoad += status.osLoad;
       }
       loadOverTime.add(new Pair<Long,Double>(currentTime, totalLoad));
       
@@ -373,8 +381,10 @@ public class Monitor {
   
   private static void calcCacheHitRate(List<Pair<Long,Double>> hitRate, long currentTime, EventCounter cacheHits, EventCounter cacheReq) {
     long req = cacheReq.calculateCount();
-    if (req > 0) hitRate.add(new Pair<Long,Double>(currentTime, cacheHits.calculateCount() / (double) cacheReq.calculateCount()));
-    else hitRate.add(new Pair<Long,Double>(currentTime, null));
+    if (req > 0)
+      hitRate.add(new Pair<Long,Double>(currentTime, cacheHits.calculateCount() / (double) cacheReq.calculateCount()));
+    else
+      hitRate.add(new Pair<Long,Double>(currentTime, null));
   }
   
   private static GCStatus fetchGcStatus() {

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java Thu Oct 27 15:24:51 2011
@@ -74,8 +74,10 @@ public class ZooKeeperStatus implements 
         TTransport transport = null;
         try {
           InetSocketAddress addr;
-          if (parts.length > 1) addr = new InetSocketAddress(parts[0], Integer.parseInt(parts[1]));
-          else addr = new InetSocketAddress(parts[0], 2181);
+          if (parts.length > 1)
+            addr = new InetSocketAddress(parts[0], Integer.parseInt(parts[1]));
+          else
+            addr = new InetSocketAddress(parts[0], 2181);
           
           transport = TTimeoutTransport.create(addr, 10 * 1000l);
           transport.write("stat\n".getBytes(), 0, 5);
@@ -91,8 +93,10 @@ public class ZooKeeperStatus implements 
             // happens at EOF
           }
           for (String line : response.toString().split("\n")) {
-            if (line.startsWith(" ")) clients++;
-            if (line.startsWith("Mode")) mode = line.split(":")[1];
+            if (line.startsWith(" "))
+              clients++;
+            if (line.startsWith("Mode"))
+              mode = line.split(":")[1];
           }
           update.add(new ZooKeeperState(keeper, mode, clients));
         } catch (Exception ex) {

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java Thu Oct 27 15:24:51 2011
@@ -73,8 +73,10 @@ abstract public class BasicServlet exten
   private static final String DEFAULT_CONTENT_TYPE = "text/html";
   
   public static final Cookie getCookie(HttpServletRequest req, String name) {
-    if (req.getCookies() != null) for (Cookie c : req.getCookies())
-      if (c.getName().equals(name)) return c;
+    if (req.getCookies() != null)
+      for (Cookie c : req.getCookies())
+        if (c.getName().equals(name))
+          return c;
     return null;
   }
   
@@ -89,7 +91,7 @@ abstract public class BasicServlet exten
         // ignore improperly formatted user cookie
       }
     }
-    synchronized(BasicServlet.class) {
+    synchronized (BasicServlet.class) {
       // Learn our instance name asynchronously so we don't hang up if zookeeper is down
       if (cachedInstanceName == null) {
         SimpleTimer.getInstance().schedule(new TimerTask() {
@@ -111,7 +113,8 @@ abstract public class BasicServlet exten
     // BEGIN HEADER
     sb.append("<head>\n");
     sb.append("<title>").append(getTitle(req)).append(" - Accumulo ").append(Constants.VERSION).append("</title>\n");
-    if ((refresh > 0) && (req.getRequestURI().startsWith("/docs") == false)) sb.append("<meta http-equiv='refresh' content='" + refresh + "' />\n");
+    if ((refresh > 0) && (req.getRequestURI().startsWith("/docs") == false))
+      sb.append("<meta http-equiv='refresh' content='" + refresh + "' />\n");
     sb.append("<meta http-equiv='Content-Type' content='").append(DEFAULT_CONTENT_TYPE).append("' />\n");
     sb.append("<meta http-equiv='Content-Script-Type' content='text/javascript' />\n");
     sb.append("<meta http-equiv='Content-Style-Type' content='text/css' />\n");
@@ -130,8 +133,8 @@ abstract public class BasicServlet exten
     sb.append("<div id='content-wrapper'>\n");
     sb.append("<div id='content'>\n");
     sb.append("<div id='header'><h1>").append(getTitle(req)).append("</h1></div>\n");
-    sb.append("<div id='subheader'>Instance&nbsp;Name:&nbsp;").append(cachedInstanceName)
-        .append("&nbsp;&nbsp;&nbsp;Version:&nbsp;").append(Constants.VERSION).append("\n");
+    sb.append("<div id='subheader'>Instance&nbsp;Name:&nbsp;").append(cachedInstanceName).append("&nbsp;&nbsp;&nbsp;Version:&nbsp;").append(Constants.VERSION)
+        .append("\n");
     sb.append("<br><span class='smalltext'>Instance&nbsp;ID:&nbsp;").append(HdfsZooInstance.getInstance().getInstanceID()).append("</span>\n");
     sb.append("<br><span class='smalltext'>").append(new Date().toString().replace(" ", "&nbsp;")).append("</span></div>\n");
     
@@ -147,10 +150,11 @@ abstract public class BasicServlet exten
     sb.append("<a href='/trace/summary?minutes=10'>Recent&nbsp;Traces</a><br />\n");
     sb.append("<a href='/docs'>Documentation</a><br />\n");
     int numLogs = LogService.getInstance().getEvents().size();
-    if (numLogs > 0) sb.append("<span class='error'><a href='/log'>Recent&nbsp;Logs&nbsp;<span class='smalltext'>(" + numLogs + ")</a></span></span><br />\n");
+    if (numLogs > 0)
+      sb.append("<span class='error'><a href='/log'>Recent&nbsp;Logs&nbsp;<span class='smalltext'>(" + numLogs + ")</a></span></span><br />\n");
     int numProblems = Monitor.getProblemSummary().entrySet().size();
-    if (numProblems > 0) sb.append("<span class='error'><a href='/problems'>Table&nbsp;Problems&nbsp;<span class='smalltext'>(" + numProblems
-        + ")</a></span></span><br />\n");
+    if (numProblems > 0)
+      sb.append("<span class='error'><a href='/problems'>Table&nbsp;Problems&nbsp;<span class='smalltext'>(" + numProblems + ")</a></span></span><br />\n");
     sb.append("<hr />\n");
     sb.append("<a href='/xml'>XML</a><hr />\n");
     sb.append("<div class='smalltext'>[<a href='").append("/op?action=refresh&value=").append(refresh < 1 ? "5" : "-1");
@@ -201,7 +205,8 @@ abstract public class BasicServlet exten
   
   public static String currentPage(HttpServletRequest req) {
     String redir = req.getRequestURI();
-    if (req.getQueryString() != null) redir += "?" + req.getQueryString();
+    if (req.getQueryString() != null)
+      redir += "?" + req.getQueryString();
     return encode(redir);
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java Thu Oct 27 15:24:51 2011
@@ -71,9 +71,11 @@ public class DefaultServlet extends Basi
     try {
       String path = req.getRequestURI();
       
-      if (path.endsWith(".jpg")) resp.setContentType("image/jpeg");
+      if (path.endsWith(".jpg"))
+        resp.setContentType("image/jpeg");
       
-      if (path.endsWith(".html")) resp.setContentType("text/html");
+      if (path.endsWith(".html"))
+        resp.setContentType("text/html");
       
       path = path.substring(1);
       InputStream data = BasicServlet.class.getClassLoader().getResourceAsStream(path);
@@ -94,7 +96,8 @@ public class DefaultServlet extends Basi
   
   private void getDocResource(HttpServletRequest req, final HttpServletResponse resp) throws IOException {
     final String path = req.getRequestURI();
-    if (path.endsWith(".html")) resp.setContentType("text/html");
+    if (path.endsWith(".html"))
+      resp.setContentType("text/html");
     
     // Allow user to only read any file in docs directory
     final String aHome = System.getenv("ACCUMULO_HOME");
@@ -122,17 +125,24 @@ public class DefaultServlet extends Basi
       }
     }, acc);
     
-    if (e != null) throw e;
+    if (e != null)
+      throw e;
   }
   
   @Override
   public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-    if (req.getRequestURI().startsWith("/web")) getResource(req, resp);
-    else if (req.getRequestURI().equals("/docs") || req.getRequestURI().equals("/docs/apidocs")) super.doGet(req, resp);
-    else if (req.getRequestURI().startsWith("/docs")) getDocResource(req, resp);
-    else if (req.getRequestURI().startsWith("/monitor")) resp.sendRedirect("/master");
-    else if (req.getRequestURI().startsWith("/errors")) resp.sendRedirect("/problems");
-    else super.doGet(req, resp);
+    if (req.getRequestURI().startsWith("/web"))
+      getResource(req, resp);
+    else if (req.getRequestURI().equals("/docs") || req.getRequestURI().equals("/docs/apidocs"))
+      super.doGet(req, resp);
+    else if (req.getRequestURI().startsWith("/docs"))
+      getDocResource(req, resp);
+    else if (req.getRequestURI().startsWith("/monitor"))
+      resp.sendRedirect("/master");
+    else if (req.getRequestURI().startsWith("/errors"))
+      resp.sendRedirect("/problems");
+    else
+      super.doGet(req, resp);
   }
   
   public static final int GRAPH_WIDTH = 450;
@@ -153,11 +163,14 @@ public class DefaultServlet extends Basi
     
     String sep = "";
     for (Pair<Long,? extends Number> point : (List<Pair<Long,? extends Number>>) data) {
-      if (point.getSecond() == null) continue;
+      if (point.getSecond() == null)
+        continue;
       
       String y;
-      if (point.getSecond() instanceof Double) y = String.format("%1.2f", point.getSecond());
-      else y = point.getSecond().toString();
+      if (point.getSecond() instanceof Double)
+        y = String.format("%1.2f", point.getSecond());
+      else
+        y = point.getSecond().toString();
       
       sb.append(sep);
       sep = ",";
@@ -165,7 +178,8 @@ public class DefaultServlet extends Basi
     }
     
     String opts = "lines: { show: true }";
-    if (points) opts = "points: { show: true, radius: 1 }";
+    if (points)
+      opts = "points: { show: true, radius: 1 }";
     
     sb.append("    ];\n");
     sb.append("    $.plot($(\"#" + id + "\"), [{ data: d1, " + opts

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/GcStatusServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/GcStatusServlet.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/GcStatusServlet.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/GcStatusServlet.java Thu Oct 27 15:24:51 2011
@@ -49,14 +49,18 @@ public class GcStatusServlet extends Bas
       gcActivity.addSortableColumn("Errors", new NumberType<Long>(0l, 1l), null);
       gcActivity.addSortableColumn("Duration", new DurationType(), null);
       
-      if (status.last.finished > 0) gcActivity.addRow("File&nbsp;Collection,&nbsp;Last&nbsp;Cycle", status.last.finished, status.last.candidates,
-          status.last.deleted, status.last.inUse, status.last.errors, status.last.finished - status.last.started);
-      if (status.current.started > 0) gcActivity.addRow("File&nbsp;Collection,&nbsp;Running", status.current.finished, status.current.candidates,
-          status.current.deleted, status.current.inUse, status.current.errors, System.currentTimeMillis() - status.current.started);
-      if (status.lastLog.finished > 0) gcActivity.addRow("WAL&nbsp;Collection,&nbsp;Last&nbsp;Cycle", status.lastLog.finished, status.lastLog.candidates,
-          status.lastLog.deleted, status.lastLog.inUse, status.lastLog.errors, status.lastLog.finished - status.lastLog.started);
-      if (status.currentLog.started > 0) gcActivity.addRow("WAL&nbsp;Collection,&nbsp;Running", status.currentLog.finished, status.currentLog.candidates,
-          status.currentLog.deleted, status.currentLog.inUse, status.currentLog.errors, System.currentTimeMillis() - status.currentLog.started);
+      if (status.last.finished > 0)
+        gcActivity.addRow("File&nbsp;Collection,&nbsp;Last&nbsp;Cycle", status.last.finished, status.last.candidates, status.last.deleted, status.last.inUse,
+            status.last.errors, status.last.finished - status.last.started);
+      if (status.current.started > 0)
+        gcActivity.addRow("File&nbsp;Collection,&nbsp;Running", status.current.finished, status.current.candidates, status.current.deleted,
+            status.current.inUse, status.current.errors, System.currentTimeMillis() - status.current.started);
+      if (status.lastLog.finished > 0)
+        gcActivity.addRow("WAL&nbsp;Collection,&nbsp;Last&nbsp;Cycle", status.lastLog.finished, status.lastLog.candidates, status.lastLog.deleted,
+            status.lastLog.inUse, status.lastLog.errors, status.lastLog.finished - status.lastLog.started);
+      if (status.currentLog.started > 0)
+        gcActivity.addRow("WAL&nbsp;Collection,&nbsp;Running", status.currentLog.finished, status.currentLog.candidates, status.currentLog.deleted,
+            status.currentLog.inUse, status.currentLog.errors, System.currentTimeMillis() - status.currentLog.started);
       gcActivity.generate(req, sb);
     } else {
       banner(sb, "error", "Collector is Unavailable");

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LogServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LogServlet.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LogServlet.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LogServlet.java Thu Oct 27 15:24:51 2011
@@ -51,7 +51,8 @@ public class LogServlet extends BasicSer
       clear = false;
       LoggingEvent ev = dev.getEvent();
       Object application = ev.getMDC("application");
-      if (application == null) application = "";
+      if (application == null)
+        application = "";
       String msg = ev.getMessage().toString();
       StringBuilder text = new StringBuilder();
       for (int i = 0; i < msg.length(); i++) {
@@ -68,16 +69,18 @@ public class LogServlet extends BasicSer
         
       }
       msg = text.toString();
-      if (ev.getThrowableStrRep() != null) for (String line : ev.getThrowableStrRep())
-        msg += "\n\t" + line;
+      if (ev.getThrowableStrRep() != null)
+        for (String line : ev.getThrowableStrRep())
+          msg += "\n\t" + line;
       msg = sanitize(msg.trim());
       msg = "<pre class='logevent'>" + msg + "</pre>";
       logTable.addRow(ev.getTimeStamp(), application, dev.getCount(), ev.getLevel(), msg);
     }
-    if (!clear) logTable.setSubCaption("<a href='/op?action=clearLog&redir=" + currentPage(req) + "'>Clear&nbsp;All&nbsp;Events</a>");
+    if (!clear)
+      logTable.setSubCaption("<a href='/op?action=clearLog&redir=" + currentPage(req) + "'>Clear&nbsp;All&nbsp;Events</a>");
     logTable.generate(req, sb);
-    if (!clear) sb.append("<div class='center'><a href='/op?action=clearLog&redir=").append(currentPage(req))
-        .append("'>Clear&nbsp;All&nbsp;Events</a></div>\n");
+    if (!clear)
+      sb.append("<div class='center'><a href='/op?action=clearLog&redir=").append(currentPage(req)).append("'>Clear&nbsp;All&nbsp;Events</a></div>\n");
   }
   
   private static class LogLevelType extends StringType<Level> {
@@ -88,11 +91,15 @@ public class LogServlet extends BasicSer
     
     @Override
     public String format(Object obj) {
-      if (obj == null) return "-";
+      if (obj == null)
+        return "-";
       Level l = (Level) obj;
-      if (l.equals(Level.ERROR) || l.equals(Level.FATAL)) return "<div class='error'>" + l.toString() + "</div>";
-      else if (l.equals(Level.WARN)) return "<div class='warning'>" + l.toString() + "</div>";
-      else return l.toString();
+      if (l.equals(Level.ERROR) || l.equals(Level.FATAL))
+        return "<div class='error'>" + l.toString() + "</div>";
+      else if (l.equals(Level.WARN))
+        return "<div class='warning'>" + l.toString() + "</div>";
+      else
+        return l.toString();
     }
   }
 }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LoggersServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LoggersServlet.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LoggersServlet.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LoggersServlet.java Thu Oct 27 15:24:51 2011
@@ -59,7 +59,8 @@ public class LoggersServlet extends Basi
     if (loggerAddress == null || loggerAddress.isEmpty()) {
       
       ArrayList<LoggerStatus> loggers = new ArrayList<LoggerStatus>();
-      if (Monitor.getMmi() != null) loggers.addAll(Monitor.getMmi().loggers);
+      if (Monitor.getMmi() != null)
+        loggers.addAll(Monitor.getMmi().loggers);
       Table loggerList = new Table("loggers", "Logger&nbsp;Servers");
       
       doLoggerServerList(req, sb, loggers, loggerList);
@@ -71,7 +72,8 @@ public class LoggersServlet extends Basi
     loggerList.addSortableColumn("Server", new LoggerLinkType(), null);
     
     for (LoggerStatus status : loggers) {
-      if (status == null) status = NO_STATUS;
+      if (status == null)
+        status = NO_STATUS;
       RecoveryStatus s = new RecoveryStatus();
       s.host = status.logger;
       loggerList.addRow(s);

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/MasterServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/MasterServlet.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/MasterServlet.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/MasterServlet.java Thu Oct 27 15:24:51 2011
@@ -108,7 +108,8 @@ public class MasterServlet extends Basic
           gcStatus = label + " " + DateFormat.getInstance().format(new Date(start));
           gcStatus = gcStatus.replace(" ", "&nbsp;");
           long normalDelay = ServerConfiguration.getSystemConfiguration().getTimeInMillis(Property.GC_CYCLE_DELAY);
-          if (diff > normalDelay * 2) gcStatus = "<span class='warning'>" + gcStatus + "</span>";
+          if (diff > normalDelay * 2)
+            gcStatus = "<span class='warning'>" + gcStatus + "</span>";
         }
       } else {
         gcStatus = "<span class='error'>Down</span>";
@@ -160,7 +161,8 @@ public class MasterServlet extends Basic
       masterStatus.addRow(row);
       masterStatus.generate(req, sb);
       
-    } else banner(sb, "error", "Master Server Not Running");
+    } else
+      banner(sb, "error", "Master Server Not Running");
     
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/OperationServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/OperationServlet.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/OperationServlet.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/OperationServlet.java Thu Oct 27 15:24:51 2011
@@ -47,7 +47,8 @@ public class OperationServlet extends Ba
     try {
       String operation = req.getParameter("action");
       redir = req.getParameter("redir");
-      if (redir != null) redir = decode(redir);
+      if (redir != null)
+        redir = decode(redir);
       
       if (operation != null) {
         for (Class<?> subclass : OperationServlet.class.getClasses()) {
@@ -70,8 +71,10 @@ public class OperationServlet extends Ba
       log.error(t, t);
     } finally {
       try {
-        if (redir != null) resp.sendRedirect(redir);
-        else resp.sendRedirect("/");
+        if (redir != null)
+          resp.sendRedirect(redir);
+        else
+          resp.sendRedirect("/");
         resp.flushBuffer();
       } catch (Throwable t) {
         log.error(t, t);
@@ -115,9 +118,11 @@ public class OperationServlet extends Ba
     public void execute(HttpServletRequest req, HttpServletResponse resp, Logger log) {
       String table = req.getParameter("table");
       String resource = req.getParameter("resource");
-      if (resource != null) resource = decode(resource);
+      if (resource != null)
+        resource = decode(resource);
       String ptype = req.getParameter("ptype");
-      if (ptype != null) ptype = decode(ptype);
+      if (ptype != null)
+        ptype = decode(ptype);
       try {
         ProblemReports.getInstance().deleteProblemReport(table, ProblemType.valueOf(ptype), resource);
       } catch (Exception e) {
@@ -133,9 +138,12 @@ public class OperationServlet extends Ba
       String table = req.getParameter("table");
       String asc = req.getParameter("asc");
       String col = req.getParameter("col");
-      if (table == null || page == null || (asc == null && col == null)) return;
-      if (asc == null) resp.addCookie(new Cookie("tableSort." + page + "." + table + "." + "sortCol", col));
-      else resp.addCookie(new Cookie("tableSort." + page + "." + table + "." + "sortAsc", asc));
+      if (table == null || page == null || (asc == null && col == null))
+        return;
+      if (asc == null)
+        resp.addCookie(new Cookie("tableSort." + page + "." + table + "." + "sortCol", col));
+      else
+        resp.addCookie(new Cookie("tableSort." + page + "." + table + "." + "sortAsc", asc));
     }
   }
   
@@ -145,7 +153,8 @@ public class OperationServlet extends Ba
       String page = req.getParameter("page");
       String table = req.getParameter("table");
       String show = req.getParameter("show");
-      if (table == null || page == null || show == null) return;
+      if (table == null || page == null || show == null)
+        return;
       resp.addCookie(new Cookie("tableLegend." + page + "." + table + "." + "show", show));
     }
   }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ProblemServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ProblemServlet.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ProblemServlet.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ProblemServlet.java Thu Oct 27 15:24:51 2011
@@ -53,7 +53,8 @@ public class ProblemServlet extends Basi
   }
   
   private static void doProblemSummary(final HttpServletRequest req, StringBuilder sb, final Map<String,String> tidToNameMap) {
-    if (Monitor.getProblemSummary().isEmpty() && Monitor.getProblemException() == null) return;
+    if (Monitor.getProblemSummary().isEmpty() && Monitor.getProblemException() == null)
+      return;
     
     Table problemSummary = new Table("problemSummary", "Problem&nbsp;Summary", "error");
     problemSummary.addSortableColumn("Table", new TableProblemLinkType(tidToNameMap), null);
@@ -66,7 +67,8 @@ public class ProblemServlet extends Basi
       cell.append("<b>Failed to obtain problem reports</b> : " + Monitor.getProblemException().getMessage());
       Throwable cause = Monitor.getProblemException().getCause();
       while (cause != null) {
-        if (cause.getMessage() != null) cell.append("<br />\n caused by : " + cause.getMessage());
+        if (cause.getMessage() != null)
+          cell.append("<br />\n caused by : " + cause.getMessage());
         cause = cause.getCause();
       }
       problemSummary.setSubCaption(cell.toString());
@@ -87,7 +89,8 @@ public class ProblemServlet extends Basi
   
   private static void doProblemDetails(final HttpServletRequest req, StringBuilder sb, String tableId, Map<String,String> tidToNameMap) {
     
-    if (Monitor.getProblemException() != null) return;
+    if (Monitor.getProblemException() != null)
+      return;
     
     ArrayList<ProblemReport> problemReports = new ArrayList<ProblemReport>();
     Iterator<ProblemReport> iter = tableId == null ? ProblemReports.getInstance().iterator() : ProblemReports.getInstance().iterator(tableId);
@@ -127,7 +130,8 @@ public class ProblemServlet extends Basi
     
     @Override
     public String format(Object obj) {
-      if (obj == null) return "-";
+      if (obj == null)
+        return "-";
       String table = String.valueOf(obj);
       return String.format("<a href='/problems?table=%s'>%s</a>", table, Tables.getPrintableTableNameFromId(tidToNameMap, table));
     }
@@ -149,7 +153,8 @@ public class ProblemServlet extends Basi
     
     @Override
     public String format(Object obj) {
-      if (obj == null) return "-";
+      if (obj == null)
+        return "-";
       String table = String.valueOf(obj);
       return String.format("<a href='/op?table=%s&action=clearTableProblems&redir=%s'>clear ALL %s problems</a>", table, currentPage(req),
           Tables.getPrintableTableNameFromId(tidToNameMap, table));
@@ -170,7 +175,8 @@ public class ProblemServlet extends Basi
     
     @Override
     public String format(Object obj) {
-      if (obj == null) return "-";
+      if (obj == null)
+        return "-";
       ProblemReport p = (ProblemReport) obj;
       return String.format("<a href='/op?table=%s&action=clearProblem&redir=%s&resource=%s&ptype=%s'>clear this problem</a>", p.getTableName(),
           currentPage(req), encode(p.getResource()), encode(p.getProblemType().name()));

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java Thu Oct 27 15:24:51 2011
@@ -64,7 +64,8 @@ public class TServersServlet extends Bas
     
     @Override
     public String format(Object obj) {
-      if (obj == null) return "&mdash;";
+      if (obj == null)
+        return "&mdash;";
       return Duration.format((long) (1000.0 * (Double) obj));
     }
     
@@ -96,7 +97,8 @@ public class TServersServlet extends Bas
       doDeadTserverList(req, sb);
       
       ArrayList<TabletServerStatus> tservers = new ArrayList<TabletServerStatus>();
-      if (Monitor.getMmi() != null) tservers.addAll(Monitor.getMmi().tServerInfo);
+      if (Monitor.getMmi() != null)
+        tservers.addAll(Monitor.getMmi().tServerInfo);
       
       Table tServerList = new Table("tservers", "Tablet&nbsp;Servers");
       tServerList.setSubCaption("Click on the <span style='color: #0000ff;'>server address</span> to view detailed performance statistics for that server.");
@@ -184,11 +186,14 @@ public class TServersServlet extends Bas
     }
     
     // Calculate current averages oldServer adding in historical data
-    if (total.minor.num != 0) currentMinorAvg = (long) (total.minor.elapsed / total.minor.num);
-    if (total.minor.elapsed != 0 && total.minor.num != 0) currentMinorStdDev = stddev(total.minor.elapsed, total.minor.num, total.minor.sumDev);
-    if (total.major.num != 0) currentMajorAvg = total.major.elapsed / total.major.num;
-    if (total.major.elapsed != 0 && total.major.num != 0 && total.major.elapsed > total.major.num) currentMajorStdDev = stddev(total.major.elapsed,
-        total.major.num, total.major.sumDev);
+    if (total.minor.num != 0)
+      currentMinorAvg = (long) (total.minor.elapsed / total.minor.num);
+    if (total.minor.elapsed != 0 && total.minor.num != 0)
+      currentMinorStdDev = stddev(total.minor.elapsed, total.minor.num, total.minor.sumDev);
+    if (total.major.num != 0)
+      currentMajorAvg = total.major.elapsed / total.major.num;
+    if (total.major.elapsed != 0 && total.major.num != 0 && total.major.elapsed > total.major.num)
+      currentMajorStdDev = stddev(total.major.elapsed, total.major.num, total.major.sumDev);
     
     // After these += operations, these variables are now total for current
     // tablets and historical tablets
@@ -334,10 +339,13 @@ public class TServersServlet extends Bas
     
     log.debug("tableId: " + tableId);
     for (TabletServerStatus status : tservers) {
-      if (status == null) status = NO_STATUS;
+      if (status == null)
+        status = NO_STATUS;
       TableInfo summary = Monitor.summarizeTableStats(status);
-      if (tableId != null) summary = status.tableMap.get(tableId);
-      if (summary == null) continue;
+      if (tableId != null)
+        summary = status.tableMap.get(tableId);
+      if (summary == null)
+        continue;
       TableRow row = tServerList.prepareRow();
       row.add(status); // add for server name
       row.add(summary.tablets);

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TablesServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TablesServlet.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TablesServlet.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TablesServlet.java Thu Oct 27 15:24:51 2011
@@ -72,7 +72,8 @@ public class TablesServlet extends Basic
   
   static void doProblemsBanner(StringBuilder sb) {
     int numProblems = Monitor.getProblemSummary().entrySet().size();
-    if (numProblems > 0) banner(sb, "error", String.format("<a href='/problems'>Table Problems: %d Total</a>", numProblems));
+    if (numProblems > 0)
+      banner(sb, "error", String.format("<a href='/problems'>Table Problems: %d Total</a>", numProblems));
   }
   
   static void doTableList(HttpServletRequest req, StringBuilder sb, Map<String,String> tidToNameMap) {
@@ -102,8 +103,9 @@ public class TablesServlet extends Basic
             + "They reduce the number of files used during queries.");
     SortedMap<String,TableInfo> tableStats = new TreeMap<String,TableInfo>();
     
-    if (Monitor.getMmi() != null && Monitor.getMmi().tableMap != null) for (Entry<String,TableInfo> te : Monitor.getMmi().tableMap.entrySet())
-      tableStats.put(Tables.getPrintableTableNameFromId(tidToNameMap, te.getKey()), te.getValue());
+    if (Monitor.getMmi() != null && Monitor.getMmi().tableMap != null)
+      for (Entry<String,TableInfo> te : Monitor.getMmi().tableMap.entrySet())
+        tableStats.put(Tables.getPrintableTableNameFromId(tidToNameMap, te.getKey()), te.getValue());
     
     Map<String,Double> compactingByTable = Monitor.summarizeTableStats(Monitor.getMmi());
     TableManager tableManager = TableManager.getInstance();
@@ -113,7 +115,8 @@ public class TablesServlet extends Basic
       String tableId = tableName_tableId.getValue();
       TableInfo tableInfo = tableStats.get(tableName);
       Double holdTime = compactingByTable.get(tableId);
-      if (holdTime == null) holdTime = new Double(0.);
+      if (holdTime == null)
+        holdTime = new Double(0.);
       TableRow row = tableList.prepareRow();
       row.add(tableId);
       row.add(tableManager.getTableState(tableId));
@@ -157,7 +160,8 @@ public class TablesServlet extends Basic
       for (TabletServerStatus tss : Monitor.getMmi().tServerInfo) {
         try {
           log.debug("tss: " + tss.name);
-          if (tss.name != null && locs.contains(tss.name)) tservers.add(tss);
+          if (tss.name != null && locs.contains(tss.name))
+            tservers.add(tss);
         } catch (Exception ex) {
           log.error(ex, ex);
         }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java Thu Oct 27 15:24:51 2011
@@ -47,7 +47,8 @@ abstract class Basic extends BasicServle
   
   public static int getIntParameter(HttpServletRequest req, String name, int defaultMinutes) {
     String valueString = req.getParameter(name);
-    if (valueString == null) return defaultMinutes;
+    if (valueString == null)
+      return defaultMinutes;
     int result = 0;
     try {
       result = Integer.parseInt(valueString);

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java Thu Oct 27 15:24:51 2011
@@ -49,7 +49,8 @@ public class ListType extends Basic {
   private static class ShowTraceLinkType extends StringType<RemoteSpan> {
     
     public String format(Object obj) {
-      if (obj == null) return "-";
+      if (obj == null)
+        return "-";
       RemoteSpan span = (RemoteSpan) obj;
       return String.format("<a href='/trace/show?id=%s'>%s</a>", Long.toHexString(span.traceId), TraceFormatter.formatDate(new Date(span.start)));
     }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ShowTrace.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ShowTrace.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ShowTrace.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ShowTrace.java Thu Oct 27 15:24:51 2011
@@ -49,7 +49,8 @@ public class ShowTrace extends Basic {
   @Override
   public String getTitle(HttpServletRequest req) {
     String id = getTraceId(req);
-    if (id == null) return "No trace id specified";
+    if (id == null)
+      return "No trace id specified";
     return "Trace ID " + id;
   }
   
@@ -101,8 +102,10 @@ public class ShowTrace extends Basic {
         sb.append(String.format("<td style='text-indent: %dpx'>%s@%s</td>\n", level * 5, node.svc, node.sender));
         sb.append("<td>" + node.description + "</td>");
         boolean hasData = node.data != null && !node.data.isEmpty();
-        if (hasData) sb.append("<td><input type='checkbox' onclick='toggle(\"" + Long.toHexString(node.spanId) + "\")'></td>\n");
-        else sb.append("<td></td>\n");
+        if (hasData)
+          sb.append("<td><input type='checkbox' onclick='toggle(\"" + Long.toHexString(node.spanId) + "\")'></td>\n");
+        else
+          sb.append("<td></td>\n");
         sb.append("</tr>\n");
         sb.append("<tr id='" + Long.toHexString(node.spanId) + "' style='display:none'>");
         sb.append("<td colspan='5'>\n");

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Summary.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Summary.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Summary.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Summary.java Thu Oct 27 15:24:51 2011
@@ -85,7 +85,8 @@ public class Summary extends Basic {
     }
     
     public String format(Object obj) {
-      if (obj == null) return "-";
+      if (obj == null)
+        return "-";
       String type = obj.toString();
       String encodedType = BasicServlet.encode(type);
       return String.format("<a href='/trace/listType?type=%s&minutes=%d'>%s</a>", encodedType, minutes, type);
@@ -99,8 +100,10 @@ public class Summary extends Basic {
       sb.append("<table>");
       sb.append("<tr>");
       for (long count : stat.histogram) {
-        if (count > 0) sb.append(String.format("<td style='width:5em'>%d</td>", count));
-        else sb.append("<td style='width:5em'>-</td>");
+        if (count > 0)
+          sb.append(String.format("<td style='width:5em'>%d</td>", count));
+        else
+          sb.append("<td style='width:5em'>-</td>");
       }
       sb.append("</tr></table>");
       return sb.toString();
@@ -110,8 +113,10 @@ public class Summary extends Basic {
     public int compare(Stats o1, Stats o2) {
       for (int i = 0; i < o1.histogram.length; i++) {
         long diff = o1.histogram[i] - o2.histogram[i];
-        if (diff < 0) return -1;
-        if (diff > 0) return 1;
+        if (diff < 0)
+          return -1;
+        if (diff > 0)
+          return 1;
       }
       return 0;
     }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/Table.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/Table.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/Table.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/Table.java Thu Oct 27 15:24:51 2011
@@ -53,12 +53,14 @@ public class Table {
   }
   
   public synchronized <T> void addColumn(TableColumn<T> column) {
-    if (hasBegunAddingRows) throw new IllegalStateException("Cannot add more columns newServer rows have been added");
+    if (hasBegunAddingRows)
+      throw new IllegalStateException("Cannot add more columns newServer rows have been added");
     columns.add(column);
   }
   
   private synchronized <T> void addColumn(String title, CellType<T> type, String legend, boolean sortable) {
-    if (type == null) type = new StringType<T>();
+    if (type == null)
+      type = new StringType<T>();
     type.setSortable(sortable);
     addColumn(new TableColumn<T>(title, type, legend));
   }
@@ -86,13 +88,15 @@ public class Table {
   
   public synchronized void addRow(TableRow row) {
     hasBegunAddingRows = true;
-    if (columns.size() != row.size()) throw new IllegalStateException("Row must be the same size as the columns");
+    if (columns.size() != row.size())
+      throw new IllegalStateException("Row must be the same size as the columns");
     rows.add(row);
   }
   
   public synchronized void addRow(Object... cells) {
     TableRow row = prepareRow();
-    if (cells.length != columns.size()) throw new IllegalArgumentException("Argument length not equal to the number of columns");
+    if (cells.length != columns.size())
+      throw new IllegalArgumentException("Argument length not equal to the number of columns");
     for (Object cell : cells)
       row.add(cell);
     addRow(row);
@@ -100,20 +104,25 @@ public class Table {
   
   public synchronized void generate(HttpServletRequest req, StringBuilder sb) {
     String page = req.getRequestURI();
-    if (columns.isEmpty()) throw new IllegalStateException("No columns in table");
+    if (columns.isEmpty())
+      throw new IllegalStateException("No columns in table");
     for (TableRow row : rows)
-      if (row.size() != columns.size()) throw new RuntimeException("Each row must have the same number of columns");
+      if (row.size() != columns.size())
+        throw new RuntimeException("Each row must have the same number of columns");
     
     boolean sortAscending = true;
     Cookie c = BasicServlet.getCookie(req, "tableSort." + page + "." + table + "." + "sortAsc");
-    if (c != null && "false".equals(c.getValue())) sortAscending = false;
+    if (c != null && "false".equals(c.getValue()))
+      sortAscending = false;
     
     int sortCol = -1; // set to first sortable column by default
     int numLegends = 0;
     for (int i = 0; i < columns.size(); ++i) {
       TableColumn<?> col = columns.get(i);
-      if (sortCol < 0 && col.getCellType().isSortable()) sortCol = i;
-      if (col.getLegend() != null && !col.getLegend().isEmpty()) ++numLegends;
+      if (sortCol < 0 && col.getCellType().isSortable())
+        sortCol = i;
+      if (col.getLegend() != null && !col.getLegend().isEmpty())
+        ++numLegends;
     }
     
     // only get cookie if there is a possibility that it is sortable
@@ -123,7 +132,8 @@ public class Table {
         try {
           int col = Integer.parseInt(c.getValue());
           // only bother if specified column is sortable
-          if (!(col < 0 || sortCol >= columns.size()) && columns.get(col).getCellType().isSortable()) sortCol = col;
+          if (!(col < 0 || sortCol >= columns.size()) && columns.get(col).getCellType().isSortable())
+            sortCol = col;
         } catch (NumberFormatException e) {
           // ignore improperly formatted user cookie
         }
@@ -140,16 +150,20 @@ public class Table {
     sb.append("<a name='").append(table).append("'>&nbsp;</a>\n");
     sb.append("<table id='").append(table).append("' class='sortable'>\n");
     sb.append("<caption");
-    if (captionclass != null && !captionclass.isEmpty()) sb.append(" class='").append(captionclass).append("'");
+    if (captionclass != null && !captionclass.isEmpty())
+      sb.append(" class='").append(captionclass).append("'");
     sb.append(">\n");
-    if (caption != null && !caption.isEmpty()) sb.append("<span class='table-caption'>").append(caption).append("</span><br />\n");
-    if (subcaption != null && !subcaption.isEmpty()) sb.append("<span class='table-subcaption'>").append(subcaption).append("</span><br />\n");
+    if (caption != null && !caption.isEmpty())
+      sb.append("<span class='table-caption'>").append(caption).append("</span><br />\n");
+    if (subcaption != null && !subcaption.isEmpty())
+      sb.append("<span class='table-subcaption'>").append(subcaption).append("</span><br />\n");
     
     String redir = BasicServlet.currentPage(req);
     if (numLegends > 0) {
       String legendUrl = String.format("/op?action=toggleLegend&redir=%s&page=%s&table=%s&show=%s", redir, page, table, !showLegend);
       sb.append("<a href='").append(legendUrl).append("'>").append(showLegend ? "Hide" : "Show").append("&nbsp;Legend</a>\n");
-      if (showLegend) sb.append("<div class='left ").append(showLegend ? "show" : "hide").append("'><dl>\n");
+      if (showLegend)
+        sb.append("<div class='left ").append(showLegend ? "show" : "hide").append("'><dl>\n");
     }
     for (int i = 0; i < columns.size(); ++i) {
       TableColumn<?> col = columns.get(i);
@@ -158,15 +172,16 @@ public class Table {
         String url = String.format("/op?action=sortTable&redir=%s&page=%s&table=%s&%s=%s", redir, page, table, sortCol == i ? "asc" : "col",
             sortCol == i ? !sortAscending : i);
         String img = "";
-        if (sortCol == i) img = String.format("&nbsp;<img width='10px' height='10px' src='/web/%s.gif' alt='%s' />", sortAscending ? "up" : "down",
-            !sortAscending ? "^" : "v");
+        if (sortCol == i)
+          img = String.format("&nbsp;<img width='10px' height='10px' src='/web/%s.gif' alt='%s' />", sortAscending ? "up" : "down", !sortAscending ? "^" : "v");
         col.setTitle(String.format("<a href='%s'>%s%s</a>", url, title, img));
       }
       String legend = col.getLegend();
-      if (showLegend && legend != null && !legend.isEmpty()) sb.append("<dt class='smalltext'><b>").append(title.replace("<br />", "&nbsp;"))
-          .append("</b><dd>").append(legend).append("</dd></dt>\n");
+      if (showLegend && legend != null && !legend.isEmpty())
+        sb.append("<dt class='smalltext'><b>").append(title.replace("<br />", "&nbsp;")).append("</b><dd>").append(legend).append("</dd></dt>\n");
     }
-    if (showLegend && numLegends > 0) sb.append("</dl></div>\n");
+    if (showLegend && numLegends > 0)
+      sb.append("</dl></div>\n");
     sb.append("</caption>\n");
     sb.append("<tr>");
     boolean first = true;
@@ -179,7 +194,8 @@ public class Table {
     // don't sort if no columns are sortable or if there aren't enough rows
     if (rows.size() > 1 && sortCol > -1) {
       Collections.sort(rows, TableRow.getComparator(sortCol, columns.get(sortCol).getCellType()));
-      if (!sortAscending) Collections.reverse(rows);
+      if (!sortAscending)
+        Collections.reverse(rows);
     }
     boolean highlight = true;
     for (TableRow row : rows) {
@@ -193,7 +209,8 @@ public class Table {
       row(sb, highlight, columns, row);
       highlight = !highlight;
     }
-    if (rows.isEmpty()) sb.append("<tr><td class='center' colspan='").append(columns.size()).append("'><i>Empty</i></td></tr>\n");
+    if (rows.isEmpty())
+      sb.append("<tr><td class='center' colspan='").append(columns.size()).append("'><i>Empty</i></td></tr>\n");
     sb.append("</table>\n</div>\n\n");
   }
   
@@ -202,9 +219,11 @@ public class Table {
     boolean first = true;
     for (int i = 0; i < row.size(); ++i) {
       String cellValue = String.valueOf(row.get(i)).trim();
-      if (cellValue.isEmpty() || cellValue.equals(String.valueOf((Object) null))) cellValue = "-";
+      if (cellValue.isEmpty() || cellValue.equals(String.valueOf((Object) null)))
+        cellValue = "-";
       sb.append("<td class='").append(first ? "firstcell" : "");
-      if (columns.get(i).getCellType().alignment() != null) sb.append(first ? " " : "").append(columns.get(i).getCellType().alignment());
+      if (columns.get(i).getCellType().alignment() != null)
+        sb.append(first ? " " : "").append(columns.get(i).getCellType().alignment());
       sb.append("'>").append(cellValue).append("</td>");
       first = false;
     }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/TableRow.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/TableRow.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/TableRow.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/TableRow.java Thu Oct 27 15:24:51 2011
@@ -29,7 +29,8 @@ public class TableRow {
   }
   
   public boolean add(Object obj) {
-    if (row.size() == size) throw new IllegalStateException("Row is full.");
+    if (row.size() == size)
+      throw new IllegalStateException("Row is full.");
     return row.add(obj);
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/CompactionsType.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/CompactionsType.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/CompactionsType.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/CompactionsType.java Thu Oct 27 15:24:51 2011
@@ -29,19 +29,25 @@ public class CompactionsType extends Cel
   
   @Override
   public String format(Object obj) {
-    if (obj == null) return "-";
+    if (obj == null)
+      return "-";
     TableInfo summary = (TableInfo) obj;
     Compacting c = summary.major;
-    if (fieldName.equals("minor")) c = summary.minor;
-    else if (fieldName.equals("scans")) c = summary.scans;
-    if (c == null) c = new Compacting();
+    if (fieldName.equals("minor"))
+      c = summary.minor;
+    else if (fieldName.equals("scans"))
+      c = summary.scans;
+    if (c == null)
+      c = new Compacting();
     return String.format("%s&nbsp;(%,d)", NumberType.commas(c.running, c.queued == 0 ? 0 : 1, summary.onlineTablets), c.queued);
   }
   
   @Override
   public int compare(TableInfo o1, TableInfo o2) {
-    if (o1 == null) return -1;
-    if (o2 == null) return 1;
+    if (o1 == null)
+      return -1;
+    if (o2 == null)
+      return 1;
     Compacting c1 = o1.major;
     Compacting c2 = o2.major;
     if (fieldName.equals("minor")) {
@@ -51,8 +57,10 @@ public class CompactionsType extends Cel
       c1 = o1.scans;
       c2 = o2.scans;
     }
-    if (c1 == null) return -1;
-    if (c2 == null) return 1;
+    if (c1 == null)
+      return -1;
+    if (c2 == null)
+      return 1;
     return c1.running + c1.queued - c2.running - c2.queued;
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/DateTimeType.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/DateTimeType.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/DateTimeType.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/DateTimeType.java Thu Oct 27 15:24:51 2011
@@ -38,18 +38,24 @@ public class DateTimeType extends CellTy
   
   @Override
   public String format(Object obj) {
-    if (obj == null) return "-";
+    if (obj == null)
+      return "-";
     Long millis = (Long) obj;
-    if (millis == 0) return "-";
-    if (simple != null) return simple.format(new Date(millis)).replace(" ", "&nbsp;");
+    if (millis == 0)
+      return "-";
+    if (simple != null)
+      return simple.format(new Date(millis)).replace(" ", "&nbsp;");
     return DateFormat.getDateTimeInstance(dateFormat, timeFormat, Locale.getDefault()).format(new Date(millis)).replace(" ", "&nbsp;");
   }
   
   @Override
   public int compare(Long o1, Long o2) {
-    if (o1 == null && o2 == null) return 0;
-    else if (o1 == null) return -1;
-    else return o1.compareTo(o2);
+    if (o1 == null && o2 == null)
+      return 0;
+    else if (o1 == null)
+      return -1;
+    else
+      return o1.compareTo(o2);
   }
   
   @Override

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/DurationType.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/DurationType.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/DurationType.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/DurationType.java Thu Oct 27 15:24:51 2011
@@ -33,15 +33,18 @@ public class DurationType extends Number
   
   @Override
   public String format(Object obj) {
-    if (obj == null) return "-";
+    if (obj == null)
+      return "-";
     Long millis = (Long) obj;
-    if (errMin != null && errMax != null) return seconds(millis, errMin, errMax);
+    if (errMin != null && errMax != null)
+      return seconds(millis, errMin, errMax);
     return Duration.format(millis);
   }
   
   private static String seconds(long secs, long errMin, long errMax) {
     String numbers = Duration.format(secs);
-    if (secs < errMin || secs > errMax) return "<span class='error'>" + numbers + "</span>";
+    if (secs < errMin || secs > errMax)
+      return "<span class='error'>" + numbers + "</span>";
     return numbers;
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/LoggerLinkType.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/LoggerLinkType.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/LoggerLinkType.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/LoggerLinkType.java Thu Oct 27 15:24:51 2011
@@ -25,13 +25,15 @@ public class LoggerLinkType extends Cell
   
   @Override
   public String format(Object obj) {
-    if (obj == null) return "-";
+    if (obj == null)
+      return "-";
     RecoveryStatus status = (RecoveryStatus) obj;
     return String.format("<a href='/loggers?s=%s'>%s</a>", status.host, displayName(status));
   }
   
   public static String displayName(RecoveryStatus status) {
-    if (status.host == null) return "--Unknown--";
+    if (status.host == null)
+      return "--Unknown--";
     InetSocketAddress monitorAddress = AddressUtil.parseAddress(status.host, 0);
     return monitorAddress.getHostName() + ":" + monitorAddress.getPort();
   }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/NumberType.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/NumberType.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/NumberType.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/util/celltypes/NumberType.java Thu Oct 27 15:24:51 2011
@@ -41,27 +41,36 @@ public class NumberType<T extends Number
     T number = (T) obj;
     String s = "-";
     if (number instanceof Double || number instanceof Float) {
-      if (warnMin != null && warnMax != null && errMin != null && errMax != null) s = commas(number.doubleValue(), warnMin.doubleValue(),
-          warnMax.doubleValue(), errMin.doubleValue(), errMax.doubleValue());
-      else if (errMin != null && errMax != null) s = commas(number.doubleValue(), errMin.doubleValue(), errMax.doubleValue());
-      else s = commas(number.doubleValue());
+      if (warnMin != null && warnMax != null && errMin != null && errMax != null)
+        s = commas(number.doubleValue(), warnMin.doubleValue(), warnMax.doubleValue(), errMin.doubleValue(), errMax.doubleValue());
+      else if (errMin != null && errMax != null)
+        s = commas(number.doubleValue(), errMin.doubleValue(), errMax.doubleValue());
+      else
+        s = commas(number.doubleValue());
     } else if (number instanceof Long || number instanceof Integer || number instanceof Short || number instanceof Byte) {
-      if (warnMin != null && warnMax != null && errMin != null && errMax != null) s = commas(number.longValue(), warnMin.longValue(), warnMax.longValue(),
-          errMin.longValue(), errMax.longValue());
-      else if (errMin != null && errMax != null) s = commas(number.longValue(), errMin.longValue(), errMax.longValue());
-      else s = commas(number.longValue());
+      if (warnMin != null && warnMax != null && errMin != null && errMax != null)
+        s = commas(number.longValue(), warnMin.longValue(), warnMax.longValue(), errMin.longValue(), errMax.longValue());
+      else if (errMin != null && errMax != null)
+        s = commas(number.longValue(), errMin.longValue(), errMax.longValue());
+      else
+        s = commas(number.longValue());
     } else {
-      if (number != null) s = String.valueOf(number);
+      if (number != null)
+        s = String.valueOf(number);
     }
     return s;
   }
   
   @Override
   public int compare(T o1, T o2) {
-    if (o1 == null && o2 == null) return 0;
-    else if (o1 == null) return -1;
-    else if (o2 == null) return 1;
-    else return Double.valueOf(o1.doubleValue()).compareTo(o2.doubleValue());
+    if (o1 == null && o2 == null)
+      return 0;
+    else if (o1 == null)
+      return -1;
+    else if (o2 == null)
+      return 1;
+    else
+      return Double.valueOf(o1.doubleValue()).compareTo(o2.doubleValue());
   }
   
   public static String commas(long i) {
@@ -69,7 +78,8 @@ public class NumberType<T extends Number
   }
   
   public static String commas(long i, long errMin, long errMax) {
-    if (i < errMin || i > errMax) return String.format("<span class='error'>%s</span>", bigNumber(i));
+    if (i < errMin || i > errMax)
+      return String.format("<span class='error'>%s</span>", bigNumber(i));
     return bigNumber(i);
   }
   
@@ -78,19 +88,24 @@ public class NumberType<T extends Number
   }
   
   public static String commas(double d, double errMin, double errMax) {
-    if (d < errMin || d > errMax) return String.format("<span class='error'>%s</span>", bigNumber(d));
+    if (d < errMin || d > errMax)
+      return String.format("<span class='error'>%s</span>", bigNumber(d));
     return bigNumber(d);
   }
   
   public static String commas(long i, long warnMin, long warnMax, long errMin, long errMax) {
-    if (i < errMin || i > errMax) return String.format("<span class='error'>%s</span>", bigNumber(i));
-    if (i < warnMin || i > warnMax) return String.format("<span class='warning'>%s</span>", bigNumber(i));
+    if (i < errMin || i > errMax)
+      return String.format("<span class='error'>%s</span>", bigNumber(i));
+    if (i < warnMin || i > warnMax)
+      return String.format("<span class='warning'>%s</span>", bigNumber(i));
     return bigNumber(i);
   }
   
   public static String commas(double d, double warnMin, double warnMax, double errMin, double errMax) {
-    if (d < errMin || d > errMax) return String.format("<span class='error'>%s</span>", bigNumber(d));
-    if (d < warnMin || d > warnMax) return String.format("<span class='warning'>%s</span>", bigNumber(d));
+    if (d < errMin || d > errMax)
+      return String.format("<span class='error'>%s</span>", bigNumber(d));
+    if (d < warnMin || d > warnMax)
+      return String.format("<span class='warning'>%s</span>", bigNumber(d));
     return bigNumber(d);
   }
   
@@ -108,7 +123,8 @@ public class NumberType<T extends Number
     float divisor = 1;
     for (int i = 0; i < SUFFIXES.length; i++) {
       if (big / divisor < 1024) {
-        if (i == 0) return String.format("%,d", big);
+        if (i == 0)
+          return String.format("%,d", big);
         return String.format("%,.2f%s", big / divisor, SUFFIXES[i]);
       }
       divisor *= base;
@@ -119,7 +135,8 @@ public class NumberType<T extends Number
   public static String bigNumber(double big, String[] SUFFIXES, long base) {
     float divisor = 1;
     for (int i = 0; i < SUFFIXES.length; i++) {
-      if (big / divisor < 1024) return String.format("%,.2f%s", big / divisor, SUFFIXES[i]);
+      if (big / divisor < 1024)
+        return String.format("%,.2f%s", big / divisor, SUFFIXES[i]);
       divisor *= base;
     }
     return String.format("%,.2f%s", big / divisor, SUFFIXES[SUFFIXES.length - 1]);



Mime
View raw message