forked from apache/samza
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some suggestions for an Operator API refactor and misc. cleanup. It does contain some implementation changes, mostly due to deleted, extracted or merged classes. (e.g. OperatorFactory + ChainedOperators == OperatorImpls). Since git marked several moved classes as (delete + new) instead, it's probably best to apply the diff locally and browse the code in an IDE. Some of the changes, in no particular order: * Extracted XFunction interfaces into a .functions package in -api. * -api's internal.Operators is now the -operators's spec.* package. Extracted interfaces and classes. Factory methods are now in OperatorSpecs. * -api's MessageStreams is now -api's MessageStream interface and -operators's MessageStreamImpl. * -api's internal.Windows classes are now in -api's .window package. Extracted interfaces and classes, but no implementation changes. * OperatorFactory + ChainedOperators is now OperatorImpls, which is used from StreamOperatorAdaptorTask. * Added a NoOpOperatorImpl, which acts as the root node for the OperatorImpl DAG returned by OperatorImpls. * Removed usages of reactivestreams APIs since current code looks simpler without them. We can add them back when we need features like backpressure etc. * Removed the InputSystemMessage interface. * Made field names consistent (e.g Fn suffix for functions everywhere etc.). * Some method/class visibility changes due to moved classes. * General documentation changes, mostly to make public APIs clearer. There are additional questions/tasks that we can address in future RBs: * Updating Window and Trigger APIs. * Merging samza-operator into samza-core. * Questions about Message timestamp and Offset comparison semantics. * Questions about OperatorSpec serialization (e.g. ID generation). * Questions about StateStoreImpl and StoreFunctions. Author: Prateek Maheshwari <[email protected]> Reviewers: Yi Pan <[email protected]>, Jagadish <[email protected]> Closes apache#25 from prateekm/master
- Loading branch information
Showing
71 changed files
with
2,722 additions
and
2,588 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 0 additions & 81 deletions
81
samza-api/src/main/java/org/apache/samza/operators/MessageStreams.java
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
samza-api/src/main/java/org/apache/samza/operators/StreamOperatorTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* 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.samza.operators; | ||
|
||
import org.apache.samza.annotation.InterfaceStability; | ||
import org.apache.samza.operators.data.IncomingSystemMessageEnvelope; | ||
import org.apache.samza.system.SystemStreamPartition; | ||
|
||
import java.util.Map; | ||
|
||
|
||
/** | ||
* A {@link StreamOperatorTask} is the basic interface to implement for processing {@link MessageStream}s. | ||
* Implementations can describe the transformation steps for each {@link MessageStream} in the | ||
* {@link #transform} method using {@link MessageStream} APIs. | ||
* <p> | ||
* Implementations may be augmented by implementing {@link org.apache.samza.task.InitableTask}, | ||
* {@link org.apache.samza.task.WindowableTask} and {@link org.apache.samza.task.ClosableTask} interfaces, | ||
* but should not implement {@link org.apache.samza.task.StreamTask} or {@link org.apache.samza.task.AsyncStreamTask} | ||
* interfaces. | ||
*/ | ||
@InterfaceStability.Unstable | ||
public interface StreamOperatorTask { | ||
|
||
/** | ||
* Describe the transformation steps for each {@link MessageStream}s for this task using the | ||
* {@link MessageStream} APIs. Each {@link MessageStream} corresponds to one {@link SystemStreamPartition} | ||
* in the input system. | ||
* | ||
* @param messageStreams the {@link MessageStream}s that receive {@link IncomingSystemMessageEnvelope}s | ||
* from their corresponding {@link org.apache.samza.system.SystemStreamPartition} | ||
*/ | ||
void transform(Map<SystemStreamPartition, MessageStream<IncomingSystemMessageEnvelope>> messageStreams); | ||
|
||
} |
Oops, something went wrong.