Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

[codespell]
ignore-words-list = thirdparty,afterall,AfterAll
26 changes: 13 additions & 13 deletions hadoop-shim-impls/hadoop-shim-2.7/pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
Expand All @@ -29,10 +33,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tez</groupId>
<artifactId>hadoop-shim</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.tez.hadoop.shim;

import org.apache.hadoop.classification.InterfaceAudience.Private;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.tez.hadoop.shim;

import java.util.EnumSet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
/**
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.tez.hadoop.shim;

import static org.junit.jupiter.api.Assertions.*;

import org.apache.hadoop.conf.Configuration;
import org.junit.Assert;
import org.junit.Test;

import org.junit.jupiter.api.*;

public class TestHadoop25_26_27ShimProvider {

@Test
public void testShimProvider() {
HadoopShim25_26_27Provider provider = new HadoopShim25_26_27Provider();
Assert.assertNull(provider.createHadoopShim("foo", 2, 2));
Assert.assertNull(provider.createHadoopShim("foo", 2, 1));
Assert.assertNull(provider.createHadoopShim("foo", 2, 3));
Assert.assertNull(provider.createHadoopShim("foo", 2, 8));
Assert.assertNull(provider.createHadoopShim("foo", 3, 3));
Assert.assertNotNull(provider.createHadoopShim("foo", 2, 5));
Assert.assertNotNull(provider.createHadoopShim("foo", 2, 6));
Assert.assertNotNull(provider.createHadoopShim("foo", 2, 7));
assertNull(provider.createHadoopShim("foo", 2, 2));
assertNull(provider.createHadoopShim("foo", 2, 1));
assertNull(provider.createHadoopShim("foo", 2, 3));
assertNull(provider.createHadoopShim("foo", 2, 8));
assertNull(provider.createHadoopShim("foo", 3, 3));
assertNotNull(provider.createHadoopShim("foo", 2, 5));
assertNotNull(provider.createHadoopShim("foo", 2, 6));
assertNotNull(provider.createHadoopShim("foo", 2, 7));

Assert.assertEquals(HadoopShim27.class,
assertEquals(HadoopShim27.class,
provider.createHadoopShim("foo", 2, 7).getClass());
}

Expand All @@ -50,8 +52,8 @@ public void testLoaderOverride() {
conf.set(HadoopShimsLoader.TEZ_HADOOP_SHIM_HADOOP_VERSION_OVERRIDE, "2.7.0");
HadoopShimsLoader loader = new HadoopShimsLoader(conf, true);
HadoopShim shim = loader.getHadoopShim();
Assert.assertNotNull(shim);
Assert.assertEquals(HadoopShim27.class, shim.getClass());
assertNotNull(shim);
assertEquals(HadoopShim27.class, shim.getClass());
}

@Test
Expand All @@ -61,8 +63,8 @@ public void testInvalidVersion() {
conf.set(HadoopShimsLoader.TEZ_HADOOP_SHIM_HADOOP_VERSION_OVERRIDE, "2.9.0");
HadoopShimsLoader loader = new HadoopShimsLoader(conf, true);
HadoopShim shim = loader.getHadoopShim();
Assert.assertNotNull(shim);
Assert.assertEquals(DefaultHadoopShim.class, shim.getClass());
assertNotNull(shim);
assertEquals(DefaultHadoopShim.class, shim.getClass());
}

@Test
Expand All @@ -74,8 +76,8 @@ public void testLoaderOverrideInvalidVersion() {
conf.set(HadoopShimsLoader.TEZ_HADOOP_SHIM_HADOOP_VERSION_OVERRIDE, "2.1.0");
HadoopShimsLoader loader = new HadoopShimsLoader(conf, true);
HadoopShim shim = loader.getHadoopShim();
Assert.assertNotNull(shim);
Assert.assertEquals(DefaultHadoopShim.class, shim.getClass());
assertNotNull(shim);
assertEquals(DefaultHadoopShim.class, shim.getClass());
}

}
4 changes: 0 additions & 4 deletions hadoop-shim-impls/hadoop-shim-2.8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tez</groupId>
<artifactId>hadoop-shim</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,46 @@
*/
package org.apache.tez.hadoop.shim;

import static org.junit.jupiter.api.Assertions.*;

import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;

import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.*;


public class TestHadoopShim28 {

@Test
public void testApplyFinalApplicationStatusCorrection() {
HadoopShim shim = new HadoopShim28();
// Session mode success/failure, change to ended
Assert.assertEquals(FinalApplicationStatus.ENDED,
assertEquals(FinalApplicationStatus.ENDED,
shim.applyFinalApplicationStatusCorrection(FinalApplicationStatus.SUCCEEDED, true, false));
Assert.assertEquals(FinalApplicationStatus.ENDED,
assertEquals(FinalApplicationStatus.ENDED,
shim.applyFinalApplicationStatusCorrection(FinalApplicationStatus.FAILED, true, false));

// Non-session mode success/failure, retain success/failure
Assert.assertEquals(FinalApplicationStatus.SUCCEEDED,
assertEquals(FinalApplicationStatus.SUCCEEDED,
shim.applyFinalApplicationStatusCorrection(FinalApplicationStatus.SUCCEEDED, false, false));
Assert.assertEquals(FinalApplicationStatus.FAILED,
assertEquals(FinalApplicationStatus.FAILED,
shim.applyFinalApplicationStatusCorrection(FinalApplicationStatus.FAILED, false, false));

// Session and non-session mode error, retain failed.
Assert.assertEquals(FinalApplicationStatus.FAILED,
assertEquals(FinalApplicationStatus.FAILED,
shim.applyFinalApplicationStatusCorrection(FinalApplicationStatus.FAILED, true, true));
Assert.assertEquals(FinalApplicationStatus.FAILED,
assertEquals(FinalApplicationStatus.FAILED,
shim.applyFinalApplicationStatusCorrection(FinalApplicationStatus.FAILED, false, true));

// Session and non-session mode killed is killed.
Assert.assertEquals(FinalApplicationStatus.KILLED,
assertEquals(FinalApplicationStatus.KILLED,
shim.applyFinalApplicationStatusCorrection(FinalApplicationStatus.KILLED, true, false));
Assert.assertEquals(FinalApplicationStatus.KILLED,
assertEquals(FinalApplicationStatus.KILLED,
shim.applyFinalApplicationStatusCorrection(FinalApplicationStatus.KILLED, false, false));

// Session and non-session mode undefined is undefined.
Assert.assertEquals(FinalApplicationStatus.UNDEFINED,
assertEquals(FinalApplicationStatus.UNDEFINED,
shim.applyFinalApplicationStatusCorrection(FinalApplicationStatus.UNDEFINED, true, false));
Assert.assertEquals(FinalApplicationStatus.UNDEFINED,
assertEquals(FinalApplicationStatus.UNDEFINED,
shim.applyFinalApplicationStatusCorrection(FinalApplicationStatus.UNDEFINED, false, false));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,27 @@
*/
package org.apache.tez.hadoop.shim;

import static org.junit.jupiter.api.Assertions.*;

import org.apache.hadoop.conf.Configuration;

import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.*;


public class TestHadoopShim28Provider {

@Test
public void testShimProvider() {
HadoopShim28Provider provider = new HadoopShim28Provider();
Assert.assertNull(provider.createHadoopShim("foo", 2, 2));
Assert.assertNull(provider.createHadoopShim("foo", 2, 7));
Assert.assertNull(provider.createHadoopShim("foo", 2, 5));
Assert.assertNull(provider.createHadoopShim("foo", 2, 6));
Assert.assertNull(provider.createHadoopShim("foo", 3, 3));
Assert.assertNotNull(provider.createHadoopShim("foo", 2, 8));
Assert.assertNotNull(provider.createHadoopShim("foo", 2, 111));
assertNull(provider.createHadoopShim("foo", 2, 2));
assertNull(provider.createHadoopShim("foo", 2, 7));
assertNull(provider.createHadoopShim("foo", 2, 5));
assertNull(provider.createHadoopShim("foo", 2, 6));
assertNull(provider.createHadoopShim("foo", 3, 3));
assertNotNull(provider.createHadoopShim("foo", 2, 8));
assertNotNull(provider.createHadoopShim("foo", 2, 111));

Assert.assertEquals(HadoopShim28.class,
assertEquals(HadoopShim28.class,
provider.createHadoopShim("foo", 2, 9).getClass());
}

Expand All @@ -50,8 +52,8 @@ public void testLoaderOverride() {
conf.set(HadoopShimsLoader.TEZ_HADOOP_SHIM_HADOOP_VERSION_OVERRIDE, "2.8.0");
HadoopShimsLoader loader = new HadoopShimsLoader(conf, true);
HadoopShim shim = loader.getHadoopShim();
Assert.assertNotNull(shim);
Assert.assertEquals(HadoopShim28.class, shim.getClass());
assertNotNull(shim);
assertEquals(HadoopShim28.class, shim.getClass());
}

@Test
Expand All @@ -61,8 +63,8 @@ public void testInvalidVersion() {
conf.set(HadoopShimsLoader.TEZ_HADOOP_SHIM_HADOOP_VERSION_OVERRIDE, "2.2.0");
HadoopShimsLoader loader = new HadoopShimsLoader(conf, true);
HadoopShim shim = loader.getHadoopShim();
Assert.assertNotNull(shim);
Assert.assertEquals(DefaultHadoopShim.class, shim.getClass());
assertNotNull(shim);
assertEquals(DefaultHadoopShim.class, shim.getClass());
}

@Test
Expand All @@ -74,8 +76,8 @@ public void testLoaderOverrideInvalidVersion() {
conf.set(HadoopShimsLoader.TEZ_HADOOP_SHIM_HADOOP_VERSION_OVERRIDE, "2.1.0");
HadoopShimsLoader loader = new HadoopShimsLoader(conf, true);
HadoopShim shim = loader.getHadoopShim();
Assert.assertNotNull(shim);
Assert.assertEquals(DefaultHadoopShim.class, shim.getClass());
assertNotNull(shim);
assertEquals(DefaultHadoopShim.class, shim.getClass());
}

}
4 changes: 0 additions & 4 deletions hadoop-shim/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-api</artifactId>
Expand Down
Loading