Quellcode durchsuchen

HDFS-597. Mofication introduced by HDFS-537 breakes an advice binding in FSDatasetAspects. Contributed by Konstantin Boudnik

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/branches/HDFS-265@820183 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze vor 15 Jahren
Ursprung
Commit
d4e40eef3f

+ 3 - 0
CHANGES.txt

@@ -98,6 +98,9 @@ Append branch (unreleased changes)
     HDFS-661. DataNode upgrade fails on non-existant current directory.
     (hairong)
 
+    HDFS-597. Mofication introduced by HDFS-537 breakes an advice binding in
+    FSDatasetAspects.  (Konstantin Boudnik via szetszwo)
+
 Trunk (unreleased changes)
 
   INCOMPATIBLE CHANGES

+ 4 - 6
src/test/aop/org/apache/hadoop/hdfs/server/datanode/FSDatasetAspects.aj

@@ -35,11 +35,9 @@ public aspect FSDatasetAspects {
   // the following will inject faults inside of the method in question 		
     execution (* FSDataset.getBlockFile(..)) && !within(FSDatasetAspects +);
 
-  // the following will inject faults before the actual call of the method
-  // call (* FSDataset.getBlockFile(..)) && !within(FSDatasetAspects +);
-
-  pointcut callCreateBlockWriteStream() : 
-    call (BlockWriteStreams FSDataset.createBlockWriteStreams(..)) 
+  pointcut callCreateBlockWriteStream(ReplicaInPipeline repl) : 
+    call (BlockWriteStreams createStreams())
+    && target (repl)
       && !within(FSDatasetAspects +);
 
   // This aspect specifies the logic of our fault point.
@@ -54,7 +52,7 @@ public aspect FSDatasetAspects {
     }
   }
 
-  before() throws DiskOutOfSpaceException : callCreateBlockWriteStream() {
+  before(ReplicaInPipeline repl) throws DiskOutOfSpaceException : callCreateBlockWriteStream(repl) {
     if (ProbabilityModel.injectCriteria(FSDataset.class.getSimpleName())) {
       LOG.info("Before the injection point");
       Thread.dumpStack();