Project

General

Profile

Actions

Feature #4208

closed

Add more replication pool tests for Hadoop / Ceph bindings

Added by Anonymous about 11 years ago. Updated about 5 years ago.

Status:
Rejected
Priority:
Low
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Reviewed:
Affected Versions:
Component(FS):
Labels (FS):
Java/Hadoop
Pull request ID:

Description

We should add a test (or several) for the scenario where the user specifies a level of replication that does not exactly match an existing pool. This would require the logic that "rounds up" to kick in (which is what we want to test).

Actions #1

Updated by Noah Watkins about 11 years ago

Something like this added to the current custom test should do the trick?

diff --git a/src/test/org/apache/hadoop/fs/ceph/TestCephCustomReplication.java b/src/test/org/apache/hadoop/fs/ceph/TestCephCustomReplication.java
index 19e1a3d..a6e1286 100644
--- a/src/test/org/apache/hadoop/fs/ceph/TestCephCustomReplication.java
+++ b/src/test/org/apache/hadoop/fs/ceph/TestCephCustomReplication.java
@@ -14,12 +14,12 @@ public class TestCephCustomReplication extends CephTestBase {
     String pools[] = getConfiguredDataPools();
     assertTrue(pools.length > 0);

-    int i = 0;
+    int max_repl = 0;
     for (String pool : pools) {
       int repl = getPoolReplication(pool);
+      max_repl = max(max_repl, max_repl)

       Path path = new Path("/file.custom.repl." + pool + "." + repl);
-      System.out.println("path " + path + " pool " + pool + " repl " + repl);

       FSDataOutputStream out = fs.create(path, false, 4096,
           (short)repl, fs.getDefaultBlockSize());
@@ -31,5 +31,18 @@ public class TestCephCustomReplication extends CephTestBase {

       fs.delete(path);
     }
+
+    assert max_repl < Short.MAX_VALUE;
+
+    Path path = new Path("/file.custom.repl." + Short.MAX_VALUE);
+    FSDataOutputStream out = fs.create(path, false, 4096,
+        Short.MAX_VALUE, fs.getDefaultBlockSize());
+    out.write(data, 0, data.length);
+    out.close();
+
+    FileStatus status = fs.getFileStatus(path);
+    assertTrue(status.getReplication() == max_repl);
+
+    fs.delete(path);
   }
 }
Actions #2

Updated by John Spray over 6 years ago

  • Project changed from Ceph to CephFS
  • Category changed from 20 to 48

Bulk move of hadoop category into FS project.

Actions #3

Updated by Patrick Donnelly about 5 years ago

  • Status changed from New to Rejected

Java/Hadoop testing is no longer a priority.

Actions #4

Updated by Patrick Donnelly about 5 years ago

  • Category deleted (48)
  • Labels (FS) Java/Hadoop added
Actions

Also available in: Atom PDF