public Path getLocalPathForWrite(String pathStr, 
      Configuration conf) throws IOException {
    return getLocalPathForWrite(pathStr, SIZE_UNKNOWN, conf);
  }
@Test(timeout = 30000)
  public void testGetLocalPathForWriteForLessSpace() throws Exception {
    String dir0 = buildBufferDir(ROOT, 0);
    String dir1 = buildBufferDir(ROOT, 1);
    conf.set(CONTEXT, dir0 + "," + dir1);
    LambdaTestUtils.intercept(DiskErrorException.class,
        String.format("Could not find any valid local directory for %s with requested size %s",
            "p1/x", Long.MAX_VALUE - 1), "Expect a DiskErrorException.",
        () -> dirAllocator.getLocalPathForWrite("p1/x", Long.MAX_VALUE - 1, conf));
  }