Search in sources :

Example 1 with StartAfterParam

use of org.apache.hadoop.hdfs.web.resources.StartAfterParam in project hadoop by apache.

the class TestWebHdfsUrl method testBatchedListingUrl.

@Test(timeout = 60000)
public void testBatchedListingUrl() throws Exception {
    Configuration conf = new Configuration();
    UserGroupInformation ugi = UserGroupInformation.createRemoteUser("test-user");
    UserGroupInformation.setLoginUser(ugi);
    WebHdfsFileSystem webhdfs = getWebHdfsFileSystem(ugi, conf);
    Path fsPath = new Path("/p1");
    final StartAfterParam startAfter = new StartAfterParam("last");
    URL url = webhdfs.toUrl(GetOpParam.Op.LISTSTATUS_BATCH, fsPath, startAfter);
    checkQueryParams(new String[] { GetOpParam.Op.LISTSTATUS_BATCH.toQueryString(), new UserParam(ugi.getShortUserName()).toString(), StartAfterParam.NAME + "=" + "last" }, url);
}
Also used : Path(org.apache.hadoop.fs.Path) UserParam(org.apache.hadoop.hdfs.web.resources.UserParam) Configuration(org.apache.hadoop.conf.Configuration) StartAfterParam(org.apache.hadoop.hdfs.web.resources.StartAfterParam) URL(java.net.URL) UserGroupInformation(org.apache.hadoop.security.UserGroupInformation) Test(org.junit.Test)

Aggregations

URL (java.net.URL)1 Configuration (org.apache.hadoop.conf.Configuration)1 Path (org.apache.hadoop.fs.Path)1 StartAfterParam (org.apache.hadoop.hdfs.web.resources.StartAfterParam)1 UserParam (org.apache.hadoop.hdfs.web.resources.UserParam)1 UserGroupInformation (org.apache.hadoop.security.UserGroupInformation)1 Test (org.junit.Test)1