diff --git a/storm-client/src/jvm/org/apache/storm/Config.java b/storm-client/src/jvm/org/apache/storm/Config.java index 9c275f82c40..a892eceb7e8 100644 --- a/storm-client/src/jvm/org/apache/storm/Config.java +++ b/storm-client/src/jvm/org/apache/storm/Config.java @@ -364,8 +364,10 @@ public class Config extends HashMap { * 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"; /** diff --git a/storm-client/src/jvm/org/apache/storm/ILocalCluster.java b/storm-client/src/jvm/org/apache/storm/ILocalCluster.java index 8e7cfa8f4fe..d344d9f1874 100644 --- a/storm-client/src/jvm/org/apache/storm/ILocalCluster.java +++ b/storm-client/src/jvm/org/apache/storm/ILocalCluster.java @@ -111,7 +111,7 @@ ILocalTopology submitTopologyWithOpts(String topologyName, Map c * * @deprecated use {@link #close()} instead. */ - @Deprecated + @Deprecated(since = "2.0.0", forRemoval = true) void shutdown(); /** diff --git a/storm-client/src/jvm/org/apache/storm/ILocalDRPC.java b/storm-client/src/jvm/org/apache/storm/ILocalDRPC.java index 037239ba14d..365fc87c480 100644 --- a/storm-client/src/jvm/org/apache/storm/ILocalDRPC.java +++ b/storm-client/src/jvm/org/apache/storm/ILocalDRPC.java @@ -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(); } diff --git a/storm-client/src/jvm/org/apache/storm/messaging/IContext.java b/storm-client/src/jvm/org/apache/storm/messaging/IContext.java index 58b09752bfd..dced4af6608 100644 --- a/storm-client/src/jvm/org/apache/storm/messaging/IContext.java +++ b/storm-client/src/jvm/org/apache/storm/messaging/IContext.java @@ -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 topoConf); /** diff --git a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpu.java b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpu.java index aef62eebe94..5ee2515423c 100644 --- a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpu.java +++ b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpu.java @@ -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> { long previousSystem = 0; long previousUser = 0; diff --git a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpuGuarantee.java b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpuGuarantee.java index 5fa1e0277d0..ca15a2adbf8 100644 --- a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpuGuarantee.java +++ b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpuGuarantee.java @@ -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 previousTime = -1; diff --git a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpuGuaranteeByCfsQuota.java b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpuGuaranteeByCfsQuota.java index 36dce34f96f..17be1b4f16e 100644 --- a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpuGuaranteeByCfsQuota.java +++ b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupCpuGuaranteeByCfsQuota.java @@ -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 previousTime = 0; diff --git a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMemoryLimit.java b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMemoryLimit.java index e306a1865e4..322ca6784de 100644 --- a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMemoryLimit.java +++ b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMemoryLimit.java @@ -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 { private static final Logger LOG = LoggerFactory.getLogger(CGroupMemoryLimit.class); private static final long BYTES_PER_MB = 1024 * 1024; diff --git a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMemoryUsage.java b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMemoryUsage.java index 99edccb6368..520e85f908b 100644 --- a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMemoryUsage.java +++ b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMemoryUsage.java @@ -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 { public CGroupMemoryUsage(Map conf) { diff --git a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMetricsBase.java b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMetricsBase.java index 16c5d73ef19..31b7ec95552 100644 --- a/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMetricsBase.java +++ b/storm-client/src/jvm/org/apache/storm/metric/cgroup/CGroupMetricsBase.java @@ -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 implements IMetric { private static final Logger LOG = LoggerFactory.getLogger(CGroupMetricsBase.class); private boolean enabled; diff --git a/storm-client/src/jvm/org/apache/storm/security/INimbusCredentialPlugin.java b/storm-client/src/jvm/org/apache/storm/security/INimbusCredentialPlugin.java index 8f302665307..a23afe73297 100644 --- a/storm-client/src/jvm/org/apache/storm/security/INimbusCredentialPlugin.java +++ b/storm-client/src/jvm/org/apache/storm/security/INimbusCredentialPlugin.java @@ -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 credentials, Map topologyConf) { throw new IllegalStateException("One of the populateCredentials methods must be overridden by " + this); } diff --git a/storm-client/src/jvm/org/apache/storm/serialization/IKryoDecorator.java b/storm-client/src/jvm/org/apache/storm/serialization/IKryoDecorator.java index 2d6dc989823..9360f29e5f0 100644 --- a/storm-client/src/jvm/org/apache/storm/serialization/IKryoDecorator.java +++ b/storm-client/src/jvm/org/apache/storm/serialization/IKryoDecorator.java @@ -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) { } diff --git a/storm-client/src/jvm/org/apache/storm/task/IMetricsContext.java b/storm-client/src/jvm/org/apache/storm/task/IMetricsContext.java index 802ec5af6e7..41adef90bdf 100644 --- a/storm-client/src/jvm/org/apache/storm/task/IMetricsContext.java +++ b/storm-client/src/jvm/org/apache/storm/task/IMetricsContext.java @@ -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 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); diff --git a/storm-client/src/jvm/org/apache/storm/task/TopologyContext.java b/storm-client/src/jvm/org/apache/storm/task/TopologyContext.java index ab028bbef85..a664c8cba98 100644 --- a/storm-client/src/jvm/org/apache/storm/task/TopologyContext.java +++ b/storm-client/src/jvm/org/apache/storm/task/TopologyContext.java @@ -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 registerMetric(String name, T metric, int timeBucketSizeInSecs) { if (openOrPrepareWasCalled.get()) { @@ -385,19 +386,23 @@ public 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); @@ -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; diff --git a/storm-client/src/jvm/org/apache/storm/transactional/TransactionAttempt.java b/storm-client/src/jvm/org/apache/storm/transactional/TransactionAttempt.java index 150c9300d9e..18707fdbcf4 100644 --- a/storm-client/src/jvm/org/apache/storm/transactional/TransactionAttempt.java +++ b/storm-client/src/jvm/org/apache/storm/transactional/TransactionAttempt.java @@ -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; diff --git a/storm-client/src/jvm/org/apache/storm/utils/NimbusClient.java b/storm-client/src/jvm/org/apache/storm/utils/NimbusClient.java index 2b5e77628a0..48a854dddda 100644 --- a/storm-client/src/jvm/org/apache/storm/utils/NimbusClient.java +++ b/storm-client/src/jvm/org/apache/storm/utils/NimbusClient.java @@ -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 conf, String host, int port, Integer timeout) throws TTransportException { this(conf, host, port, timeout, null); } @@ -103,12 +103,16 @@ public NimbusClient(Map 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 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 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); @@ -123,7 +127,7 @@ public NimbusClient(Map 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 conf, String host) throws TTransportException { this(conf, host, null, null, null); } @@ -169,7 +173,7 @@ public static void withConfiguredClient(WithNimbus cb, Map 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 conf) { return getConfiguredClientAs(conf, null); } @@ -181,7 +185,7 @@ public static NimbusClient getConfiguredClient(Map 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 conf, Integer timeout) { return getConfiguredClientAs(conf, null, timeout); } @@ -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 conf, String asUser) { return getConfiguredClientAs(conf, asUser, null); } @@ -227,7 +231,7 @@ public static NimbusClient getConfiguredClientAs(Map 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 conf, String asUser, Integer timeout) { return createNimbusClient(conf, asUser, timeout); } diff --git a/storm-client/src/jvm/org/apache/storm/utils/SupervisorClient.java b/storm-client/src/jvm/org/apache/storm/utils/SupervisorClient.java index e52286a08ee..fc91c93f63f 100644 --- a/storm-client/src/jvm/org/apache/storm/utils/SupervisorClient.java +++ b/storm-client/src/jvm/org/apache/storm/utils/SupervisorClient.java @@ -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); } @@ -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); @@ -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); @@ -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); @@ -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()); @@ -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); } @@ -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()) { diff --git a/storm-client/src/jvm/org/apache/storm/utils/Time.java b/storm-client/src/jvm/org/apache/storm/utils/Time.java index 9946b46e8c9..14b84fd4bc3 100644 --- a/storm-client/src/jvm/org/apache/storm/utils/Time.java +++ b/storm-client/src/jvm/org/apache/storm/utils/Time.java @@ -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); } @@ -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; } diff --git a/storm-client/src/jvm/org/apache/storm/utils/TimeCacheMap.java b/storm-client/src/jvm/org/apache/storm/utils/TimeCacheMap.java index 7d8521969f0..fa2af1eb13c 100644 --- a/storm-client/src/jvm/org/apache/storm/utils/TimeCacheMap.java +++ b/storm-client/src/jvm/org/apache/storm/utils/TimeCacheMap.java @@ -23,9 +23,10 @@ * *

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 { //this default ensures things expire at most 50% past the expiration time private static final int DEFAULT_NUM_BUCKETS = 3;