You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2017/02/07 01:28:22 UTC
[09/12] storm git commit: [STORM-1961] Added interface stability
annotation
[STORM-1961] Added interface stability annotation
1. Added interface stability annotation (borrowed from hadoop)
2. Marked relevant stream api classes 'Unstable'
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/a07039fc
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/a07039fc
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/a07039fc
Branch: refs/heads/master
Commit: a07039fc07f6f2aa5d3baeaf5107359218d84b5c
Parents: dc19597
Author: Arun Mahadevan <ar...@apache.org>
Authored: Fri Jan 20 10:33:09 2017 +0530
Committer: Arun Mahadevan <ar...@apache.org>
Committed: Tue Jan 24 17:33:40 2017 +0530
----------------------------------------------------------------------
.../storm/annotation/InterfaceStability.java | 54 ++++++++++++++++++++
.../org/apache/storm/streams/PairStream.java | 2 +
.../jvm/org/apache/storm/streams/Stream.java | 2 +
.../org/apache/storm/streams/StreamBuilder.java | 2 +
.../storm/streams/processors/Processor.java | 3 ++
.../streams/processors/ProcessorContext.java | 3 ++
6 files changed, 66 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/a07039fc/storm-core/src/jvm/org/apache/storm/annotation/InterfaceStability.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/annotation/InterfaceStability.java b/storm-core/src/jvm/org/apache/storm/annotation/InterfaceStability.java
new file mode 100644
index 0000000..d05ae75
--- /dev/null
+++ b/storm-core/src/jvm/org/apache/storm/annotation/InterfaceStability.java
@@ -0,0 +1,54 @@
+/**
+ * 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.storm.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Annotation to inform users of how much to rely on a particular package,
+ * class or method not changing over time.
+ * </ul>
+ */
+@InterfaceStability.Evolving
+public class InterfaceStability {
+ /**
+ * Can evolve while retaining compatibility for minor release boundaries.;
+ * can break compatibility only at major release (ie. at m.0).
+ */
+ @Documented
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Stable {};
+
+ /**
+ * Evolving, but can break compatibility at minor release (i.e. m.x)
+ */
+ @Documented
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Evolving {};
+
+ /**
+ * No guarantee is provided as to reliability or stability across any
+ * level of release granularity.
+ */
+ @Documented
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Unstable {};
+}
+
http://git-wip-us.apache.org/repos/asf/storm/blob/a07039fc/storm-core/src/jvm/org/apache/storm/streams/PairStream.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/streams/PairStream.java b/storm-core/src/jvm/org/apache/storm/streams/PairStream.java
index 69e6c37..3c08a05 100644
--- a/storm-core/src/jvm/org/apache/storm/streams/PairStream.java
+++ b/storm-core/src/jvm/org/apache/storm/streams/PairStream.java
@@ -18,6 +18,7 @@
package org.apache.storm.streams;
import org.apache.storm.Config;
+import org.apache.storm.annotation.InterfaceStability;
import org.apache.storm.streams.operations.BiFunction;
import org.apache.storm.streams.operations.CombinerAggregator;
import org.apache.storm.streams.operations.Consumer;
@@ -50,6 +51,7 @@ import java.util.Set;
* @param <K> the key type
* @param <V> the value type
*/
+@InterfaceStability.Unstable
public class PairStream<K, V> extends Stream<Pair<K, V>> {
PairStream(StreamBuilder topology, Node node) {
http://git-wip-us.apache.org/repos/asf/storm/blob/a07039fc/storm-core/src/jvm/org/apache/storm/streams/Stream.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/streams/Stream.java b/storm-core/src/jvm/org/apache/storm/streams/Stream.java
index ef03ae3..087e760 100644
--- a/storm-core/src/jvm/org/apache/storm/streams/Stream.java
+++ b/storm-core/src/jvm/org/apache/storm/streams/Stream.java
@@ -17,6 +17,7 @@
*/
package org.apache.storm.streams;
+import org.apache.storm.annotation.InterfaceStability;
import org.apache.storm.streams.operations.BiFunction;
import org.apache.storm.streams.operations.CombinerAggregator;
import org.apache.storm.streams.operations.Consumer;
@@ -58,6 +59,7 @@ import java.util.Set;
*
* @param <T> the type of the value
*/
+@InterfaceStability.Unstable
public class Stream<T> {
private static final Logger LOG = LoggerFactory.getLogger(Stream.class);
http://git-wip-us.apache.org/repos/asf/storm/blob/a07039fc/storm-core/src/jvm/org/apache/storm/streams/StreamBuilder.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/streams/StreamBuilder.java b/storm-core/src/jvm/org/apache/storm/streams/StreamBuilder.java
index 0bf02be..8b6c57d 100644
--- a/storm-core/src/jvm/org/apache/storm/streams/StreamBuilder.java
+++ b/storm-core/src/jvm/org/apache/storm/streams/StreamBuilder.java
@@ -21,6 +21,7 @@ import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Multimap;
import com.google.common.collect.Table;
+import org.apache.storm.annotation.InterfaceStability;
import org.apache.storm.generated.StormTopology;
import org.apache.storm.streams.operations.IdentityFunction;
import org.apache.storm.streams.operations.mappers.PairValueMapper;
@@ -58,6 +59,7 @@ import java.util.stream.Collectors;
/**
* A builder for constructing a {@link StormTopology} via storm streams api (DSL)
*/
+@InterfaceStability.Unstable
public class StreamBuilder {
private static final Logger LOG = LoggerFactory.getLogger(StreamBuilder.class);
private final DefaultDirectedGraph<Node, Edge> graph;
http://git-wip-us.apache.org/repos/asf/storm/blob/a07039fc/storm-core/src/jvm/org/apache/storm/streams/processors/Processor.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/streams/processors/Processor.java b/storm-core/src/jvm/org/apache/storm/streams/processors/Processor.java
index 5551682..3b4518d 100644
--- a/storm-core/src/jvm/org/apache/storm/streams/processors/Processor.java
+++ b/storm-core/src/jvm/org/apache/storm/streams/processors/Processor.java
@@ -17,6 +17,8 @@
*/
package org.apache.storm.streams.processors;
+import org.apache.storm.annotation.InterfaceStability;
+
import java.io.Serializable;
/**
@@ -24,6 +26,7 @@ import java.io.Serializable;
*
* @param <T> the type of the input that is processed
*/
+@InterfaceStability.Unstable
public interface Processor<T> extends Serializable {
/**
* Initializes the processor. This is typically invoked from the underlying
http://git-wip-us.apache.org/repos/asf/storm/blob/a07039fc/storm-core/src/jvm/org/apache/storm/streams/processors/ProcessorContext.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/streams/processors/ProcessorContext.java b/storm-core/src/jvm/org/apache/storm/streams/processors/ProcessorContext.java
index 2a10a22..a69a0a9 100644
--- a/storm-core/src/jvm/org/apache/storm/streams/processors/ProcessorContext.java
+++ b/storm-core/src/jvm/org/apache/storm/streams/processors/ProcessorContext.java
@@ -17,12 +17,15 @@
*/
package org.apache.storm.streams.processors;
+import org.apache.storm.annotation.InterfaceStability;
+
import java.io.Serializable;
import java.util.Set;
/**
* Context information passed to the {@link Processor}.
*/
+@InterfaceStability.Unstable
public interface ProcessorContext extends Serializable {
/**
* Forwards the input to all downstream processors.