keith-turner commented on PR #5776:
URL: https://github.com/apache/accumulo/pull/5776#issuecomment-3151544701

   This is the test code used to verify the old HDFS API call would create 
parent dirs.
   
   ```diff
   diff --git a/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java 
b/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
   index 9b99c5f24e..a66a7ce242 100644
   --- a/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
   +++ b/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
   @@ -40,6 +40,7 @@ import 
org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
    import org.apache.accumulo.server.ServerContext;
    import org.apache.accumulo.test.functional.ConfigurableMacBase;
    import org.apache.hadoop.conf.Configuration;
   +import org.apache.hadoop.fs.Path;
    import org.junit.jupiter.api.Test;
    
    public class TotalQueuedIT extends ConfigurableMacBase {
   @@ -65,6 +66,27 @@ public class TotalQueuedIT extends ConfigurableMacBase {
      @Test
      public void test() throws Exception {
        try (AccumuloClient c = 
Accumulo.newClient().from(getClientProperties()).build()) {
   +
   +      var statusBefore = 
getCluster().getMiniDfs().getFileSystem().listStatus(new Path("/"));
   +      for (var status : statusBefore) {
   +        System.out.println("before " + status);
   +      }
   +
   +      // call the HDFS API that RFileOperations used to call
   +      var os = getCluster().getMiniDfs().getFileSystem().create(new 
Path("/testcp/file.txt"), false,
   +          4096, (short) 3, 1048576);
   +      os.writeUTF("test data");
   +      os.close();
   +
   +      var statusAfter = 
getCluster().getMiniDfs().getFileSystem().listStatus(new Path("/"));
   +      for (var status : statusAfter) {
   +        System.out.println("after " + status);
   +      }
   +
   +      var is = getCluster().getMiniDfs().getFileSystem().open(new 
Path("/testcp/file.txt"));
   +      var data = is.readUTF();
   +      System.out.println("read:" + data);
   +
          String tableName = getUniqueNames(1)[0];
          c.tableOperations().create(tableName);
          c.tableOperations().setProperty(tableName, 
Property.TABLE_MAJC_RATIO.getKey(), "9999");
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to