hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nspiegelb...@apache.org
Subject svn commit: r1181578 - in /hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase: ipc/HRegionInterface.java regionserver/HRegionServer.java regionserver/wal/HLog.java
Date Tue, 11 Oct 2011 02:22:05 GMT
Author: nspiegelberg
Date: Tue Oct 11 02:22:04 2011
New Revision: 1181578

URL: http://svn.apache.org/viewvc?rev=1181578&view=rev
Log:
Added a method to return a list of HLog files

Summary:
1. Added a method in HLog to return a list of HLog files.
2. Exposed that via HRegionServer + HRegionInterface.
3. Pass true / false : depending on whether current HLog should be rolled.

Test Plan:
Tested on dev cluster

Reviewed By: kannan
Reviewers: kannan, nspiegelberg, jgray
Commenters: jgray
CC: pritam, aaiyer, kranganathan, madhuvaidya, jgray, kannan
Differential Revision: 270044

Modified:
    hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java
    hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java

Modified: hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java?rev=1181578&r1=1181577&r2=1181578&view=diff
==============================================================================
--- hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java (original)
+++ hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java Tue
Oct 11 02:22:04 2011
@@ -83,6 +83,13 @@ public interface HRegionInterface extend
     throws IllegalArgumentException;
 
   /**
+  * @param rollCurrentHLog if true, the current HLog is rolled and will be
+  * included in the list returned
+  * @return list of HLog files
+  */
+  public List<String> getHLogsList(boolean rollCurrentHLog) throws IOException;
+
+  /**
    * Perform Get operation.
    * @param regionName name of region to get from
    * @param get Get operation

Modified: hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1181578&r1=1181577&r2=1181578&view=diff
==============================================================================
--- hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Tue Oct 11 02:22:04 2011
@@ -1176,6 +1176,16 @@ public class HRegionServer implements HR
   }
 
   /**
+   * @param rollCurrentHLog if true, the current HLog is rolled and will be
+   * included in the list returned
+   * @return list of HLog files
+   */
+  public List<String> getHLogsList(boolean rollCurrentHLog) throws IOException {
+    if (rollCurrentHLog) this.hlog.rollWriter();
+    return this.hlog.getHLogsList();
+  }
+
+  /**
    * Sets a flag that will cause all the HRegionServer threads to shut down
    * in an orderly fashion.  Used by unit tests.
    */

Modified: hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java?rev=1181578&r1=1181577&r2=1181578&view=diff
==============================================================================
--- hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java (original)
+++ hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java Tue
Oct 11 02:22:04 2011
@@ -441,6 +441,17 @@ public class HLog implements Syncable {
   }
 
   /**
+   * @return list of all log files
+   */
+  public List<String> getHLogsList() {
+    List<String> hLogsList = new ArrayList<String>(this.outputfiles.size());
+    for (Path hlog : this.outputfiles.values()) {
+      hLogsList.add(hlog.toString());
+    }
+    return hLogsList;
+  }
+
+  /**
    * Roll the log writer. That is, start writing log messages to a new file.
    *
    * Because a log cannot be rolled during a cache flush, and a cache flush



Mime
View raw message