Skip to content

Commit

Permalink
[FLINK-19032] Remove deprecated RuntimeContext#getAllAcumullators
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidwys committed Aug 26, 2020
1 parent d2d898b commit 5361713
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
Expand Down Expand Up @@ -143,15 +142,6 @@ public interface RuntimeContext {
*/
<V, A extends Serializable> Accumulator<V, A> getAccumulator(String name);

/**
* Returns a map of all registered accumulators for this task.
* The returned map must not be modified.
* @deprecated Use getAccumulator(..) to obtain the value of an accumulator.
*/
@Deprecated
@PublicEvolving
Map<String, Accumulator<?, ?>> getAllAccumulators();

/**
* Convenience function to create a counter object for integers.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.apache.flink.metrics.MetricGroup;

import java.io.Serializable;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.Future;

Expand Down Expand Up @@ -158,11 +157,6 @@ public <V, A extends Serializable> Accumulator<V, A> getAccumulator(String name)
return (Accumulator<V, A>) accumulators.get(name);
}

@Override
public Map<String, Accumulator<?, ?>> getAllAccumulators() {
return Collections.unmodifiableMap(this.accumulators);
}

@Override
public ClassLoader getUserCodeClassLoader() {
return this.userCodeClassLoader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static org.apache.flink.util.Preconditions.checkNotNull;
Expand Down Expand Up @@ -136,11 +135,6 @@ public <V, A extends Serializable> Accumulator<V, A> getAccumulator(final String
throw new UnsupportedOperationException("Accumulators are not supported.");
}

@Override
public Map<String, Accumulator<?, ?>> getAllAccumulators() {
throw new UnsupportedOperationException("Accumulators are not supported.");
}

@Override
public IntCounter getIntCounter(final String name) {
throw new UnsupportedOperationException("Int counters are not supported.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,6 @@ public void testCepRuntimeContext() {
// expected
}

try {
runtimeContext.getAllAccumulators();
fail("Expected getAllAccumulators to fail with unsupported operation exception.");
} catch (UnsupportedOperationException e) {
// expected
}

try {
runtimeContext.getIntCounter("foobar");
fail("Expected getIntCounter to fail with unsupported operation exception.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
Expand Down Expand Up @@ -135,12 +134,6 @@ public <V, A extends Serializable> Accumulator<V, A> getAccumulator(String name)
return ctx.getAccumulator(name);
}

@Override
@Deprecated
public Map<String, Accumulator<?, ?>> getAllAccumulators() {
return ctx.getAllAccumulators();
}

@Override
public IntCounter getIntCounter(String name) {
return ctx.getIntCounter(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
Expand Down Expand Up @@ -198,11 +197,6 @@ public <V, A extends Serializable> Accumulator<V, A> getAccumulator(String name)
throw new UnsupportedOperationException("Accumulators are not supported in rich async functions.");
}

@Override
public Map<String, Accumulator<?, ?>> getAllAccumulators() {
throw new UnsupportedOperationException("Accumulators are not supported in rich async functions.");
}

@Override
public IntCounter getIntCounter(String name) {
throw new UnsupportedOperationException("Int counters are not supported in rich async functions.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,6 @@ public Accumulator<Integer, Integer> clone() {
// expected
}

try {
runtimeContext.getAllAccumulators();
fail("Expected getAllAccumulators to fail with unsupported operation exception.");
} catch (UnsupportedOperationException e) {
// expected
}

try {
runtimeContext.getIntCounter("foobar");
fail("Expected getIntCounter to fail with unsupported operation exception.");
Expand Down

0 comments on commit 5361713

Please sign in to comment.