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
4 changes: 3 additions & 1 deletion storm-client/src/jvm/org/apache/storm/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,10 @@ public class Config extends HashMap<String, Object> {
* Array of components that scheduler should try to place on separate hosts when using the constraint solver strategy or the
* multi-tenant scheduler. Note that this configuration can be specified in TOPOLOGY_RAS_CONSTRAINTS using the
* "maxNodeCoLocationCnt" map entry with value of 1.
*
* @deprecated Please use {@link #TOPOLOGY_RAS_CONSTRAINTS} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
@IsStringList
public static final String TOPOLOGY_SPREAD_COMPONENTS = "topology.spread.components";
/**
Expand Down
2 changes: 1 addition & 1 deletion storm-client/src/jvm/org/apache/storm/ILocalCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ILocalTopology submitTopologyWithOpts(String topologyName, Map<String, Object> c
*
* @deprecated use {@link #close()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
void shutdown();

/**
Expand Down
2 changes: 1 addition & 1 deletion storm-client/src/jvm/org/apache/storm/ILocalDRPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface ILocalDRPC extends DistributedRPC.Iface, DistributedRPCInvocati
* Shutdown.
* @deprecated use {@link #close()} instead
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
@Override
void shutdown();
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ public interface IContext {
* This method is invoked at the startup of messaging plugin.
*
* @param topoConf storm configuration
* @deprecated use {@link #prepare(Map, StormMetricRegistry)} instead.
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
void prepare(Map<String, Object> topoConf);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@

/**
* Report CPU used in the cgroup.
*
* @deprecated please use Metrics V2 ({@link org.apache.storm.metrics2.StormMetricRegistry}) instead.
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
public class CGroupCpu extends CGroupMetricsBase<Map<String, Long>> {
long previousSystem = 0;
long previousUser = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
* Report the guaranteed number of ms this worker has requested.
* It gets the result from cpu.shares.
* Use this when org.apache.storm.container.cgroup.CgroupManager is used as the storm.resource.isolation.plugin.
*
* @deprecated please use Metrics V2 ({@link org.apache.storm.metrics2.StormMetricRegistry}) instead.
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
public class CGroupCpuGuarantee extends CGroupMetricsBase<Long> {
long previousTime = -1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
* Report the guaranteed number of ms this worker has requested.
* It gets the result from cpu.cfs_period_us and cpu.cfs_quota_us.
* Use this when org.apache.storm.container.docker.DockerManager is used as the storm.resource.isolation.plugin.
*
* @deprecated please use Metrics V2 ({@link org.apache.storm.metrics2.StormMetricRegistry}) instead.
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
public class CGroupCpuGuaranteeByCfsQuota extends CGroupMetricsBase<Long> {
long previousTime = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@

/**
* Reports the current memory limit of the cgroup for this worker.
*
* @deprecated please use Metrics V2 ({@link org.apache.storm.metrics2.StormMetricRegistry}) instead.
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
public class CGroupMemoryLimit extends CGroupMetricsBase<Long> {
private static final Logger LOG = LoggerFactory.getLogger(CGroupMemoryLimit.class);
private static final long BYTES_PER_MB = 1024 * 1024;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@

/**
* Reports the current memory usage of the cgroup for this worker.
*
* @deprecated please use Metrics V2 ({@link org.apache.storm.metrics2.StormMetricRegistry}) instead.
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
public class CGroupMemoryUsage extends CGroupMetricsBase<Long> {

public CGroupMemoryUsage(Map<String, Object> conf) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@

/**
* Base class for checking if CGroups are enabled, etc.
*
* @deprecated please use Metrics V2 ({@link org.apache.storm.metrics2.StormMetricRegistry}) instead.
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
public abstract class CGroupMetricsBase<T> implements IMetric {
private static final Logger LOG = LoggerFactory.getLogger(CGroupMetricsBase.class);
private boolean enabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ public interface INimbusCredentialPlugin extends Shutdownable {
*
* @param credentials credentials map where more credentials will be added.
* @param topologyConf topology configuration
* @deprecated please use {@link #populateCredentials(Map, Map, String)} instead.
*/
@Deprecated
@Deprecated(since = "2.4.0", forRemoval = true)
default void populateCredentials(Map<String, String> credentials, Map<String, Object> topologyConf) {
throw new IllegalStateException("One of the populateCredentials methods must be overridden by " + this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface IKryoDecorator {
* Decorate the Kryo instance with custom serializations.
* @deprecated use {@link #decorate(Kryo, Map)} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
default void decorate(Kryo k) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ public interface IMetricsContext {
* Register metric.
* @deprecated in favor of metrics v2 (the non-deprecated methods on this class)
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
<T extends IMetric> T registerMetric(String name, T metric, int timeBucketSizeInSecs);

/**
* Register metric.
* @deprecated in favor of metrics v2 (the non-deprecated methods on this class)
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
ReducedMetric registerMetric(String name, IReducer reducer, int timeBucketSizeInSecs);

/**
* Register metric.
* @deprecated in favor of metrics v2 (the non-deprecated methods on this class)
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
CombinedMetric registerMetric(String name, ICombiner combiner, int timeBucketSizeInSecs);

Timer registerTimer(String name);
Expand Down
19 changes: 13 additions & 6 deletions storm-client/src/jvm/org/apache/storm/task/TopologyContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,9 @@ public String toJSONString() {
*
* You must call this during `IBolt.prepare()` or `ISpout.open()`.
* @return The IMetric argument unchanged.
* @deprecated please use Metrics V2 (non-deprecated methods on this class) instead.
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
@Override
public <T extends IMetric> T registerMetric(String name, T metric, int timeBucketSizeInSecs) {
if (openOrPrepareWasCalled.get()) {
Expand Down Expand Up @@ -385,19 +386,23 @@ public <T extends IMetric> T registerMetric(String name, T metric, int timeBucke
return metric;
}

/*
/**
* Convenience method for registering ReducedMetric.
*
* @deprecated please use Metrics V2 (non-deprecated methods on this class) instead.
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
@Override
public ReducedMetric registerMetric(String name, IReducer reducer, int timeBucketSizeInSecs) {
return registerMetric(name, new ReducedMetric(reducer), timeBucketSizeInSecs);
}

/*
/**
* Convenience method for registering CombinedMetric.
*
* @deprecated please use Metrics V2 (non-deprecated methods on this class) instead.
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
@Override
public CombinedMetric registerMetric(String name, ICombiner combiner, int timeBucketSizeInSecs) {
return registerMetric(name, new CombinedMetric(combiner), timeBucketSizeInSecs);
Expand All @@ -407,8 +412,10 @@ public CombinedMetric registerMetric(String name, ICombiner combiner, int timeBu
* Get component's metric from registered metrics by name. Notice: Normally, one component can only register one metric name once. But
* now registerMetric has a bug(https://issues.apache.org/jira/browse/STORM-254) cause the same metric name can register twice. So we
* just return the first metric we meet.
*
* @deprecated please use Metrics V2 (non-deprecated methods on this class) instead.
*/
@Deprecated
@Deprecated(since = "2.3.0", forRemoval = true)
public IMetric getRegisteredMetricByName(String name) {
IMetric metric = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
import java.math.BigInteger;

/**
* This is dead code. It is retained to avoid breaking Kryo registration order.
* This is dead code. It is retained to avoid breaking Kryo registration order.
*
* @deprecated this class is retained only to avoid breaking Kryo registration order and is not intended for active use.
*/
@Deprecated
@Deprecated(since = "0.8.0", forRemoval = false)
public class TransactionAttempt {
BigInteger txid;
long attemptId;
Expand Down
20 changes: 12 additions & 8 deletions storm-client/src/jvm/org/apache/storm/utils/NimbusClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public NimbusClient build() {
* @throws TTransportException on any error.
* @deprecated use {@link Builder #buildWithNimbusHostPort()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public NimbusClient(Map<String, Object> conf, String host, int port, Integer timeout) throws TTransportException {
this(conf, host, port, timeout, null);
}
Expand All @@ -103,12 +103,16 @@ public NimbusClient(Map<String, Object> conf, String host, int port, Integer tim
* @throws TTransportException on any error.
* @deprecated use {@link Builder #buildWithNimbusHostPort()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public NimbusClient(Map<String, Object> conf, String host, Integer port, Integer timeout, String asUser) throws TTransportException {
this(conf, host, port, timeout, asUser, false);
}

@Deprecated
/**
* Constructor.
* @deprecated use {@link Builder} instead.
*/
@Deprecated(since = "2.0.0", forRemoval = true)
public NimbusClient(Map<String, Object> conf, String host, Integer port, Integer timeout, String asUser, boolean useTls)
throws TTransportException {
super(conf, useTls ? ThriftConnectionType.NIMBUS_TLS : ThriftConnectionType.NIMBUS, host, port, timeout, asUser);
Expand All @@ -123,7 +127,7 @@ public NimbusClient(Map<String, Object> conf, String host, Integer port, Integer
* @throws TTransportException on any error.
* @deprecated use {@link Builder #buildWithNimbusHostPort()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public NimbusClient(Map<String, Object> conf, String host) throws TTransportException {
this(conf, host, null, null, null);
}
Expand Down Expand Up @@ -169,7 +173,7 @@ public static void withConfiguredClient(WithNimbus cb, Map<String, Object> conf)
* @return the client, don't forget to close it when done.
* @deprecated use {@link Builder #build()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public static NimbusClient getConfiguredClient(Map<String, Object> conf) {
return getConfiguredClientAs(conf, null);
}
Expand All @@ -181,7 +185,7 @@ public static NimbusClient getConfiguredClient(Map<String, Object> conf) {
* @return the client, don't forget to close it when done.
* @deprecated use {@link Builder #build()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public static NimbusClient getConfiguredClient(Map<String, Object> conf, Integer timeout) {
return getConfiguredClientAs(conf, null, timeout);
}
Expand Down Expand Up @@ -214,7 +218,7 @@ private static synchronized boolean shouldLogLeader(String leader) {
* @return the client, don't forget to close it when done.
* @deprecated use {@link Builder #build()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public static NimbusClient getConfiguredClientAs(Map<String, Object> conf, String asUser) {
return getConfiguredClientAs(conf, asUser, null);
}
Expand All @@ -227,7 +231,7 @@ public static NimbusClient getConfiguredClientAs(Map<String, Object> conf, Strin
* @return the client, don't forget to close it when done.
* @deprecated use {@link Builder #build()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public static NimbusClient getConfiguredClientAs(Map<String, Object> conf, String asUser, Integer timeout) {
return createNimbusClient(conf, asUser, timeout);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private SupervisorClient(Map conf, ThriftConnectionType type, String host, Integ
* @throws TTransportException on any error.
* @deprecated use {@link SupervisorClient.Builder #build()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public SupervisorClient(Map conf, String host, int port) throws TTransportException {
this(conf, host, port, null, null);
}
Expand All @@ -106,7 +106,7 @@ public SupervisorClient(Map conf, String host, int port) throws TTransportExcept
* @throws TTransportException on any error.
* @deprecated use {@link SupervisorClient.Builder #build()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public SupervisorClient(Map conf, String host, int port, Integer timeout) throws TTransportException {
super(conf, ThriftConnectionType.SUPERVISOR, host, port, timeout, null);
client = new Supervisor.Client(protocol);
Expand All @@ -122,7 +122,7 @@ public SupervisorClient(Map conf, String host, int port, Integer timeout) throws
* @throws TTransportException on any error.
* @deprecated use {@link SupervisorClient.Builder #build()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public SupervisorClient(Map conf, String host, Integer port, Integer timeout, String asUser) throws TTransportException {
super(conf, ThriftConnectionType.SUPERVISOR, host, port, timeout, asUser);
client = new Supervisor.Client(protocol);
Expand All @@ -135,7 +135,7 @@ public SupervisorClient(Map conf, String host, Integer port, Integer timeout, St
* @throws TTransportException on any error.
* @deprecated use {@link SupervisorClient.Builder #build()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public SupervisorClient(Map conf, String host) throws TTransportException {
super(conf, ThriftConnectionType.SUPERVISOR, host, null, null, null);
client = new Supervisor.Client(protocol);
Expand All @@ -148,7 +148,7 @@ public SupervisorClient(Map conf, String host) throws TTransportException {
* @return the client, don't forget to close it when done.
* @deprecated use {@link SupervisorClient.Builder #createSupervisorClient()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public static SupervisorClient getConfiguredClient(Map conf, String host) {
//use the default server port.
int port = Integer.parseInt(conf.get(Config.SUPERVISOR_THRIFT_PORT).toString());
Expand All @@ -163,7 +163,7 @@ public static SupervisorClient getConfiguredClient(Map conf, String host) {
* @return the client, don't forget to close it when done.
* @deprecated use {@link SupervisorClient.Builder #createSupervisorClient()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public static SupervisorClient getConfiguredClient(Map conf, String host, int port) {
return getConfiguredClientAs(conf, host, port, null);
}
Expand All @@ -177,7 +177,7 @@ public static SupervisorClient getConfiguredClient(Map conf, String host, int po
* @return the client, don't forget to close it when done.
* @deprecated use {@link SupervisorClient.Builder #createSupervisorClient()} instead.
*/
@Deprecated
@Deprecated(since = "2.0.0", forRemoval = true)
public static SupervisorClient getConfiguredClientAs(Map conf, String host, int port, String asUser) {
if (conf.containsKey(Config.STORM_DO_AS_USER)) {
if (asUser != null && !asUser.isEmpty()) {
Expand Down
4 changes: 2 additions & 2 deletions storm-client/src/jvm/org/apache/storm/utils/Time.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static long secsToMillisLong(double secs) {
* {@link #currentTimeSecsLong()} for absolute timestamps; this method remains
* valid only for short relative durations such as uptime.
*/
@Deprecated
@Deprecated(since = "3.0.0", forRemoval = false)
public static int currentTimeSecs() {
return (int) (currentTimeMillis() / 1000);
}
Expand All @@ -176,7 +176,7 @@ public static long currentTimeSecsLong() {
* @deprecated int epoch-seconds overflow on 2038-01-19T03:14:07Z. Use
* {@link #deltaSecsLong(long)} when the reference point is an absolute timestamp.
*/
@Deprecated
@Deprecated(since = "3.0.0", forRemoval = false)
public static int deltaSecs(int timeInSeconds) {
return Time.currentTimeSecs() - timeInSeconds;
}
Expand Down
5 changes: 3 additions & 2 deletions storm-client/src/jvm/org/apache/storm/utils/TimeCacheMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
*
* <p>The advantage of this design is that the expiration thread only locks the object for O(1) time, meaning the object
* is essentially always available for gets/puts.
*
* @deprecated in favor of non-threaded {@link RotatingMap}.
*/
//deprecated in favor of non-threaded RotatingMap
@Deprecated
@Deprecated(since = "0.7.0", forRemoval = true)
public class TimeCacheMap<K, V> {
//this default ensures things expire at most 50% past the expiration time
private static final int DEFAULT_NUM_BUCKETS = 3;
Expand Down