Repository: tez Updated Branches: refs/heads/master bec90035b -> 282917344
TEZ-1058. Replace user land interfaces with abstract classes (bikas) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/28291734 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/28291734 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/28291734 Branch: refs/heads/master Commit: 2829173446165a3e6efc76a832166c5758e6838f Parents: bec9003 Author: Bikas Saha <[email protected]> Authored: Tue Jul 29 18:45:03 2014 -0700 Committer: Bikas Saha <[email protected]> Committed: Tue Jul 29 18:45:03 2014 -0700 ---------------------------------------------------------------------- CHANGES.txt | 9 ++- .../org/apache/tez/dag/api/EdgeManager.java | 4 +- .../apache/tez/dag/api/VertexManagerPlugin.java | 2 + .../tez/runtime/api/MemoryUpdateCallback.java | 9 +-- .../apache/tez/runtime/api/OutputCommitter.java | 2 + .../runtime/api/TezRootInputInitializer.java | 8 +-- .../common/objectregistry/ObjectRegistry.java | 1 + .../resources/InitialMemoryAllocator.java | 47 -------------- .../resources/InitialMemoryRequestContext.java | 66 -------------------- .../resources/InitialMemoryAllocator.java | 47 ++++++++++++++ .../resources/InitialMemoryRequestContext.java | 66 ++++++++++++++++++++ .../tez/dag/app/dag/impl/TestVertexImpl.java | 2 +- .../common/MRInputAMSplitGenerator.java | 2 +- .../common/MRInputSplitDistributor.java | 2 +- .../common/resources/TestMemoryDistributor.java | 2 +- .../common/MemoryUpdateCallbackHandler.java | 2 +- .../TestWeightedScalingMemoryDistributor.java | 2 +- .../apache/tez/test/dag/MultiAttemptDAG.java | 25 ++++---- 18 files changed, 149 insertions(+), 149 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 341dd6a..4b93e3f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -25,18 +25,17 @@ INCOMPATIBLE CHANGES TEZ-696. Remove implicit copying of processor payload to input and output TEZ-1269. TaskScheduler prematurely releases containers TEZ-857. Split Input/Output interfaces into user/framework components. - TEZ-866. Add a TezMergedInputContext for MergedInputs (bikas) + TEZ-866. Add a TezMergedInputContext for MergedInputs TEZ-1137. Move TezJobConfig to runtime-library and rename to - TezRuntimeConfiguration (bikas) + TezRuntimeConfiguration TEZ-1134. InputInitializer and OutputCommitter implicitly use payloads of - the input and output (bikas) + the input and output TEZ-1312. rename vertex.addInput/Output() to vertex.addDataSource/Sink() - (Chen He via bikas) TEZ-1311. get sharedobjectregistry from the context instead of a static - (bikas)" TEZ-1300. Change deploy mechanism for Tez to be based on a tarball which includes Hadoop libs. TEZ-1278. TezClient#waitTillReady() should not swallow interrupts + TEZ-1058. Replace user land interfaces with abstract classes Release 0.4.0-incubating: 2014-04-05 http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManager.java ---------------------------------------------------------------------- diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManager.java b/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManager.java index 1bc0bb1..92188e5 100644 --- a/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManager.java +++ b/tez-api/src/main/java/org/apache/tez/dag/api/EdgeManager.java @@ -21,7 +21,7 @@ package org.apache.tez.dag.api; import java.util.List; import java.util.Map; -import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.classification.InterfaceStability; import org.apache.tez.runtime.api.events.DataMovementEvent; import org.apache.tez.runtime.api.events.InputReadErrorEvent; @@ -32,7 +32,7 @@ import org.apache.tez.runtime.api.events.InputReadErrorEvent; * * Implementations must provide a 0 argument public constructor. */ -@Evolving [email protected] public abstract class EdgeManager { /** http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPlugin.java ---------------------------------------------------------------------- diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPlugin.java b/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPlugin.java index 41c5667..b628e74 100644 --- a/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPlugin.java +++ b/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPlugin.java @@ -21,6 +21,7 @@ package org.apache.tez.dag.api; import java.util.List; import java.util.Map; +import org.apache.hadoop.classification.InterfaceStability; import org.apache.tez.runtime.api.Event; import org.apache.tez.runtime.api.events.VertexManagerEvent; @@ -30,6 +31,7 @@ import org.apache.tez.runtime.api.events.VertexManagerEvent; * The plugin will be notified of interesting events in the vertex execution life * cycle and can respond to them by via the context object */ [email protected] public abstract class VertexManagerPlugin { /** * Initialize the plugin. Called when the vertex is initializing. This happens http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-api/src/main/java/org/apache/tez/runtime/api/MemoryUpdateCallback.java ---------------------------------------------------------------------- diff --git a/tez-api/src/main/java/org/apache/tez/runtime/api/MemoryUpdateCallback.java b/tez-api/src/main/java/org/apache/tez/runtime/api/MemoryUpdateCallback.java index c2c89d8..5556071 100644 --- a/tez-api/src/main/java/org/apache/tez/runtime/api/MemoryUpdateCallback.java +++ b/tez-api/src/main/java/org/apache/tez/runtime/api/MemoryUpdateCallback.java @@ -22,13 +22,14 @@ import org.apache.hadoop.classification.InterfaceStability.Unstable; /** * This interface will be used by Tez to inform components about available - * memory. This will typically be implemented by {@link Input}s, {@link Output}s - * and potentially {@link Processor}s + * memory. This will typically be implemented by authors of {@link Input}s, + * {@link Output}s and potentially {@link Processor}s in order to request + * for appropriate memory limits for the respective components. * */ @Unstable -public interface MemoryUpdateCallback { +public abstract class MemoryUpdateCallback { - public void memoryAssigned(long assignedSize); + public abstract void memoryAssigned(long assignedSize); } http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-api/src/main/java/org/apache/tez/runtime/api/OutputCommitter.java ---------------------------------------------------------------------- diff --git a/tez-api/src/main/java/org/apache/tez/runtime/api/OutputCommitter.java b/tez-api/src/main/java/org/apache/tez/runtime/api/OutputCommitter.java index aadbf12..445a69a 100644 --- a/tez-api/src/main/java/org/apache/tez/runtime/api/OutputCommitter.java +++ b/tez-api/src/main/java/org/apache/tez/runtime/api/OutputCommitter.java @@ -18,12 +18,14 @@ package org.apache.tez.runtime.api; +import org.apache.hadoop.classification.InterfaceStability; import org.apache.tez.dag.api.client.VertexStatus; /** * OutputCommitter to "finalize" the output and make it user-visible if needed. * The OutputCommitter is allowed only on a terminal Output. */ [email protected] public abstract class OutputCommitter { /** http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-api/src/main/java/org/apache/tez/runtime/api/TezRootInputInitializer.java ---------------------------------------------------------------------- diff --git a/tez-api/src/main/java/org/apache/tez/runtime/api/TezRootInputInitializer.java b/tez-api/src/main/java/org/apache/tez/runtime/api/TezRootInputInitializer.java index 8d2c82f..d73531a 100644 --- a/tez-api/src/main/java/org/apache/tez/runtime/api/TezRootInputInitializer.java +++ b/tez-api/src/main/java/org/apache/tez/runtime/api/TezRootInputInitializer.java @@ -20,7 +20,6 @@ package org.apache.tez.runtime.api; import java.util.List; -import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.tez.runtime.api.events.RootInputInitializerEvent; @@ -30,9 +29,8 @@ import org.apache.tez.runtime.api.events.RootInputInitializerEvent; * vertex, determine the number of tasks at runtime, update the Input payload * etc. */ [email protected] @InterfaceStability.Unstable -public interface TezRootInputInitializer { +public abstract class TezRootInputInitializer { /** * Run the root input initializer. This is the main method where initialization takes place. If an @@ -46,7 +44,7 @@ public interface TezRootInputInitializer { * for routing * @throws Exception */ - List<Event> initialize(TezRootInputInitializerContext inputVertexContext) + public abstract List<Event> initialize(TezRootInputInitializerContext inputVertexContext) throws Exception; /** @@ -58,6 +56,6 @@ public interface TezRootInputInitializer { * @param events list of events * @throws Exception */ - void handleInputInitializerEvent(List<RootInputInitializerEvent> events) throws Exception; + public abstract void handleInputInitializerEvent(List<RootInputInitializerEvent> events) throws Exception; } http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-api/src/main/java/org/apache/tez/runtime/common/objectregistry/ObjectRegistry.java ---------------------------------------------------------------------- diff --git a/tez-api/src/main/java/org/apache/tez/runtime/common/objectregistry/ObjectRegistry.java b/tez-api/src/main/java/org/apache/tez/runtime/common/objectregistry/ObjectRegistry.java index e748c27..70bb94e 100644 --- a/tez-api/src/main/java/org/apache/tez/runtime/common/objectregistry/ObjectRegistry.java +++ b/tez-api/src/main/java/org/apache/tez/runtime/common/objectregistry/ObjectRegistry.java @@ -21,6 +21,7 @@ package org.apache.tez.runtime.common.objectregistry; /** * Preliminary version of a simple shared object cache to re-use * objects across multiple tasks within the same container/JVM. + * This interface is not supposed to be implemented by users */ public interface ObjectRegistry { http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-api/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryAllocator.java ---------------------------------------------------------------------- diff --git a/tez-api/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryAllocator.java b/tez-api/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryAllocator.java deleted file mode 100644 index 6910f23..0000000 --- a/tez-api/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryAllocator.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * 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. - */ - -package org.apache.tez.runtime.common.resources; - -import org.apache.hadoop.classification.InterfaceAudience.Private; -import org.apache.hadoop.conf.Configurable; - - - -/** - * Used to balance memory requests before a task starts executing. - */ -@Private -public interface InitialMemoryAllocator extends Configurable { - - /** - * @param availableForAllocation - * memory available for allocation - * @param numTotalInputs - * number of inputs for the task - * @param numTotalOutputs - * number of outputs for the tasks - * @param requests - * Iterable view of requests received - * @return list of allocations, one per request. This must be ordered in the - * same order of the requests. - */ - public abstract Iterable<Long> assignMemory(long availableForAllocation, int numTotalInputs, - int numTotalOutputs, Iterable<InitialMemoryRequestContext> requests); - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-api/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryRequestContext.java ---------------------------------------------------------------------- diff --git a/tez-api/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryRequestContext.java b/tez-api/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryRequestContext.java deleted file mode 100644 index aec3795..0000000 --- a/tez-api/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryRequestContext.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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. - */ - -package org.apache.tez.runtime.common.resources; - -import com.google.common.base.Preconditions; -import org.apache.hadoop.classification.InterfaceAudience.Private; - - -@Private -public class InitialMemoryRequestContext { - - public static enum ComponentType { - INPUT, OUTPUT, PROCESSOR - } - - private long requestedSize; - // TODO Replace this with the entire descriptor at some point. ComponentType - // automatically goes away. - private String componentClassName; - private ComponentType componentType; - private String componentVertexName; - - public InitialMemoryRequestContext(long requestedSize, String componentClassName, - ComponentType componentType, String componentVertexName) { - Preconditions.checkNotNull(componentClassName, "componentClassName is null"); - Preconditions.checkNotNull(componentType, "componentType is null"); - Preconditions.checkNotNull(componentVertexName, "componentVertexName is null"); - this.requestedSize = requestedSize; - this.componentClassName = componentClassName; - this.componentType = componentType; - this.componentVertexName = componentVertexName; - } - - public long getRequestedSize() { - return requestedSize; - } - - public String getComponentClassName() { - return componentClassName; - } - - public ComponentType getComponentType() { - return componentType; - } - - public String getComponentVertexName() { - return componentVertexName; - } - -} http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-common/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryAllocator.java ---------------------------------------------------------------------- diff --git a/tez-common/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryAllocator.java b/tez-common/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryAllocator.java new file mode 100644 index 0000000..6910f23 --- /dev/null +++ b/tez-common/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryAllocator.java @@ -0,0 +1,47 @@ +/** + * 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. + */ + +package org.apache.tez.runtime.common.resources; + +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.conf.Configurable; + + + +/** + * Used to balance memory requests before a task starts executing. + */ +@Private +public interface InitialMemoryAllocator extends Configurable { + + /** + * @param availableForAllocation + * memory available for allocation + * @param numTotalInputs + * number of inputs for the task + * @param numTotalOutputs + * number of outputs for the tasks + * @param requests + * Iterable view of requests received + * @return list of allocations, one per request. This must be ordered in the + * same order of the requests. + */ + public abstract Iterable<Long> assignMemory(long availableForAllocation, int numTotalInputs, + int numTotalOutputs, Iterable<InitialMemoryRequestContext> requests); + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-common/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryRequestContext.java ---------------------------------------------------------------------- diff --git a/tez-common/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryRequestContext.java b/tez-common/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryRequestContext.java new file mode 100644 index 0000000..aec3795 --- /dev/null +++ b/tez-common/src/main/java/org/apache/tez/runtime/common/resources/InitialMemoryRequestContext.java @@ -0,0 +1,66 @@ +/** + * 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. + */ + +package org.apache.tez.runtime.common.resources; + +import com.google.common.base.Preconditions; +import org.apache.hadoop.classification.InterfaceAudience.Private; + + +@Private +public class InitialMemoryRequestContext { + + public static enum ComponentType { + INPUT, OUTPUT, PROCESSOR + } + + private long requestedSize; + // TODO Replace this with the entire descriptor at some point. ComponentType + // automatically goes away. + private String componentClassName; + private ComponentType componentType; + private String componentVertexName; + + public InitialMemoryRequestContext(long requestedSize, String componentClassName, + ComponentType componentType, String componentVertexName) { + Preconditions.checkNotNull(componentClassName, "componentClassName is null"); + Preconditions.checkNotNull(componentType, "componentType is null"); + Preconditions.checkNotNull(componentVertexName, "componentVertexName is null"); + this.requestedSize = requestedSize; + this.componentClassName = componentClassName; + this.componentType = componentType; + this.componentVertexName = componentVertexName; + } + + public long getRequestedSize() { + return requestedSize; + } + + public String getComponentClassName() { + return componentClassName; + } + + public ComponentType getComponentType() { + return componentType; + } + + public String getComponentVertexName() { + return componentVertexName; + } + +} http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java index 7becaad..7ca8c60 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java @@ -3431,7 +3431,7 @@ public class TestVertexImpl { } @InterfaceAudience.Private - public static class EventHandlingRootInputInitializer implements TezRootInputInitializer { + public static class EventHandlingRootInputInitializer extends TezRootInputInitializer { final AtomicBoolean initStarted = new AtomicBoolean(false); final AtomicBoolean eventReceived = new AtomicBoolean(false); http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/common/MRInputAMSplitGenerator.java ---------------------------------------------------------------------- diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/common/MRInputAMSplitGenerator.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/common/MRInputAMSplitGenerator.java index 4e1e0b6..ba3ee7a 100644 --- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/common/MRInputAMSplitGenerator.java +++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/common/MRInputAMSplitGenerator.java @@ -48,7 +48,7 @@ import com.google.common.base.Stopwatch; import com.google.common.collect.Lists; import org.apache.tez.runtime.api.events.RootInputInitializerEvent; -public class MRInputAMSplitGenerator implements TezRootInputInitializer { +public class MRInputAMSplitGenerator extends TezRootInputInitializer { private boolean sendSerializedEvents; http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/common/MRInputSplitDistributor.java ---------------------------------------------------------------------- diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/common/MRInputSplitDistributor.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/common/MRInputSplitDistributor.java index a2aa5d8..87d88a6 100644 --- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/common/MRInputSplitDistributor.java +++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/common/MRInputSplitDistributor.java @@ -41,7 +41,7 @@ import org.apache.tez.runtime.api.events.RootInputUpdatePayloadEvent; import com.google.common.base.Stopwatch; import com.google.common.collect.Lists; -public class MRInputSplitDistributor implements TezRootInputInitializer { +public class MRInputSplitDistributor extends TezRootInputInitializer { private static final Log LOG = LogFactory.getLog(MRInputSplitDistributor.class); http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-runtime-internals/src/test/java/org/apache/tez/runtime/common/resources/TestMemoryDistributor.java ---------------------------------------------------------------------- diff --git a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/common/resources/TestMemoryDistributor.java b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/common/resources/TestMemoryDistributor.java index 522ec23..9d5f2e6 100644 --- a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/common/resources/TestMemoryDistributor.java +++ b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/common/resources/TestMemoryDistributor.java @@ -211,7 +211,7 @@ public class TestMemoryDistributor { } - private static class MemoryUpdateCallbackForTest implements MemoryUpdateCallback { + private static class MemoryUpdateCallbackForTest extends MemoryUpdateCallback { long assigned = -1000; http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/MemoryUpdateCallbackHandler.java ---------------------------------------------------------------------- diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/MemoryUpdateCallbackHandler.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/MemoryUpdateCallbackHandler.java index b2dedee..5cf46c7 100644 --- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/MemoryUpdateCallbackHandler.java +++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/MemoryUpdateCallbackHandler.java @@ -22,7 +22,7 @@ import org.apache.tez.runtime.api.MemoryUpdateCallback; import com.google.common.base.Preconditions; -public class MemoryUpdateCallbackHandler implements MemoryUpdateCallback { +public class MemoryUpdateCallbackHandler extends MemoryUpdateCallback { private long assignedMemory; private boolean updated = false; http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-runtime-library/src/test/java/org/apache/tez/runtime/common/resources/TestWeightedScalingMemoryDistributor.java ---------------------------------------------------------------------- diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/common/resources/TestWeightedScalingMemoryDistributor.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/common/resources/TestWeightedScalingMemoryDistributor.java index eefcb0b..dc2c1bc 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/common/resources/TestWeightedScalingMemoryDistributor.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/common/resources/TestWeightedScalingMemoryDistributor.java @@ -145,7 +145,7 @@ public class TestWeightedScalingMemoryDistributor extends TestMemoryDistributor assertEquals(1500, e4Callback.assigned); } - private static class MemoryUpdateCallbackForTest implements MemoryUpdateCallback { + private static class MemoryUpdateCallbackForTest extends MemoryUpdateCallback { long assigned = -1000; http://git-wip-us.apache.org/repos/asf/tez/blob/28291734/tez-tests/src/test/java/org/apache/tez/test/dag/MultiAttemptDAG.java ---------------------------------------------------------------------- diff --git a/tez-tests/src/test/java/org/apache/tez/test/dag/MultiAttemptDAG.java b/tez-tests/src/test/java/org/apache/tez/test/dag/MultiAttemptDAG.java index 1dc8879..a6768a7 100644 --- a/tez-tests/src/test/java/org/apache/tez/test/dag/MultiAttemptDAG.java +++ b/tez-tests/src/test/java/org/apache/tez/test/dag/MultiAttemptDAG.java @@ -202,7 +202,7 @@ public class MultiAttemptDAG { } } - public static class FailingInputInitializer implements TezRootInputInitializer { + public static class FailingInputInitializer extends TezRootInputInitializer { @Override public List<Event> initialize(TezRootInputInitializerContext inputVertexContext) throws Exception { @@ -225,11 +225,14 @@ public class MultiAttemptDAG { } } - public static class NoOpInput extends AbstractLogicalInput implements MemoryUpdateCallback { + public static class NoOpInput extends AbstractLogicalInput { @Override public List<Event> initialize() throws Exception { - inputContext.requestInitialMemory(1l, this); + inputContext.requestInitialMemory(1l, new MemoryUpdateCallback() { + @Override + public void memoryAssigned(long assignedSize) {} + }); return null; } @@ -252,18 +255,16 @@ public class MultiAttemptDAG { public List<Event> close() throws Exception { return null; } - - @Override - public void memoryAssigned(long assignedSize) { - - } } - public static class NoOpOutput extends AbstractLogicalOutput implements MemoryUpdateCallback { + public static class NoOpOutput extends AbstractLogicalOutput { @Override public List<Event> initialize() throws Exception { - outputContext.requestInitialMemory(1l, this); + outputContext.requestInitialMemory(1l, new MemoryUpdateCallback() { + @Override + public void memoryAssigned(long assignedSize) {} + }); return null; } @@ -286,10 +287,6 @@ public class MultiAttemptDAG { public List<Event> close() throws Exception { return null; } - - @Override - public void memoryAssigned(long assignedSize) { - } }
