Search in sources :

Example 1 with Config

use of alluxio.LocalAlluxioClusterResource.Config in project alluxio by Alluxio.

the class LineageMasterClientRestApiTest method deleteLineage.

@Test
@Config(confParams = { PropertyKey.Name.USER_LINEAGE_ENABLED, "true" })
public void deleteLineage() throws Exception {
    LineageMaster lineageMaster = mMaster.getLineageMaster();
    long lineageId = lineageMaster.createLineage(new ArrayList<AlluxioURI>(), new ArrayList<AlluxioURI>(), new CommandLineJob("test", new JobConf("/output")));
    Map<String, String> params = new HashMap<>();
    params.put("lineageId", Long.toString(lineageId));
    params.put("cascade", "false");
    new TestCase(mHostname, mPort, getEndpoint(LineageMasterClientRestServiceHandler.DELETE_LINEAGE), params, HttpMethod.POST, true).run();
}
Also used : HashMap(java.util.HashMap) TestCase(alluxio.rest.TestCase) CommandLineJob(alluxio.job.CommandLineJob) JobConf(alluxio.job.JobConf) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest) Config(alluxio.LocalAlluxioClusterResource.Config)

Example 2 with Config

use of alluxio.LocalAlluxioClusterResource.Config in project alluxio by Alluxio.

the class LineageMasterClientRestApiTest method createLineage.

@Test
@Config(confParams = { PropertyKey.Name.USER_LINEAGE_ENABLED, "true" })
public void createLineage() throws Exception {
    mLineageClient.createFile(new AlluxioURI("/input")).close();
    Map<String, String> params = new HashMap<>();
    params.put("inputFiles", "/input");
    params.put("outputFiles", "/output");
    params.put("command", "test");
    params.put("commandOutputFile", "test");
    new TestCase(mHostname, mPort, getEndpoint(LineageMasterClientRestServiceHandler.CREATE_LINEAGE), params, HttpMethod.POST, null).call();
}
Also used : HashMap(java.util.HashMap) TestCase(alluxio.rest.TestCase) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest) Config(alluxio.LocalAlluxioClusterResource.Config)

Example 3 with Config

use of alluxio.LocalAlluxioClusterResource.Config in project alluxio by Alluxio.

the class LineageMasterClientRestApiTest method reinitializeFile.

@Test
@Config(confParams = { PropertyKey.Name.USER_LINEAGE_ENABLED, "true" })
public void reinitializeFile() throws Exception {
    mLineageClient.createFile(new AlluxioURI("/test")).close();
    Map<String, String> params = new HashMap<>();
    params.put("path", "/test");
    params.put("blockSizeBytes", "1");
    params.put("ttl", "1");
    params.put("ttlAction", TtlAction.DELETE.toString());
    new TestCase(mHostname, mPort, getEndpoint(LineageMasterClientRestServiceHandler.REINITIALIZE_FILE), params, HttpMethod.POST, null).call();
}
Also used : HashMap(java.util.HashMap) TestCase(alluxio.rest.TestCase) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest) Config(alluxio.LocalAlluxioClusterResource.Config)

Example 4 with Config

use of alluxio.LocalAlluxioClusterResource.Config in project alluxio by Alluxio.

the class LineageMasterClientRestApiTest method getLineageInfoList.

@Test
@Config(confParams = { PropertyKey.Name.USER_LINEAGE_ENABLED, "true" })
public void getLineageInfoList() throws Exception {
    AlluxioURI input = new AlluxioURI("/input");
    AlluxioURI output = new AlluxioURI("/output");
    LineageMaster lineageMaster = mMaster.getLineageMaster();
    mLineageClient.createFile(new AlluxioURI("/input")).close();
    long lineageId = lineageMaster.createLineage(Lists.newArrayList(input), Lists.newArrayList(output), new CommandLineJob("test", new JobConf(output.getPath())));
    String result = new TestCase(mHostname, mPort, getEndpoint(LineageMasterClientRestServiceHandler.GET_LINEAGE_INFO_LIST), NO_PARAMS, HttpMethod.GET, null).call();
    List<LineageInfo> lineageInfos = new ObjectMapper().readValue(result, new TypeReference<List<LineageInfo>>() {
    });
    LineageInfo lineageInfo = Iterables.getOnlyElement(lineageInfos);
    Assert.assertEquals(ImmutableList.of(input.toString()), lineageInfo.getInputFiles());
    Assert.assertEquals(ImmutableList.of(output.toString()), lineageInfo.getOutputFiles());
    Assert.assertEquals(lineageId, lineageInfo.getId());
}
Also used : TestCase(alluxio.rest.TestCase) ArrayList(java.util.ArrayList) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) CommandLineJob(alluxio.job.CommandLineJob) JobConf(alluxio.job.JobConf) LineageInfo(alluxio.wire.LineageInfo) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest) Config(alluxio.LocalAlluxioClusterResource.Config)

Example 5 with Config

use of alluxio.LocalAlluxioClusterResource.Config in project alluxio by Alluxio.

the class LineageMasterClientRestApiTest method reportLostFile.

@Test
@Config(confParams = { PropertyKey.Name.USER_LINEAGE_ENABLED, "true" })
public void reportLostFile() throws Exception {
    mLineageClient.createFile(new AlluxioURI("/test")).close();
    Map<String, String> params = new HashMap<>();
    params.put("path", "/test");
    new TestCase(mHostname, mPort, getEndpoint(LineageMasterClientRestServiceHandler.REPORT_LOST_FILE), params, HttpMethod.POST, null).run();
}
Also used : HashMap(java.util.HashMap) TestCase(alluxio.rest.TestCase) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test) RestApiTest(alluxio.rest.RestApiTest) Config(alluxio.LocalAlluxioClusterResource.Config)

Aggregations

AlluxioURI (alluxio.AlluxioURI)5 Config (alluxio.LocalAlluxioClusterResource.Config)5 RestApiTest (alluxio.rest.RestApiTest)5 TestCase (alluxio.rest.TestCase)5 Test (org.junit.Test)5 HashMap (java.util.HashMap)4 CommandLineJob (alluxio.job.CommandLineJob)2 JobConf (alluxio.job.JobConf)2 LineageInfo (alluxio.wire.LineageInfo)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ImmutableList (com.google.common.collect.ImmutableList)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1